Home   Help Search Login Register  

Author Topic: Problem with object animation  (Read 1271 times)

0 Members and 1 Guest are viewing this topic.

klavan

  • Guest
Problem with object animation
« on: 26 May 2006, 11:31:55 »
Take  a look at this:
Code: [Select]
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";
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";
statement="this animate [""ani_VascaMixer"", (this animationphase ""ani_VascaMixer"")]";
};
};

With the config above the mixer starts it's rotation in a regular way and the "Stop Mixer" action is displayed properly. The problem appears when the time to stop the rotation comes: by selecting the action the rotation stops immediately, but the "Stop mixer" action won't disappear and the "Start mixer" action remains hidden.
The scripts attached to the config starts a sound effect.
Any help?
Thanks in advance.
Klavan
« Last Edit: 26 May 2006, 16:43:50 by klavan »

Offline Pilot

  • Contributing Member
  • **
Re: Problem with object animation
« Reply #1 on: 26 May 2006, 15:54:48 »
That is because the condition for the start action requires the animation phase to be less than or equal to 0.  If you stop the action when it's at .5, the start condition is not met, and you will not get the action.

I'm not exactly sure how to accomplish what you want, but I'll try to think of something.

-Pilot