Jump to content
Sign in to follow this  
klavan

Stopping animation

Recommended Posts

Hi all, just wondering if there's a way to suddenly stop a rotating animation. Here's the config part:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Kla_Betoni:Kla_objConKit

{

scope=public;

mapSize=5;

destrType = DESTRUCTNO;

displayName="Cement mixer";

model="\KLA_ConKit\betoniera.p3d";

animated=1;

class Animations

{

class ani_VascaMixer

{

type="rotation";

animPeriod=100000;

multiplyer=20;

selection="vasca";

axis="rotate_axis";

angle0=0;

angle1="-20000 * 3.141592654";

};

};

class UserActions

{

class StartMixerRotation

{

displayName="Start mixer";

position="pos_start";

radius=2.000000;

//condition="this animationPhase ""ani_VascaMixer"" < 0.5";

condition="this animationPhase ""ani_VascaMixer"" <= 0";

statement="this animate [""ani_VascaMixer"", 1]; [this] exec ""\kla_conkit\scripts\mixer.sqs""";

};

class StopMixerRotation

{

displayName="Stop mixer";

position="pos_start";

radius=2.000000;

//condition="this animationPhase ""ani_VascaMixer"" < 0.5 or this animationPhase ""ani_VascaMixer"" >= 0.5";

condition="this animationPhase ""ani_VascaMixer"" > 0";

statement="this animate [""ani_VascaMixer"", 0]";

};

};

};

With the config above the mixer starts it's rotation, but when i decide to stop it, it reverse the rotation, turning back until it reachs it's statement, instead of stopping it.

Any help?

Thanks.

klavan

Share this post


Link to post
Share on other sites

If i remember correctly this should work, not sure.

To stop it in the exact place where it is:

Code Sample  

_object animate["animationname", (_object animationphase "animationname")]

To start it again:

Code Sample  

_object animate["animationname", 0]

_object animate["animationname", 1]

Share this post


Link to post
Share on other sites

It works, but the "stop mixer" action won't disappear and the "start mixer" action won't appear again. huh.gif

Klavan

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  

×