Author Topic: I don't get Kaje's minigun animation...  (Read 587 times)

 I've looked at his script to try and understand why his mini-gun's spin animation works outside the stage that the sequence is defined. I'm not seeing how it works...

Code: [Select]
stateName[0]                    = "Activate";
stateTimeoutValue[0]                = 0.15;
stateTransitionOnTimeout[0]     = "Ready";
stateSound[0]            = weaponSwitchSound;

stateName[1]                              = "Ready";
stateTransitionOnTriggerDown[1] = "Spinup";
stateAllowImageChange[1]        = true;
stateSequence[1]     = "ready";

stateName[2]                             = "Spinup";
stateAllowImageChange[2]        = false;
stateTransitionOnTimeout[2]     = "Fire";
stateTimeoutValue[2]                   = 1.00;
stateWaitForTimeout[2]            = true;
//stateSound[2]      = minigunShot1Sound;
stateSequence[2]      = "Spin";
stateTransitionOnTriggerUp[2]   = "Ready";
//stateSequenceOnTimeout[2]     = "Spin";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "Smoke";
stateTimeoutValue[3]            = 0.01;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
//stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateWaitForTimeout[3] = true;
stateEmitter[3] = gunFlashEmitter;
stateEmitterTime[3] = 0.01;
stateEmitterNode[3] = "muzzleNode";
stateSound[3] = gunShot1Sound;
stateEjectShell[3]        = true;

stateName[4] = "Smoke";
stateEmitter[4] = minigunSmokeEmitter;
stateEmitterTime[4] = 0.05;
stateEmitterNode[4] = "muzzleNode";
stateTimeoutValue[4]            = 0.01;
stateTransitionOnTimeout[4]     = "Check";

stateName[5] = "Check";
stateTransitionOnTriggerUp[5]   = "Slow";
stateTransitionOnTriggerDown[5] = "Fire";

stateName[6] = "Slow";
stateTransitionOnTriggerDown[6] = "Fire";
//stateSequence[6]                = "ready";
stateEmitter[6] = minigunSmokeEmitter;
stateEmitterTime[6] = 1.00;
stateEmitterNode[6] = "muzzleNode";
stateAllowImageChange[6]        = false;
stateTransitionOnTimeout[6]     = "Ready";
stateTimeoutValue[6]            = 1.00;
stateWaitForTimeout[6] = true;

Can anyone figure out how it works?


The weapon has a built-in animation called "Spin"

This triggers it:
stateSequence[2]              = "Spin";

The weapon has a built-in animation called "Spin"

This triggers it:
stateSequence[2]              = "Spin";
Not what he's asking.

The reason that the spin sequence starts outside of the firing state is because the animation would look really goofy and glitchy if it restarted every shot. Instead, in spinUp, it starts the cyclic animation once, and then it keeps going until the weapon's trigger is released.

OH. So, basically, I would have to export my animation as a "cyclic" animation, then any time the sequence is called, the animation will constantly repeat, while using the same delay of its parent stage, until another animation is called?