How to get a certain recoil effect

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

How to get a certain recoil effect

Postby CPLJigsore » Mon Feb 22, 2021 2:03 pm

In Marathon the assault rifle has a recoil effect I'd like to emulate in Doom. The video quality sucks so I'll explain what you're looking at: https://youtu.be/XJ8E6muH6_4

The assault rifle fires at a rate of about 2 tics, and every couple of rounds the rifle sprite's offset is lowered, and then fires a couple of rounds before the offset goes back to the original offset. This gives the weapon a neat "uncontrollable recoil" effect. Using Weasel's half tic trick I figured out that if I make ASRF BA (the rifle's standard and muzzle flash sprites) 4 tics and then in the FireHalfTic state I make ASRF BA 3 tics and set the offset to (0,28) it will give me this visual effect but makes the rifle fire waaaay too slow, at about 3.5 tics if I remember correctly.

So my question is can anyone think of a trick to both give this desired effect but also make the fire rate higher?

Sorry if any of this is difficult to follow. I'd have pasted my decorate code but I'm not at my computer at the moment.
CPLJigsore
 
Joined: 26 Dec 2020
Operating System: Windows 10/8.1/8/201x 64-bit

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest