In my project, if I pick up a backpack-type item, and then use printinv, I am given a list so long that it doesn't even fit in the console. This is because every ammo type is put in that list, even ones that are restricted to other player classes. They're simply put in as having 0 of them, but since they're forbidden to the class I'm playing as, I really don't think I ought to even see any mention of them in my inventory. Taking away the INVENTORY.KEEPDEPLETED flag from these ammo types didn't help my situation, either.
Anyone have any advice? This issue makes debugging inventories pretty much impossible once a backpack is found.
Backpack overstuffed my console...
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.
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.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Backpack overstuffed my console...
Yeah, this is a consequence of how the backpacks work.
An ammo's maximum amount is a property of the ammo itself. So, if the ammo has a BackpackMaxAmount different from its normal MaxAmount, how does it work? When you pick up a backpack, you're given the ammo, with a quantity equal to BackpackAmount (so it can very well be 0), just so that the MaxAmount value can be bumped up to the BackpackMaxAmount value.
If it didn't do that, it'd only increase the amount for the ammo types that you already have in inventory.
It's also for that reason that ammos are always kept even if depleted.
An ammo's maximum amount is a property of the ammo itself. So, if the ammo has a BackpackMaxAmount different from its normal MaxAmount, how does it work? When you pick up a backpack, you're given the ammo, with a quantity equal to BackpackAmount (so it can very well be 0), just so that the MaxAmount value can be bumped up to the BackpackMaxAmount value.
If it didn't do that, it'd only increase the amount for the ammo types that you already have in inventory.
It's also for that reason that ammos are always kept even if depleted.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: Backpack overstuffed my console...
I get that. But these ammos don't have BackpackAmount 0. They have normal amounts (typically, I make them equal to one pickup's worth). They're just forbidden from every character except their own, via Inventory.RestrictedTo, to prevent the wrong player from snaking them away from their real owner.
That doesn't stop them from being put in other characters' inventories, though. I guess even RESTRICTABSOLUTELY isn't absolutely absolute, eh?
That doesn't stop them from being put in other characters' inventories, though. I guess even RESTRICTABSOLUTELY isn't absolutely absolute, eh?

Re: Backpack overstuffed my console...
Is there any benefit to showing 0-amount ammo items with "printinv" though? It seems as if excluding them could be a worthwhile change. It'd be a special case different than the KEEPDEPLETED flag, IMO, since use of the flag is primarily to ensure the player "has" the item all the time anyway (which isn't really analogous to ammo).
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Backpack overstuffed my console...
Actually, it is, for the very reason Gez described.
Of course, I'm like the only person who uses [wiki]SetAmmoCapacity[/wiki], so I'm like the only one who cares.
Of course, I'm like the only person who uses [wiki]SetAmmoCapacity[/wiki], so I'm like the only one who cares.

Re: Backpack overstuffed my console...
I wasn't talking about changing how ammo items actually behave, if that's what you're referring to (of course they work the way they do for a reason). I suggested a change only to printinv.XutaWoo wrote:Actually, it is, for the very reason Gez described.