Author Topic: Revert back to the Original Emitter  (Read 872 times)

I'm making a weapon that has two emitters, one that is neutral, one that indicates the weapon is charged. I can't seem to get the weapon to go back to the neutral emitter after a charged shot is fired.
Quote
   stateName[0]                     = "Activate";
   stateTimeoutValue[0]             = 0.8;
   stateTransitionOnTimeout[0]       = "Ready";
   stateSound[0]               = pixelequip3Sound;
   stateEmitter[0]               = rangedEmitter;
   stateEmitterTime[0]            = 600;

   stateName[1]                     = "Ready";
   stateTransitionOnTriggerDown[1]  = "Charge";
   stateAllowImageChange[1]         = true;
   stateSequence[1]   = "Ready";
   stateEmitter[1]      = rangedEmitter;
   stateEmitterTime[1]   = 600;
   
   stateName[2]         = "Charge";
   statetransitionOnTimeOut[2]   = "ChargeFull";
   stateTransitiononTriggerup[2]   = "Fire";
   stateWaitForTimeout[2]      = false;
   stateAllowImageChange[1]        = true;
   stateTimeoutValue[2]      = 2;
   stateScript[2]              = "OnCharge";
   
   stateName[3]                    = "Fire";
   stateTransitionOnTimeout[3]     = "Reload";
   stateTimeoutValue[3]            = 0.74;
   stateFire[3]                    = true;
   stateAllowImageChange[3]        = false;
   stateSequence[3]                = "Fire";
   stateScript[3]                  = "onFire";
   stateWaitForTimeout[3]         = true;
   stateSound[3]               = pixelfire1Sound;

   stateName[4]               = "ChargeFull";
   stateAllowImageChange[4]        = true;
   stateTransitiononTriggerup[4]   = "ChargeFire";
   stateEmitter[4]               = ranged2emitter;
   stateEmitterTime[4]            = 600;

   stateName[5]                    = "ChargeFire";
   stateTransitionOnTimeout[5]     = "Reload";
   stateTimeoutValue[5]            = 1;
   stateFire[5]                    = true;
   stateAllowImageChange[5]        = false;
   stateSequence[5]                = "Fire";
   stateScript[5]                  = "onChargeFire";
   stateWaitForTimeout[5]         = true;
   stateSound[5]               = chargefireSound;
   stateEmitter[5]          = rangedEmitter;
   stateEmitterTime[5]         = 600;

   stateName[6]         = "Reload";
   stateSequence[6]                = "Reload";
   stateTimeoutValue[6]            = 0.12;
   stateTransitionOntimeout[6]   = "Ready";
   stateSequence[6]           = "Ready";
   stateEmitter[6]          = rangedEmitter;
   stateEmitterTime[6]         = 600;
};

what is the name of the charged emitter and the idle emitter?

what is the name of the charged emitter and the idle emitter?
ranged2emitter is the charged while rangedemitter is the idle. Sorry, should have clarified that.

Try adding a few pauses in between the emitters (empty timeout states). The state system tends to break a lot of things if you just quickly transition without any kind of buffer.