Backpack overstuffed my console...

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.
Locked
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Backpack overstuffed my console...

Post by Ed the Bat »

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.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Backpack overstuffed my console...

Post by Gez »

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.
User avatar
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...

Post by Ed the Bat »

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? :P
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Backpack overstuffed my console...

Post by Xaser »

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).
User avatar
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...

Post by XutaWoo »

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. :P
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Backpack overstuffed my console...

Post by Xaser »

XutaWoo wrote:Actually, it is, for the very reason Gez described.
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.
Locked

Return to “Editing (Archive)”