Inventory properties

From ZDoom Wiki
Jump to navigation Jump to search

The Inventory base class defines the following properties which are available to all inventory subclasses:

  • Inventory.Amount value
Sets the amount of inventory items given by this item. Mostly used for item types that give larger quantities.
If the item in question is ammo and was dropped by another actor via A_DropItem or A_NoBlocking, its amount will be reduced by half by default. This can be changed by modifying the ammo's DropAmount property, or the DropAmmoFactor value in your custom skill definition.
  • Inventory.DefMaxAmount
Sets the maximum amount the player can carry of this item to the game's default. That is normally 16 for Heretic and 25 for the other games, but can be changed in MAPINFO through the GameInfo section.
  • Inventory.MaxAmount value
Sets the maximum amount the player can carry of this item.
  • Inventory.InterHubAmount value
Sets the maximum amount the player can keep of this item when traveling between hubs or non-hub levels. The default value of one replicates the original behavior of Heretic. This property replaces the deprecated INVENTORY.INTERHUBSTRIP.
  • Inventory.Icon sprite
Defines the icon this item uses when displayed in the HUD or status bar.
  • Inventory.AltHUDIcon sprite
Defines the icon this item uses when displayed in the alternate HUD. This is of use with keys, weapons, ammunition and artifacts.
  • Inventory.PickupMessage message
Defines the message that is printed when the player picks up this item. Strings from the LANGUAGE lump can be used by passing the string's identifier prefixed with '$'. For Health items, this can be overriden by the Health.LowMessage property.
  • Inventory.PickupSound sound
Defines the sound that is played when a player picks up this item.
  • Inventory.PickupFlash actor
Defines what actor should appear when the item is picked up; normally this would be used with the PickupFlash actor to make a flash appear as the player picks up the item. If this is not specified there will be no flash when the item is picked up.
  • Inventory.UseSound sound
Defines the sound that is played when a player uses this item. The sound is played on the item channel (CHAN_ITEM) with normal attenuation.
  • Inventory.RespawnTics value
Defines the time it takes until this item respawns (if respawn is enabled) in 1/35 of a second.
  • Inventory.GiveQuest value
Also give a quest item for controlling Strife's dialogs when picking up this one. value can be in the range of [1..31]
  • Inventory.ForbiddenTo classname[, classname2[, classname3[, ...]]]
Prevents players using one of the listed classes (use actor names, not Player.DisplayName) from picking up this type of inventory item. Note that unless playing in cooperative mode, a forbidden player will still try to pickup a Weapon or WeaponPiece for ammunition, as in Hexen. Use an empty string (e.g., Inventory.ForbiddenTo "") to clear an inventory item of inherited interdictions.
  • Inventory.RestrictedTo classname[, classname2[, classname3[, ...]]]
Prevents players not using one of the listed classes (use actor names, not Player.DisplayName) from picking up this type of inventory item. Note that unless playing in cooperative mode, a forbidden player will still try to pickup a Weapon or WeaponPiece for ammunition, as in Hexen. Use an empty string (e.g., Inventory.ForbiddenTo "") to clear an inventory item of inherited restrictions.