OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ProudPotter2490 on 24 Apr 2005, 21:49:25
-
Hey everyone!
I've made the following script for a fixed position:-
_unit = _this select 0
#loop
_unit setBehaviour "COMBAT"
_unit switchMove "CROUCH"
_unit setUnitPos "UP"
~0.5
goto "loop"
exit
Simple, eh? But if you'd care to test it, once the unit the script is applied to dies he just keeps falling.
To help avoid this pesky problem, I wanted to use a code that cuts the script once the unit dies. I've tried "not (alive_unit) : exit" in addition to "(getDammage _unit = 0.25)", but typically it wont work. Does anyone have a suggestion?
Thanks!
ProudPotter2490 :afro:
-
_unit = _this select 0
#loop
_unit setBehaviour "COMBAT"
_unit switchMove "CROUCH"
_unit setUnitPos "UP"
~0.5
? alive _unit : goto "loop"
exit
-
Hey Baddo!
Thanks for the tip but the unit doesn't fire on the enemy any more. Cheers anyway.
ProudPotter2490 :afro:
-
Hey!
My apoligies! It did work, it was just down to timing ;)! Thanks Baddo :D.
ProudPotter2490 :afro: