Jump to content
Sign in to follow this  
froggyluv

Halting an Animation

Recommended Posts

I've got a scene where a character is playing out a speaking animation but when he gets shot, continues the animation all the way thru before dying.

As you can see I don't yet know much about the scripting language :D

 mike playmove "ActsPercMstpSnonWnonDnon_talking01a";
_damage= getdammage mike;
while {_damage > 0.8} do exit;

Share this post


Link to post
Share on other sites

Instead of 'do exit' (which will do nothing in an SQF file by the way), use this to stop his current animation:

mike switchMove "";

Share this post


Link to post
Share on other sites

mike playmove "ActsPercMstpSnonWnonDnon_talking01a";
_damage= getdammage mike;
while {_damage > 0.8} mike switchMove "";

He still continues his animation with this. I also tried

if {_damage > 0.8} then mike switchMove "";

but still no luck.

Share this post


Link to post
Share on other sites

One way you can do it is put this in Mike's init field:

this addEventHandler ["killed",{mike switchmove "";}]

Share this post


Link to post
Share on other sites

Beautiful! You know trying so many things that fail and then to be given the answer really helps me to retain this stuff. I mean, it really pays to first try and find the answers, experimenting with different functions because it just seems to make more sense when somebody gives you an answer.

Ahh, I didn't make any sense

Thanks mate!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×