Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Z.Franz

Help with Dehacked

Recommended Posts

Hello everyone. I'll go straight to the point. I swapped the pistol states with the fist ones with Whacked, so that I could have an unlimited pistol on doom legacy...and now, every time I fire it, the max ammo counter for the shells lowers with each shot. It goes all the way down to negative numbers too... making it impossible to even pick up ammo for the shotgun at all...
Anyone knows what the hell is happening? I appreciate all help.
Thank you all in advance.

Share this post


Link to post

Don't know yet, as I don't recognize what you did. Can you post a line or five.
Did it do the same on PrBoom, or different behavior ?
My first thought is that fist states don't have ammo, so it likely puts those states in an untested usage.\

Negative ammo makes it impossible to pick up ammo ?
Is that just DoomLegacy or other ports too ?

Share this post


Link to post

Giving weapons ammo type = 5 (unlimited) seems to do the same thing in prboom+, but it doesn't happen in zdoom.

You could make the pistol start with lots of ammo and make bullet ammo give lots of it, but then the chaingun would have tons of ammo too.

Share this post


Link to post

Code pointers like A_FirePistol and A_FireShotgun always decrease the ammo of the current weapon.

If you use them on the fist, they decrease the wrong ammo counter (the maximum for shells, as you found out).

Maybe you can fix this by changing the 'Ammo Type' of the fist in the dehacked file.

Share this post


Link to post

First, thank you all for replying to my post. I appreciate that.
Well, to answer everything, the max ammo goes below 0...therefore you cannot have any ammo for the shotgun at all.
What I wanted to do was this, in few words:
Replace the fist with an unlimited pistol,
Replace the chainsaw with two unlimited pistols,
Replace the pistol with the shotgun and the shotgun with the SSG, so that I could have 2 machineguns, by using the SSG slot. It works and everything, apart from this strange behaviour.
It doesn't happen in Zdoom, but I designed it to be Doom Legacy compatible as its the only port that allows split-screen playing.
So, I'm stuck. I tried editing ammo types and stuff, but it keeps happening.
I'm clueless.

Share this post


Link to post

Could you please post the part of your DEHACKED patch that contains code for replaced fist, pistol, and shotgun? I don't know much about this so I probably won't be able to help you, but nobody would be if you didn't give us that part of code.

Share this post


Link to post

This is it:

Weapon 0 (Fist)
Deselect frame = 12
Select frame = 11
Bobbing frame = 10
Shooting frame = 13
Firing frame = 17

Weapon 1 (Pistol)
Ammo type = 1
Deselect frame = 20
Select frame = 19
Bobbing frame = 18
Shooting frame = 21
Firing frame = 30

Weapon 2 (Shotgun)
Deselect frame = 34
Select frame = 33
Bobbing frame = 32
Shooting frame = 35
Firing frame = 47

Weapon 8 (Super-Shotgun)
Ammo type = 0
Deselect frame = 4
Select frame = 3
Bobbing frame = 2
Shooting frame = 5
Firing frame = 0

I've basically shifted the weapons down, completely removing the fist (therefore the need for the pistol to have unlimited ammo)

Share this post


Link to post

As andrewj said, the firing codepointers always decrease something, at least as long as they are on a specific place. So your problem isn't so simple to solve. But apparently there's a way around, although more complicated.

This DEHACKED found in Slaughterfest2012 (I got it from the old texture file) contains a code for an infinite BFG. As I understand it, they had to move all the states to the place of SS Nazi states, and then it miraclously worked, at the cost of not being able to use Nazis on maps.

I assume you can take this code as a model example, and recreate it the same way for chainsaw sprites and sounds and behaviour and FirePistol codepointer instead of FireBFG. If you don't think you'd be able to do it, I'd help you. In any way you'll need to work with the States section too, not only the Weapons section.

# General version information
Doom version = 19
Patch format = 6

Frame 67
Sprite subnumber = 32768

Frame 726
Sprite number = 11
Sprite subnumber = 32768
Duration = 1
Next frame = 726

Frame 727
Sprite number = 11
Sprite subnumber = 32768
Duration = 1
Next frame = 727

Frame 728
Sprite number = 11
Sprite subnumber = 32768
Duration = 1
Next frame = 728

Frame 729
Sprite number = 11
Sprite subnumber = 32768
Duration = 20

Frame 730
Sprite number = 11
Sprite subnumber = 32769
Duration = 10

Frame 731
Sprite number = 11
Sprite subnumber = 32769
Duration = 10

Frame 732
Sprite number = 11
Sprite subnumber = 32769
Duration = 20
Next frame = 726

Frame 733
Sprite number = 15
Sprite subnumber = 32768
Duration = 11

Frame 734
Sprite number = 15
Sprite subnumber = 32769
Duration = 6
Next frame = 1

Frame 881
Sprite subnumber = 32768

[CODEPTR]
Frame 726 = WeaponReady
Frame 727 = Lower
Frame 728 = Raise
Frame 729 = BFGSound
Frame 730 = GunFlash
Frame 731 = FireBFG
Frame 732 = Refire
Frame 733 = Light1
Frame 734 = Light2

Weapon 7 (Chainsaw)
Deselect frame = 728
Select frame = 727
Bobbing frame = 726
Shooting frame = 729
Firing frame = 733

Share this post


Link to post

I wish it worked, but the pink bfg from SF has the same problem with removing shotgun ammo. It uses some nazi states because it replaces the chainsaw, but the chainsaw has less states than the bfg.

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
×