OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: FltSgt on 27 Aug 2002, 14:15:18

Title: Injured
Post by: FltSgt on 27 Aug 2002, 14:15:18
Can somebody make a script that make soldiers more injured when they are hit? So that either they can't run, move at all, shoot or they just lie on the ground twitching.
Title: Re:Injured
Post by: Gastovski on 27 Aug 2002, 22:03:04
You could do it with an addon, but I don't know if you can stop AI moving... You could switchmove to "lyingtomedic" (or something) so they perform a action. I will come back and write a script after dinner...
Title: Re:Injured
Post by: Gastovski on 27 Aug 2002, 22:43:30
OK here goes...

Code: [Select]
_soldier = ap1
#loop
_soldier switchmove "normal"
_dammage = getdammage _soldier
?_dammage = 0.7:goto "nomove"
~0.01
goto "loop"

#nomove
_soldier switchmove "whatevertheanimationis"
_soldier stop true

#loop2
_dammage = getdammage ap1
?_dammage = 0:goto "loop"
~0.01
goto "loop2"

Should work... I can't test it though...
Title: Re:Injured
Post by: Marsuitor on 28 Aug 2002, 01:58:04
I couldn't get it to work. I changed "whateveranimation" to "lyingtomedic" and added the script to a soldiers init line.

Got an error message saying this,
'_damage |#|=0.7':Error unknown operator
(The "|" could be a "[")

The scripted soldier just stood there and didn't fall when i shot him. It still counted as a kill, though.
Could it be "lyingtomedic" that's spelled wrong? ???
Title: Re:Injured
Post by: Black_Feather on 28 Aug 2002, 08:27:00
try this

_soldier = ap1
#loop
_soldier switchmove "normal"
_dammage = getdammage _soldier
?_dammage == 0.7:goto "nomove"
~0.01
goto "loop"

#nomove
_soldier switchmove "whatevertheanimationis"
_soldier stop true

#loop2
_dammage = getdammage ap1
?_dammage == 0:goto "loop"
~0.01
goto "loop2"
Title: Re:Injured
Post by: FltSgt on 28 Aug 2002, 21:23:03
Thanks for that lads.
Title: Re:Injured
Post by: Gastovski on 29 Aug 2002, 02:10:19
oops forgot the two equals... ==

cheers black_feather...