OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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.
-
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...
-
OK here goes...
_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...
-
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? ???
-
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"
-
Thanks for that lads.
-
oops forgot the two equals... ==
cheers black_feather...