Author Topic: Fire Rate of A Weapon  (Read 1111 times)

Okay, I have done this before, I am not a coder but I screwed up my fire rate and bullet speed and don't remember how to change it back.
Please just help or don't say anything, I am no good with scripting.

Which weapon did you mess up?

I am making new ones. I have a pistol that is more of a sub-machine gun by accident.

I am making new ones. I have a pistol that is more of a sub-machine gun by accident.

Ah ok, here's the original gun Image States code (what makes it fires and whatnot, found at the very bottom)

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

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

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Smoke";
stateTimeoutValue[2]            = 0.14;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = gunFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = gunShot1Sound;
stateEjectShell[2]       = true;

stateName[3] = "Smoke";
stateEmitter[3] = gunSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

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

};

Just replace the current stuff with that, starting from the //initial start up state  to the  };  at the bottom. Also leave the "function gunimage" thing under it alone.
« Last Edit: December 02, 2007, 10:29:42 PM by Muffinmix »

Thanks, I'll try it again. I didn't copy-paste before I changed the numbers back but I probably missed something.

Nothing to do with fire-rate but I need help again. A weapon I have made creates the spearhit noise instead of what I have directed it to, what have I done wrong?

At the bottom of the particle/Emitter datablocks, there's an Explosion datablock with a line called soundProfile, i.e.:

Code: [Select]
datablock ExplosionData(someExplosion)
{
   //explosionShape = "";
   lifeTimeMS = 150;

   soundProfile = spearExplosionSound;    //this line right here

...
};

You want to change that to the desired weapon AudioProfile name. SpearExplosionSound is the spear one when the spear explodes and it's tied to the an audioprofile datablock (which can found in the Spear script and possibly at the beginning of your weapon script if you accidentally transferred it).