Home   Help Search Login Register  

Author Topic: The setDamage command  (Read 2083 times)

0 Members and 1 Guest are viewing this topic.

Offline Joiner

  • Members
  • *
The setDamage command
« on: 16 Apr 2009, 20:57:31 »
Hello guys!
I'm making a cut scene in which a soldier is supposed to crawl being wounded. I use the setDamage command to "wound" him (soldier1 setDamage 0.9), but he doesn't crawl! There is a lot of blood on him, but he keeps running. If I specify a greater value ("soldier1 setDamage 0.95" or even "soldier1 setDamage 0.91") he dies immediately. Is there a way to disable just legs so that he cannot run? An example would be appreciated.
Thanks in advance!

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: The setDamage command
« Reply #1 on: 16 Apr 2009, 21:24:10 »
I'd use setUnitPos to keep him prone.
try { return true; } finally { return false; }

Offline Joiner

  • Members
  • *
Re: The setDamage command
« Reply #2 on: 16 Apr 2009, 22:16:43 »
Thanks!
However, is there a way to wound just legs of a unit? I've heard that legs and arms are hit separately, I mean the damage is calculated separately and then it is summed to get the overall damage.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: The setDamage command
« Reply #3 on: 16 Apr 2009, 23:08:39 »
As far as I'm aware, it's the hands and 'everywhere else' that gets hit.  You can check if the hands are injured by using handsHit - but I'm not sure how you'd go about damaging a specific area...

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: The setDamage command
« Reply #4 on: 16 Apr 2009, 23:12:42 »
The only way to do this is to create bullets around his leg area until he gets hit by one of them. Such a horrendous hack it is unbelievable (and lots of situations where it wouldn't work). Hits are managed by the game engine by hit location, but we, as scripters only have access to read or write the overall damage value (for infantry and vehicles). Well, we can check handsHit and canStand to see if arm or leg areas, respectively, have been damaged, but we can't even tell how much damage has been applied to those locations.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Deadfast

  • Members
  • *
Re: The setDamage command
« Reply #5 on: 16 Apr 2009, 23:25:07 »
Here is a script I made a while back that creates a bullet to hit the unit's legs.

However as Spooner said this is very unreliable (unit can get killed) so personally, for an AI, I'd suggest setUnitPos "DOWN" (to force the unit to stay prone) and a little setDamage for the blood effect ;)

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: The setDamage command
« Reply #6 on: 17 Apr 2009, 00:36:47 »
Ahh, forgot about canStand... bullet 'hack' is interesting, did cross my mind, but I couldn't think of a way in which to make it 'reliable'.  Would definitely be nice to injure specific body parts - but that doesn't look like it's even going to happen in ArmA II at this rate.

Offline Joiner

  • Members
  • *
Re: The setDamage command
« Reply #7 on: 17 Apr 2009, 14:00:26 »
Thanks a lot for your replies!
In OFP, I used to set a damage value like 0.95 and the soldier coudn't run. It looks like this doesn't work in Arma. Any idea why he dies if I set a value greater than 0.9 (0.95 or even 0.91)? Has anyone come across this behavior?