Jump to content
Sign in to follow this  
Spartacus2

Punching.

Recommended Posts

Hey guys, I've been searching google, trying scripts, and making stuff up for the past 2 weeks trying to make a zombie map in Cold War Crisis, and I cant get it.

I've been trying to make it a zombie map, so I tried using punching. I've set up this code in the units activation...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">removeallweapons this; this addweapon "strokefist"; this addmagazine "strokefist";this setUnitPos "UP";

but it doesnt work. They just stand there...

Someone please tell me how to make the enemies chase and hit me and the other people. Thanks.

Share this post


Link to post
Share on other sites

It's

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unitname switchmove standstrokefist

and

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unitname switchmove standstrokefistend

and use a trigger or a script for it, not unit's init line.

For chasing use domove command and use some looping of course.

Share this post


Link to post
Share on other sites
Quote[/b] ]It's

Code Sample  

unitname switchmove standstrokefist

and

Code Sample  

unitname switchmove standstrokefistend

and use a trigger or a script for it, not unit's init line.

For chasing use domove command and use some looping of course.

Not it isn't, Spartacus2 is right, there's a weapon in Ofp that allows to punch someone else, the only prob is that this weapon has very low priority in BIS config so AI never uses it.

If you wanna create a weapon that works, copy and paste the following config in a text editor, then name it "config.cpp", then put it in a folder (whatever the name of it is), make it a pbo file (with ofp tool like makepbo or Pbox) and put it in Ofp addons folder.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot  0     // dummy weapons

#define WeaponSlotPrimary 1     // primary weapons

#define WeaponSlotSecondary 16     // secondary weapons

#define WeaponSlotHandGun 2     // HandGun

#define WeaponSlotHandGunItem 32     // HandGun magazines

#define WeaponSlotItem  256     // items

#define WeaponSlotBinocular 4096     // binocular

#define WeaponHardMounted 65536

class CfgPatches

{

class MySuperFist

{

units[] = {};

weapons[] = {};

requiredVersion = 1.75;

};

};

class CfgAmmo

{

class default {};

class StrokeFistHit: Default {};

class MySuperFistAmmo:StrokeFistHit

{

hit=2;indirectHit=0.5;indirectHitRange=0.2;

minRange=0.1;

minRangeProbab=0.40;

midRange=2.0;

midRangeProbab=0.96;

maxRange=3.0;

maxRangeProbab=0.01;

};

};

class CfgWeapons

{

class default{};

class StrokeFist:Default {};

class MySuperFist: Strokefist

{

scopeWeapon=2;

scopeMagazine=2;

ammo="MySuperFistAmmo";

magazines[] = {fMySuperFist};

enableAttack=1;

initSpeed=300;

count=9999;

primary = 10;

};

};

And give your soldiers this weapon as you were doing :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">removeallweapons this; this addweapon "MySuperfist"; this addmagazine "Mysuperfist";this setUnitPos "UP";

Share this post


Link to post
Share on other sites
Not it isn't

Well, it works for me.

Do they wound or kill you by playing these animations huh.gif

Share this post


Link to post
Share on other sites

Uhm, ok, I put the long code you told me in a notepad and saved it as 'config.cpp'. Then I made a folder and called it 'Mysuperfist' and put the config.cpp in it. Then I made the folder a .pbo. I put it in my 'Codemasters/OFP/addons' folder, and then went into mission editor and made an east member with the other code you sent me. Then I put a west member as player, and hit "Test" and it gave me an error.

What did I do wrong?

EDIT: Sorry guys, I'm pretty much OFP illiterate. I just got the game, and I've never programmed or done anything with .pbo, .cpp, or anything else. This is all REALLY new to me, so I need you to tell me how to make em' punch as if you were speaking to a 9 year old.

Also, I have another question...

I need a step by step on EXACTLY what to do once I download Farmland Mod Horror Pack 3 to get it to work. Can anyone help me with this?

If you want, you can message me on AIM at CPTCurbstomp

Share this post


Link to post
Share on other sites

There is a typo error, try with this one :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot  0     // dummy weapons

#define WeaponSlotPrimary 1     // primary weapons

#define WeaponSlotSecondary 16     // secondary weapons

#define WeaponSlotHandGun 2     // HandGun

#define WeaponSlotHandGunItem 32     // HandGun magazines

#define WeaponSlotItem  256     // items

#define WeaponSlotBinocular 4096     // binocular

#define WeaponHardMounted 65536

class CfgPatches

{

class MySuperFist

{

units[] = {};

weapons[] = {};

requiredVersion = 1.75;

};

};

class CfgAmmo

{

class default {};

class StrokeFistHit: Default {};

class MySuperFistAmmo:StrokeFistHit

{

hit=2;indirectHit=0.5;indirectHitRange=0.2;

minRange=0.1;

minRangeProbab=0.40;

midRange=2.0;

midRangeProbab=0.96;

maxRange=3.0;

maxRangeProbab=0.01;

};

};

class CfgWeapons

{

class default{};

class StrokeFist:Default {};

class MySuperFist: Strokefist

{

scopeWeapon=2;

scopeMagazine=2;

ammo="MySuperFistAmmo";

magazines[] = {MySuperFist};

enableAttack=1;

initSpeed=300;

count=9999;

primary = 10;

};

};

Share this post


Link to post
Share on other sites
Do they wound or kill you by playing these animations huh.gif

Nothing what with a little scripting can't be done. But if you want to do it on a more 'fancy' way ...  wink_o.gif

Sorry guys, I'm pretty much OFP illiterate. I just got the game, and I've never programmed or done anything with .pbo, .cpp, or anything else. This is all REALLY new to me, so I need you to tell me how to make em' punch as if you were speaking to a 9 year old.

Well, then maybe you should do something -for instance some more easier missions for starters- what you can 'chew' right now, to learn and to gain some expirince, you can't expect that someone will always guide you like a 9 year old, such things can be a painstaking jobs (we're not in the same room you know wink_o.gif ), and people don't have a time for it (at least I haven't), neather the will. smile_o.gif  And reading some tutorials also can't hurt. wink_o.gif

Share this post


Link to post
Share on other sites

Well, I exaggerated my post a bit. I am not -brand- new to OFP, but new to modding characters via codes to make them attack in different ways (Zombies). I've done maps before, and scripting, and coding, and triggers, etc. I've read tutorials and all that good stuff, but I can't seem to grasp the concept of this whole thing for some reason.

Thanks for the replies.

I HAVE to be doing something wrong here.

I copied the new code you put down, put it in a notepad document, saved it as 'config.cpp'. Then I made a folder called 'Mysuperfist', and put the config.cpp inside of it. Then I converted the folder to PBO, and put it in codemasters/ofp/addons. I put the small code in the enemies init box and it gave me an error like 'config.bin/cfg' or something like that, and closed my game.

What did I do wrong?

Share this post


Link to post
Share on other sites

I don't understand, i've just tried it and it works. Try to put it in the Res\addons folder maybe...

And some other things :

(1) squad leader (ie alone units) will not "attack" you unless you're very close to them ; so group "zombies" together and they will attack ;

(2) you can increase the power of the hit, by increasing the hit value in the config ammo here (because hit=2 is very weak) :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hit=2;indirectHit=0.5;indirectHitRange=0.2;

(3) It's a very natural way of doing, which i do prefer (using Ofp weapons instead of script) but Blacksphere is right that you can use scripts to simulate close combat, which are always more efficient (because Ofp does not handle very well combat between units that are close to each others) but sometimes more laggy. Close combat scripts are always built the same way (move to the target ; play an anim ; target setdammage some value ; if target is not dead, repeat the loop).

(4) I can't help you with FML scripting, but look through FML threads and read the readmes, it should be enough. Most of the time, the things you have to do is to put a particular game logic on the map and/or to create a particular array of targets with a trigger. It shouldn't be that hard.

Share this post


Link to post
Share on other sites

I was looking over this post here and that was fun. Nice little addon.

If the past inquiry wasen't met by the request of the person. Maybe I can lend a guide.

Just do it as the person says above. Here's what I did.

1) Opened notepad. Copied the code into the note pad. Saved it as config.cpp.

2) Then you have to have a "MakePbo" where it makes a pbo file for you. It will take that CPP file and create a pbo file with it.

Do you have this MakePBO program?

3) There we go, now we have the first addon. Also then I ran OFP, then opened up the editor and placed this code in the initialization of the player.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">removeallweapons this; this addweapon "MySuperfist"; this addmagazine "Mysuperfist";this setUnitPos "UP";

That did the trick, hoped that helped..

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×