Author Topic: Weapon playing weapon switch sound after timeout value  (Read 286 times)

Code: [Select]
   // Initial start up state
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 0.07;
stateTransitionOnTimeout[0]       = "Ready";
stateSound[0] = RailgunSwapSound;

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

stateName[2]                    = "Fire";
stateTimeoutValue[2]            = 1.5;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = RailgunFlashEmitter;
stateEmitterTime[2] = 0.01;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = RailgunShotSound;

stateName[3] = "Check";
stateTransitionOnTriggerUp[3]   = "Ready";
stateTransitionOnTriggerDown[3] = "Fire";

I dunno whats going on here but I after the gun fires, it plays the weapon swap sound. I want it to play the sound whenever I switch to the gun, but not after it fires. I'm not very good at scripting, so this is probably an easy fix for most of you ._.

You have a state timeout value (stateTimeoutValue) but you aren't defining what state to change to with stateTransitionOnTimeout, so it goes to the first state (Activate).

You have a state timeout value (stateTimeoutValue) but you aren't defining what state to change to with stateTransitionOnTimeout, so it goes to the first state (Activate).

Where is this? In the second state?

Fixed it. Thanks a bunch. :3
« Last Edit: June 02, 2012, 05:38:37 PM by ShadowsfeaR »