Sign in to follow this  
Followers 0

DEHACKED weapon - multiple firing codepointers in 1 tic

Experimenting with DEHACKED. Particularly it's advanced Boom variant, BEX. I wanted to make a multiple-pellet shooting weapon. Like a pistol which fires, for example, three bullets at once (and yes, substracts 3 clip ammo for it). The code wasn't hard to put together, I just set FireCGun codepointers to the frames in pistol firing sequence (frames 14,15,16) and set the frame durations to 0.

Works perfectly in ZDoom based ports. But aiming for Boom compatibility, it isn't enough. Unfortunately, other ports seems to crash after the gun fires.

After some investigation, I realized the cause is most probably the weapon flash sequence. I removed it (set the pistol's muzzle-flash state to 0, like the fist has). Experienced only a little improvement. Now it worked in Edge and ZDaemon. Original Boom and MBF still crashes, as well as Odamex. PrBoom-plus, after the weapon was fired, displayed Cyberdemon's death sprite at the top left corner of the screen, and the sprite stayed there and even kept bobbing with the weapon, until I managed to switch to another weapon with muzzle-flash animation, which has overriden it.

I've tried other ways, such as various modifications of the flash state, adding frames with NULL or Light0 or other codepointers between the firing frames. Without success. Apparently the only way of solution I can think of is to change the frame durations to 1. But then the weapon is not behaving as I would like.

Is there any way how to achieve a weapon that fires multiple (even more than 3) times during a single tic, and compatible with Boom? I totally don't care how many frames from other things/weapons/monsters I would have to replace, only to make this one weapon working.

Share this post


Link to post

Use the FirePistol instead, it's the same as FireCGun, but without the weirdness in the flash state.

Share this post


Link to post

Okay, based on what you've advised, I changed the codepointers to FirePistol and "inserted" (by replacing other frames) frames with CheckReload action between them to prevent the ammo going below zero. It was the greatest success I've had. Now it seems to work with every port except original DOS Boom (which doesn't properly check for ammo and it goes below zero) and MBF (which still crashes). But considering that nearly nobody uses these ports nowadays, I guess I can claim it Boom compatible, can't I?

I'd still look (and ask) for an actual Boom compatible solution, but if there apparently won't be any, I'd be satisfied with what I have now. Thanks a lot, Jimi!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0