OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: funkster on 08 Sep 2005, 01:10:45
-
Hi,
I have a soldier that has just performed "switchMove FXexecution"
He does this, and is then shot. but because of the animation, he stays in his position.
SO, in order that he performes the daeth animation when shot, I have created a script in his initialization field called "deathloop" which constantly runs, here it is:
;this loop will check when East Man has been shot, and activate the death animation:
#checkloop
if ((getDammage EMtwo) == 1) then goto "death"
~ 0.01
goto "checkloop"
#death
EMtwo switchMove FXexecutionDead
EXIT
There is no error message, but at the same time, you can shoot the hell out of him if you want. but he'll be dammed if he wants to die!
Any ideas what is going wrong?
Thanks ;)
-
I suggest you drop the loop and give him a {killed} event handler instead to make him do the switch move. Some thing like:
EMtwo AddEventHandler [{killed},{EMtwo switchMove "FXexecutionDead"}]
Then as soon as he is killed he will do the move.
By the way I believe the problem with the script is this line:
EMtwo switchMove FXexecutionDead
It should be
EMtwo switchMove "FXexecutionDead"
-
Psssst! Click me => http://www.ofpec.com/yabbse/index.php?board=9;action=display;threadid=24698;start=0
or
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=23916;start=0
:P