Decorate Question (Ammo)

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
SFJake
Posts: 531
Joined: Sat Nov 03, 2007 11:28 am

Decorate Question (Ammo)

Post by SFJake »

I need some help again, with some annoyances...

Is it possible to change the maximum amount of ammo you can carry of an original ammo type - Clip,Shell,Cell,RocketAmmo, without resorting to Dehacked? I need a decorate way of doing it.

With an actor like this:

ACTOR Clip2 : Clip replaces Clip

Even if you change Inventory.MaxAmount and Ammo.BackpackMaxAmount, the values are ignored. I just can't seem to change that.

I simply don't want to use Dehacked, especially because of Skulltag but even ZDoom, they can't handle multiple dehacked files in wads and it creates other problems I want to avoid.

So, is it possible?
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Decorate Question (Ammo)

Post by XutaWoo »

Nope.

Although I think there can be multiple DEHACKED files; they just can't change the same thing.
User avatar
SFJake
Posts: 531
Joined: Sat Nov 03, 2007 11:28 am

Re: Decorate Question (Ammo)

Post by SFJake »

Damn.

I tried, and it doesn't seem to work. If I, say, load a dehacked file that is not inside a wad, WITH another dehacked in a .wad, it'll work. If 2 wads have a dehacked, only the last (I think its the last) will load.

This wouldn't be a problem so much if Skulltag online handled loading .deh files. You must have them in .wads files and load the wad. *sigh*.

I just have no idea how to get around this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Decorate Question (Ammo)

Post by Graf Zahl »

It's either Dehacked or ACS's SetAmmoCapacity. Normally that's enough to make the change.
User avatar
SFJake
Posts: 531
Joined: Sat Nov 03, 2007 11:28 am

Re: Decorate Question (Ammo)

Post by SFJake »

Graf Zahl wrote:or ACS's SetAmmoCapacity. Normally that's enough to make the change.

I didn't know ACS could do that. Thanks!
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Decorate Question (Ammo)

Post by NeuralStunner »

Tested and successful in ZDoom r1806. 8-)

I simply redefined the Clip ammo type altogether, derived from Ammo like the original.

Code: Select all

Actor Clip : Ammo Replaces Clip
{
  Game Doom
  SpawnID 11
  Inventory.PickupMessage "$GOTCLIP"
  Inventory.Amount 10
  Inventory.MaxAmount 400 // Twice the usual
  Ammo.BackpackAmount 10
  Ammo.BackpackMaxAmount 800 // Twice the usual
  Inventory.Icon "CLIPA0"
  States
  {
  Spawn:
    CLIP A -1
    Stop
  }
}
User avatar
SFJake
Posts: 531
Joined: Sat Nov 03, 2007 11:28 am

Re: Decorate Question (Ammo)

Post by SFJake »

EDIT: Nevermind. It works... thats weird. If you call the new one CLIP, exactly like the original, it works..!

If you call it anything else, it doesn't.

...weird.

Well.. thanks!
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Decorate Question (Ammo)

Post by NeuralStunner »

SFJake wrote:Well.. thanks!
:thumb: I knew in the back of my mind there just had to be a way to do it.

Please correct me if I'm wrong, but it seems there's about nothing left for DehackEd to do that can't be done with some other ZDoom lump. (Which is just as well. DECORATE is so much more intuitive for me.)
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Decorate Question (Ammo)

Post by Ceeb »

DeHackEd is the shiz. 8-) I use it for what I can and then resort to DECORATE. And no one can stop me! :P
User avatar
SFJake
Posts: 531
Joined: Sat Nov 03, 2007 11:28 am

Re: Decorate Question (Ammo)

Post by SFJake »

Well I thought this was nice and all.

But it doesn't work.

Rather, there is a problem. A big one. The pickups become totally irreplaceable. How is this a problem? Well, they don't give off any ammo. -At all-. The box does, but not the clip. Since I can't replace them, there is no way around it.

This was totally useless.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Decorate Question (Ammo)

Post by NeuralStunner »

:bang:
I should have known. It's never so simple...

Apparently replacing a standard ammo type confuses the crap out of ZDoom. If I redefined every instance of Clip (Item drops, AmmoType for the weapons, etc.) with a new ammo type (ClipPlus), it worked fine - Except for the "BULL" entry on the HUD. (Because it tracks Clip, and not anything that replaces it.)

If I redefine "Clip", derived from Ammo, it should replace the originally defined Clip, but it doesn't. Through a little tweaking I managed to get everything working, except for the map-spawned Clips. I thought that's what SpawnID does? Adding a new actor with the same ID should replace the old one, right? :?

If the code involved is not "fixable", then it seems DehackEd is indeed your only choice. Sorry about that, guys. :(
User avatar
SFJake
Posts: 531
Joined: Sat Nov 03, 2007 11:28 am

Re: Decorate Question (Ammo)

Post by SFJake »

Heh, it was worth a try :P
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Decorate Question (Ammo)

Post by Gez »

NeuralStunner wrote:except for the map-spawned Clips. I thought that's what SpawnID does?
No. SpawnID is only used for spawning or counting things with [wiki=Action_specials#Things]some action specials[/wiki] and for things like the Hexen potteries and decorative suit of armor. Map-spawned items are created according to their editor number (aka doomednum).
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Decorate Question (Ammo)

Post by Xaser »

Most of the time, I wind up resorting to the DEHACKED method since it's just a few lines that don't conflict with anything else, rather than creating all new ammo types -- though with SBARINFO now, even the latter is easily fixable.

Still, I'd like to see *some* way of changing the default ammo maximums without DEHACKED... not that it matters, really, but it's amusing how the lump STILL isn't obsolete yet. :P
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Decorate Question (Ammo)

Post by Project Shadowcat »

I use a combination of both the DEHACKED method and the ACS method. DEHACKED lets me set the base values (which are lower than normal), and ACS through Custom Inventory items lets me increase each ammo type separately and stackably.
Locked

Return to “Editing (Archive)”