OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: pexmo on 14 Dec 2004, 12:27:30
-
OK its like this:
What i wanna do: Make a script that sets a player/players that has health .5 or below to setcaptive true. And then at .6 and above sets the pler/players to setcaptive false.
Then i have a config editing question: is there a way to edit the amount of maximum health on (this is the one i realy want) a sertain unit in the config or something or can you alter the maximum amount of helth for all soldiers in the game. Sorry to ask this but i cant get a good result with any of the superman, thoughdude scripts the guys just keep acting wierd and standing up randomly when hit etc.
yeah and one more thing... how do i edit the config file ? any program for it?
-
Trigger, repeatedly
Condition: getDammage loon1 < 0.5
On Activation: loon1 setCaptive true
On Deactivation: loon1 setCaptive false
Not guaranteed.
-
then is loon 1 only for player 1? should i add for loon2 etc?
-
You need a trigger for each unit, and obviously each unit must have the appropriate name. You can't use "player" since triggers are global and I'm assuming this is for a MP mission.
-
tested the trigger and replaced the loon1 with the name of the player unit. Didnt seem to work. It seems that p1 is then starting directly as setcaptive true. But has health 1 at the start.
-
getDammage is 0 at the start of a mission. You're measuring damage, not health.
-
maccy, you made a typo
it should be:
Condition: getDammage loon1 > 0.5
On Activation: loon1 setCaptive true
On Deactivation: loon1 setCaptive false
when he has taken over .5 dammage (less than .5 health) he will be captive
-
More than likely. ;D As I've said before, everthing I write comes with a health warning.
-
hah! a play on words!
a health warning.
we're talking about health... i'll just go sit in my corner now.... :'(
-
Be warned that the getdammage command is rather... imperfect. A unit can die with the command only returning like 0.2, or he can be walking still and be at 0.9. So it doesn't really return a nice, neat percentage representing a unit's total damage. It's all we got though, but just be warned. 8)
Then i have a config editing question: is there a way to edit the amount of maximum health on (this is the one i realy want) a sertain unit in the config or something or can you alter the maximum amount of helth for all soldiers in the game.
In a unit's config, you need these lines:
      armor=X;
      armorHead=X;
      armorBody=X;
      armorHands=X;
      armorLegs=X;Just replace the X's with whatever number you like. I believe the default man has something like 3/.5/.8/.6/.7 respectively. Don't ask me what the numbers mean or how they work. You likely don't want it more than double the default though.
If you want to do that for all units in the game, then you need to get a hold of the game's config file. You can find one right here:
http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=bdba561697823f0ba8692d8593322e0b;act=ST;f=51;t=41783
Open that up, find where the "man" class is defined, and then find the lines like the ones I showed you. Just change the numbers, and then use the cpp->bin utility (search the ofp file tools section) to compile it. Then put it in your res/bin folder (backup your old config), and you're good to go!