Home   Help Search Login Register  

Author Topic: one setcaptive question and one health config question  (Read 1296 times)

0 Members and 1 Guest are viewing this topic.

Offline pexmo

  • Members
  • *
  • I'm a llama!
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?
« Last Edit: 14 Dec 2004, 12:28:34 by pexmo »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:one setcaptive question and one health config question
« Reply #1 on: 14 Dec 2004, 12:39:37 »
Trigger, repeatedly

Condition:   getDammage loon1 < 0.5
On Activation:  loon1 setCaptive true
On Deactivation:   loon1 setCaptive false

Not guaranteed.
Plenty of reviewed ArmA missions for you to play

Offline pexmo

  • Members
  • *
  • I'm a llama!
Re:one setcaptive question and one health config question
« Reply #2 on: 14 Dec 2004, 12:46:56 »
then is loon 1 only for player 1? should i add for loon2 etc?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:one setcaptive question and one health config question
« Reply #3 on: 14 Dec 2004, 12:51:13 »
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.
Plenty of reviewed ArmA missions for you to play

Offline pexmo

  • Members
  • *
  • I'm a llama!
Re:one setcaptive question and one health config question
« Reply #4 on: 14 Dec 2004, 13:09:25 »
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.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:one setcaptive question and one health config question
« Reply #5 on: 14 Dec 2004, 13:44:00 »
getDammage is 0 at the start of a mission.     You're measuring damage, not health.
Plenty of reviewed ArmA missions for you to play

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:one setcaptive question and one health config question
« Reply #6 on: 14 Dec 2004, 22:08:50 »
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

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:one setcaptive question and one health config question
« Reply #7 on: 14 Dec 2004, 22:51:56 »
More than likely.   ;D   As I've said before, everthing I write comes with a health warning.
Plenty of reviewed ArmA missions for you to play

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:one setcaptive question and one health config question
« Reply #8 on: 14 Dec 2004, 23:00:57 »
hah! a play on words!
Quote
a health warning.
we're talking about health... i'll just go sit in my corner now.... :'(

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:one setcaptive question and one health config question
« Reply #9 on: 15 Dec 2004, 07:26:29 »
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)

Quote
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:

Code: [Select]
      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!
« Last Edit: 15 Dec 2004, 07:28:10 by General Barron »
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!