What callback is triggered when Inventory item is removed by X amount whitout depleting it?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Goofz
Posts: 3
Joined: Thu Apr 02, 2026 9:24 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Legacy GZDoom)

What callback is triggered when Inventory item is removed by X amount whitout depleting it?

Post by Goofz »

Hi, does exist an event or virtual that get's called when an inventory item from the player is taken by X amount whitout depleting it?
I looked up on the wiki and found the Inventory.DepleteBy method but it's not yet avaiable for the latest UZDoom.
I need this for a grid-based inventory system, currently if an item is taken away (ex. take command or TakeInventory) it doesn't update the grid.
Thank you.
Last edited by Goofz on Thu Apr 02, 2026 11:08 am, edited 1 time in total.
Goofz
Posts: 3
Joined: Thu Apr 02, 2026 9:24 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Legacy GZDoom)

Re: What callback is triggered when Inventory item is removed by X amount whitout depleting it?

Post by Goofz »

P.S. Before submitting this post, I looked around.
I found one game called Wandmaster, didn't play it but the screens are really cool. I'm no copy-paster, so I'm trying to understand how their system works, at first glance it's very advanced and personalized.
One possible solution I had was to check every tick if the inventory amount changed but has the drawback that the update happens with 1 tic delay.
I'll reply to this post if I'll figure out. :D
Goofz
Posts: 3
Joined: Thu Apr 02, 2026 9:24 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Legacy GZDoom)

Re: What callback is triggered when Inventory item is removed by X amount whitout depleting it?

Post by Goofz »

Update: I haven't figured a way to update when an item is removed by X amount.
The problem with my inventory system is that it won't sync immediatly with the "vanilla" inventory when partial removal happens, methods like FindInventory won't find an item inside my inventory.
Still looking for ideas or advices, thanks.

Return to “Scripting”