Mexicouger
Lieutenant
Posts: 111
|
|
« 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
|
|
|
|
|
DukeInstinct
|
|
« 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
|
|
« 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.
|
|
|
|
|
|