Search In
• More options...
Find results that contain...
Find results in...
• 0

# Trouble getting weapon to fire faster

## Question

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?

## Recommended Posts

• 0

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.

• 0

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

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

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.

• 0

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```

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.

• 0

Thanks! Originally, i was considering cutting frames out of the process to "simulate" faster firing, but this looks better.