DiR Posted October 30, 2017 If so, can you please tell me how to implement it, I'm having a hard time figuring it out. What I mean is, can you set the fire rate of a gun faster than 1 tic per frame? I'm trying to get a rapid-fire system in place. Code: Fire: SPIN A 1 A_Firebullets(random(1, 5), random(1, 5), 2, 5) SPIN BCD 1 A_Refire Is this the absolute fastest that I can make the weapon fire and animate at? or is there a workaround to allow higher speeds? 0 Quote Share this post Link to post
0 Arctangent Posted October 30, 2017 Yes. You can fake it, though, kind of, by utilizing "half-tics" which aren't actually half-tics but that's the best term for it. Here's a tutorial on it. 1 Quote Share this post Link to post
0 snapshot Posted October 30, 2017 I haven't heard of an engine that allows for faster than 1 tic between action executions, You can put 0 instead of 1 but those will fire at the same time as the one that precedes them, so yeah that's the fastest setup possible (unless you remove a frame or two...) 0 Quote Share this post Link to post
0 scifista42 Posted October 30, 2017 One tic is the smallest time unit. You can at best reduce the number of frames, as lesser total duration of the animation leads to faster rate if the animation loops. 0 Quote Share this post Link to post
0 Bauul Posted October 30, 2017 (edited) You can have 0 length frames that let the weapon fire twice (or more) in the same tic. At 35fps it's actually very hard to tell each frame is doubled up, it just gives the sense you're firing faster. It also looks like you have four frames of animation (SPIN A, B, C and D). So at most you'll only be firing once every 4 tics. Try reducing that to just two frames (perhaps SPIN A and C) and you'll double your current fire speed. Or add A_Firebullets to more than just the first frame. If you add it to all your frames, you'll fire at four times your current speed. Edited October 30, 2017 by Bauul 0 Quote Share this post Link to post
0 Bauul Posted October 30, 2017 (edited) Try this: Fire: SPIN A 1 A_Firebullets(random(1, 5), random(1, 5), 2, 5) SPIN B 1 A_Firebullets(random(1, 5), random(1, 5), 2, 5) SPIN C 1 A_Firebullets(random(1, 5), random(1, 5), 2, 5) SPIN D { 1 A_Firebullets(random(1, 5), random(1, 5), 2, 5); A_Refire; } SPIN This will fire your gun every tic (instead of every 4th tic as you had). Edit: Oops, sorry for double post. I meant to edit my reply above. Edit 2: Double oops: there's a rogue SPIN at the end you'll need to removed. I can't as I'm on mobile. Edited October 30, 2017 by Bauul 0 Quote Share this post Link to post
0 DiR Posted October 30, 2017 Thanks! Originally, i was considering cutting frames out of the process to "simulate" faster firing, but this looks better. 0 Quote Share this post Link to post
Question
DiR
If so, can you please tell me how to implement it, I'm having a hard time figuring it out.
What I mean is, can you set the fire rate of a gun faster than 1 tic per frame? I'm trying to get a rapid-fire system in place.
Code:
Fire:
SPIN A 1 A_Firebullets(random(1, 5), random(1, 5), 2, 5)
SPIN BCD 1 A_Refire
Is this the absolute fastest that I can make the weapon fire and animate at? or is there a workaround to allow higher speeds?
Share this post
Link to post
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.