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

Moderator: GZDoom Developers

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

Postby kevansevans » Thu Mar 24, 2022 12:57 pm

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 allExpand view
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
kevansevans
Disciple of The Great God Imp
Spotlight Team
 
Joined: 05 Oct 2010
Github ID: kevansevans
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Fri Apr 29, 2022 1:32 am

I can give you Get/SetAmmoCapacity functions, like in ACS. This kind of operation is not safe for non-ammoi tems
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Caligari87 and 0 guests