OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: funkster on 11 Sep 2005, 04:10:17

Title: Please try this!
Post by: funkster on 11 Sep 2005, 04:10:17
Hi all,
I have a slight prob, hard to explain, please do me a favour, and try making a little script like so:

Create a unit (mine is called EMtwo in this script), and start close to it. In the init field of the unit call a script that has the following:

Code: [Select]

EMtwo SwitchMove "FXStandSurDown"
~ 3

EMtwo SwitchMove "FXexecution"

~ 3

EMtwo  AddEventHandler [{killed},{EMtwo switchMove "FXexecutionDead"}]

EXIT



Now, kill him (you should be right next to him)

And watch him die. This is a problem, any idea why this happens, or what I can do to stop[ it?

Thanks :)
Title: Re:Please try this!
Post by: Kyle Sarnik on 11 Sep 2005, 04:51:54
Im sorry, but whats the problem? He is dead? Well yea you shot him, but seriously whats wrong with it?
Title: Re:Please try this!
Post by: funkster on 11 Sep 2005, 09:31:50
ok, so it didnt happen for you? I wondered if it was just something im doing.

When i do it, he dies (from kneeling). Then about two seconds later, he dies again, this time miraculously from standing up! I cant figure out why, and its really messing things up for me quite a bit...

Title: Re:Please try this!
Post by: Kyle Sarnik on 11 Sep 2005, 18:34:31
I yes I've seen that before. I believe its because when the FX death anim is played, it finishes and then the unit dies normally. I wouldn't suggest using an eventhandler for that, try a simple loop checking if hes dead and if so play the animation once and exit.
Title: Re:Please try this!
Post by: Blanco on 12 Sep 2005, 00:01:00
http://www.ofpec.com/yabbse/index.php?board=9;action=display;threadid=24698;start=0
Title: Re:Please try this!
Post by: funkster on 12 Sep 2005, 00:23:30
Ok, thanks guys.

The thing is though, if you dont put in something to detect when he has been killed, he just kneels there. You can shoot the absolute hell out of him, but he still stands there - this suggests that whatever animation you call last, just stays until its told to.

So the question then is, why, when you do the death animation does it not do the same thing, and stay in the dead position?

Anyway, thanks Blanco, I think that link gives me what I need to know...