OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Joiner 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!
-
I'd use setUnitPos (http://community.bistudio.com/wiki/setUnitPos) to keep him prone.
-
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.
-
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 (http://www.ofpec.com/COMREF/index.php?action=details&id=162) - but I'm not sure how you'd go about damaging a specific area...
-
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.
-
Here (http://www.ofpec.com/forum/index.php?topic=32708.msg225139#msg225139) 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 ;)
-
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.
-
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?