Author Topic: fire rate  (Read 1026 times)

how do you change the fire rat since i making super gun


Change the state timeout in the "reload" state.

You may need to edit other parts of the state system, too, since the gun's reload state controls how fast you can fire it when clicking very fast, not like a machine gun where you hold the button.

Basically, look at the state systems.

Using Weapon_Gun.cs as an example, you can play with the line in bold in order to mess with the reload rate, at least.

My advice is to look at different Weapon scripts, check out how their states work, and get ideas based off of them.

Quote
   // 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";

Yeah.  I'm not quite sure why newbies haven't caught on yet.  How does one learn?  By mimicking the actions of others.  So, if you want to make a mod for Blockland, look at the code of similar Blockland mods.

@ Dilt:

Nice Batman Beyond avatar btw.

Off-topic @ Trader:
 :cookie: for knowing where it's from. :D

Edit: Agreed with the next post. But you have to admit, Old Bruce Wayne was awesome.
« Last Edit: November 09, 2007, 12:37:26 PM by Dilt »

[/topic] Yeah, it was a good show, but not as good as Batman: The Animated Series. [topic]
« Last Edit: November 09, 2007, 12:29:11 PM by Trader »

Yeah.  I'm not quite sure why newbies haven't caught on yet.  How does one learn?  By mimicking the actions of others.  So, if you want to make a mod for Blockland, look at the code of similar Blockland mods.

This is how I learned everything, I still don't get the C++ elements and all that programming stuff though.

Ok, thanks Dilt.



topic LOCKED