Author Topic: Gatling Gun Animation  (Read 1464 times)

I've been trying to make a Gatling Gun for Blockland recently. It's based on Kajes old Minigun Add-On but I can't seem to get the animation to work, it will either play once when you equip it and sometimes even on triggerup but it'll stand still during firing if the animation is non cyclic. If the animation is cyclic however it won't stop spinning once you equip it.

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;

};

As far as I can tell it should play the "ready" animation when you equip it, the "Spin" animation on trigger down and the "Fire" animation during firing. But if I leave the "ready" animation blank it'll still play the "Spin" animation whenever I equip it. Can someone tell me why?


i could be wrong, but some torque has some preset sequence name checks to have the animation play in uncontrollable circumstances, 'spin' being one of them. try renaming it to 'barrelSpin' or something.


edit: i had this same problem a long time ago
https://forum.blockland.us/index.php?topic=291375.0
« Last Edit: September 29, 2017, 11:57:25 AM by Trogtor »

Thank you, I'll give it a shot!
Makes me wonder why it works with Kaje's Minigun model.

you need a root animation to stop the spinning, and play it after you exit firing mode or enter the ready state

Thank you that could be it.
Do I need to make the root animation cyclic in order to stop a cyclic animation?

Thank you that could be it.
Do I need to make the root animation cyclic in order to stop a cyclic animation?
no

Works all fine now, thanks alot for being so supportive!