ichxg0 wrote: ↑Sun Dec 01, 2024 11:56 am
Browsing though the wiki I saw "+INVENTORY.KEEPDEPLETED" in a default entry, so I tried to copy paste it into into a this mod's existing decorate but for some reason that had no effect.
It is typically not a good idea to copy-paste code if you don't fully understand what it does. The
wiki page on
Inventory explains the purpose of the
KEEPDEPLETED flag:
ZDoom Wiki wrote:This item will remain in the player's inventory bar even after the last one is used. If the item also has an inventory icon, it will be drawn darkened when the quantity is 0.
Clearly, that's not what you want. But, there is another flag that suits your needs perfectly - aptly named
AUTOACTIVATE:
ZDoom Wiki wrote:This item activates automatically when being picked up.
There is a catch, though. With health pickups like the Quartz Flask, if you just add the flag, they will be used on pickup only if the player's health is less than maximum. Otherwise, the item will still end up in the inventory. To avoid this, you should set
MaxAmount to 0. Then, the item will not be picked up if it cannot be used.
Here is the final code:
Code: Select all
actor ArtiHealth8 : ArtiHealth replaces Medikit
{
Inventory.MaxAmount 0
+INVENTORY.AUTOACTIVATE
}