First question, can you even script? Just askin' Anyway, now to the meat:
I have no idea how animations are controlled, but the other two are controlled by states, wait for me while I get an Example:
// Initial start up state
stateName[0] = "Activate"; <<<<<This is the state when you switch to the weapon
stateTransitionOnTriggerDown[0] = "Fire"; <<<<<< Note that when the "trigger" in most cases this
stateSound[0] = weaponSwitchSound; is a mouse is down, it switches to the fire state
stateName[1] = "Ready";
stateEmitter[1] = G36CsmokeEmitter;
stateEmitterTime[1] = 1;
stateEmitterNode[1] = "muzzleNode"; <<<< So when you start shooting, it completely
stateTransitionOnTriggerDown[1] = "Fire" skips over this state and goes to...
stateAllowImageChange[1] = true;
stateSequence[1] = "Ready";
stateName[2] = "Fire"; << this one, this is the fire state
stateTransitionOnTimeout[2] = "Smoke";
stateTimeoutValue[2] = 0.04;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = G36CflashEmitter; <<<< This is how you make an emitter, a state
stateEmitterTime[2] = 0.04; Emitter, in this case, the "muzzleNode" emits the G36C flash
stateEmitterNode[2] = "muzzleNode"; emitter while this state is commencing, in short, an
stateSound[2] = G36CshotSound; emitter when the weapon is firing
stateEjectShell[2] = true;
stateName[3] = "Smoke"; <<<< This is the next state, it does not emit smoke though
stateTimeoutValue[3] = 0.04;
stateTransitionOnTimeout[3] = "Reload";
stateName[4] = "Reload"; <<< Then it switches to this state
stateSequence[4] = "Reload";
stateTransitionOnTriggerUp[4] = "Ready"; << Now this is where when you stop firing, it switches
stateTransitionOnTriggerDown[4] = "Fire"; to the state "ready" where if you look, is where the
stateSequence[4] = "Ready"; state emitter is the smoke emitter, so in short, you can
control when your weapon emits stuff through states and state emitters. And that's why it skipped the "ready" state at first.
};
Since it's the only gun that I can remember off hand that has an effect while your shooting it, and when you stop shooting it, I am going to use the G36C by Amade. I will comment in the code above. (Im working on it)