[ZS] Easier way to set max item capacity with backpack items

Moderator: GZDoom Developers

User avatar
kevansevans
Spotlight Team
Posts: 423
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support

[ZS] Easier way to set max item capacity with backpack items

Post by kevansevans »

The outdated entry on the wiki brought this to my attention: https://zdoom.org/wiki/Classes:BackpackItem
However, the quantity of contained ammunition, and the size of the increase are qualities of the ammunition, not of the backpack. Therefore, it is not possible to make several different types of backpacks, such as a "regular backpack" that would double the basic carrying capacity and a "super backpack" that would triple it, for example. Or a "cursed backpack" that would reduce carrying capacity.
I know this is in regards to DECORATE, and how that is not currently possible, however in ZScript it is, and I have written a backpack replacement that allows each backpack to stack onto each other:
Spoiler:
And quite frankly, this is hecking hideous. Would it be possible to have a function in the Inventory class that can explicitly change the max capacity of an item/items without whatever it was I posted above? ACS has this functionality, with SetAmmoCapacity, so I don't see why not ZScript can have it. Ideally, I would like to see something like:

Code: Select all

Inventory.setMaxAmount(Class Name, Double Multiplier, Bool specific value); 
Class name being anything that is that class and inherits from it, a double being the multiplier (IE 2 for backpack behavior), and a bool if the user wants to set a very specific value.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49117
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZS] Easier way to set max item capacity with backpack i

Post by Graf Zahl »

I can give you Get/SetAmmoCapacity functions, like in ACS. This kind of operation is not safe for non-ammoi tems

Return to “Closed Feature Suggestions [GZDoom]”