Author Topic: How does a weapon decide to shoot apon held mouse?  (Read 937 times)

basicly i need to know what makes a weapon fully automatic, it seems to be this part
   stateWaitForTimeout[5]      = true;
   //stateSequence[5]                = "Reload";    <<<<< on reload
   stateScript[5]                  = "onStopFire";
this is the bow script, onreload was cut out which i assume is the cause, but in the rocketlauncher
   stateSequence[5]                = "TrigDown";


   stateName[4]         = "Reload";
   stateTransitionOnTriggerUp[4]     = "Ready";
   stateSequence[4]   = "TrigDown";

   stateName[6]   = "NoAmmo";     <<<< theres all of this ammo stuff
   stateTransitionOnAmmo[6] = "Ready";
so which does it? help pls

On the same state, after fire/smoke/ammocheck/whatever
stateTransitionOnTriggerDown => fire again
stateTransitionOnTimeout => delay

stateSequence is for animations on a weapon.

what you need is
  • stateTransitionOnTriggerDown[#] = "";
- the transition of the current state to the specified state
  • stateTimeoutValue[#] = #;
- the time (in seconds) until the state change is triggered. (I.E 0.5 is half a second)
  • stateWaitForTimeout[#] = bool;
- boolean; force the state to wait for the transition time no matter how the state transitions

On the same state, after fire/smoke/ammocheck/whatever
stateTransitionOnTriggerDown => fire again
stateTransitionOnTimeout => delay
So I should remove stateTransitionOnTriggerDown?
stateSequence is for animations on a weapon.

what you need is
  • stateTransitionOnTriggerDown[#] = "";
- the transition of the current state to the specified state
  • stateTimeoutValue[#] = #;
- the time (in seconds) until the state change is triggered. (I.E 0.5 is half a second)
  • stateWaitForTimeout[#] = bool;
- boolean; force the state to wait for the transition time no matter how the state transitions
.. that didn't help at all :(

So I should remove stateTransitionOnTriggerDown?.. that didn't help at all :(

Here, this is the state system for a basic full auto weapon

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

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

stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
stateTimeoutValue[2] = 0.120;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = YOUR_DATABLOCK_FlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] =YOUR_DATABLOCK_FireSound;
stateEjectShell[2] = true;

stateName[3] = "Smoke";
stateEmitter[3] = YOUR_DATABLOCK_Emitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3] = 0.01;
stateTransitionOnTriggerDown[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Reload";
stateWaitForTimeout[3] = true;

stateName[4] = "Reload";
stateTimeoutValue[4] = 0.15;
stateTransitionOnTimeout[4] = "Ready";
stateWaitForTimeout[4] = true;


If you want to change the delay between shots, change the value stateTimeoutValue[3] in state 3.