Author Topic: Image States  (Read 660 times)

Can someone explain to me how to state names work. The states you see at the end of a a weapon code. I need to figure out how those work.
« Last Edit: May 29, 2009, 07:25:40 PM by Plornt »


Image states are what you're gun does when you do stuff with it, like take it out. The default image state that you should have (or you suck) is when you first take it out (0):
Code: [Select]
   statename[0]                     = "Activate";
   stateTimeoutValue[0]             = 0.15;
   stateTransitionOnTimeout         = "Startup";
   stateSound[0]                    = weaponSwitchSound;
   
   stateName[1]                     = "Ready";
   stateTransitionOnTriggerDown[1]  = "Fire";
   stateAllowImageChange[1]         = false;
   stateTimeoutValue[1]             = 0.01;
   
   stateName[2]                     = "Fire";
   stateTransitionOnTimeout[2]      = "Pause";
   stateTimeoutValue[2]             = 0.5;
   stateFire[2]                     = true;
   stateScript[2]                   = "onFire";
   stateWaitForTimeout[2]           = true;
   stateEmitter[2]                  = gunFlashEmitter;
   stateEmitterNode[2]              = "muzzleNode";
   stateSound[2]                    = HuntingShot;
   
   statename[3]                     = "Reload";
   stateTimeoutValue[3]             = 0.2;
   stateSequence[3]                 = "Reload";
   stateTransitionOnTimeout[3]      = "EjectShell1";
   stateWaitForTimeout[3]           = true;
   stateSound[3]                    = HuntingReload;
   
   stateName[4]                     = "Stop";
   stateTimeoutValue[4]             = 0.4;
   stateTransitionOnTimeout[4]      = "Ready";
   
   stateName[5]                     = "Pause";
   stateTimeoutValue[5]             = 0.7;
   stateTransitionOnTimeout[5]      = "Reload";
   
   stateName[6]                     = "Startup";
   stateTimeoutValue[6]             = 0.2;
   stateSequence[6]                 = "Reload";
   stateTransitionOnTimeout[6]      = "EjectShell";
   stateWaitForTimeOut[6]           = true;
   stateSound[6]                    = HuntingReload;
   
   stateName[7]                     = "EjectShell";
   stateTimeoutValue[7]             = 0.5;
   stateTransitionOnTimeout[7]      = "StartupPause";
   stateWaitForTimeout[7]           = true;
   stateEjectShell[7]               = true;
   
   stateName[8]                     = "EjectShell1";
   stateTimeoutValue[8]             = 0.5;
   stateTransitionOnTimeout[8]      = "Stop";
   stateWaitForTimeout[8]           = true;
   stateEjectShell[8]               = true;
   
   stateName[9]                     = "StartupPause";
   stateTimeoutValue[9]             = 0.7;
   stateTransitionOnTimeout[9]      = "Ready";
State 0 is when you first take it out, the sound is that *swoosh* sound you hear when you take all weapons out. I have many states for my hunting rifle right now (I'm going to cut down because it might be laggy) These are pretty much self explanatory.

I know that but im wondering if have to name the animation something a certian name to work with those states.

No, you don't need to name it something specific, name it whatever and then in the Image state you want the animation to play put:
Code: [Select]
stateSequence[#] = "Animationname";

No, you don't need to name it something specific, name it whatever and then in the Image state you want the animation to play put:
Code: [Select]
stateSequence[#] = "Animationname";

Ty now to the end with my stuffty non animated weapons.