Urban Wars
April 19, 2018, 10:35:21 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome, here you will find all the information on Urban Wars
 
  Home Help Search Staff List Login Register  

weapon firing pause?

Pages: [1]
  Print  
Author Topic: weapon firing pause?  (Read 48 times)
Mexicouger
Lieutenant
*
Posts: 111


View Profile
« on: April 30, 2010, 08:21:22 am »

I just coded another weapon in and Now I need to get it`s characteristics down.
I got everything handled except for weapon firing. There is a function that has all the weapons firing handled in it. Its rate of fire anyway. And I wanna get my battle rifle to shoot 3 shots within 0.05 seconds. Ive got that down. But then I want it to pause for about 2 seconds and then get firing again. This is probably simple. I tried using a next think function, but it did not work right. So I`m shooting in the dark on this one. Any help?
« Last Edit: May 04, 2010, 09:51:12 am by Mexicouger » Report Spam   Logged

Social Buttons

DukeInstinct
Administrator
Lieutenant
*****
Posts: 120


The ArchDuke


View Profile WWW
« Reply #1 on: April 30, 2010, 10:59:01 am »

I just recently added a burst fire mode to Urban War's M4 carbine.

You need to recycle one of the field floats from your player entity that isn't being used. In your firing function check if that float is less than 1. If it is then set it to 3. If it is already more than 1 then decrease it by 1. If it is now equal to 0 after you decrease by 1 then set self.attack_finished to time+2.
« Last Edit: April 30, 2010, 11:07:43 am by DukeInstinct » Report Spam   Logged



Urban Wars Coder/3d Modeler/Animator

Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #2 on: April 30, 2010, 12:43:05 pm »

I`m completely confused as to what you said. You know that I want  abattle rifle effect right? So it stops firing for 2 seconds and then continues. Theres a switch statement code for weapon firing rates. Is there like  a think statement I can attacth onto it? And if not, Can you tell me exactly where to go, kinda like  atutorial I can follow? Can you just make it in tutorial form? This would help for later codes.
Report Spam   Logged
Pages: [1]
  Print  
 
Jump to:  


Get your own Chat Box! Go Large!
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum | Buy traffic for your forum/website

Powered by SMF | SMF © 2016, Simple Machines