From ZDoom Wiki
Jump to navigation Jump to search

bool A_SetInventory (string type, int count [, pointer ptr [, bool beyondMax]]])


Behaves similarly to A_GiveInventory with a few key exceptions.

  • The amount is specifically set, not added or subtracted. As such, setting it to 0 will remove the item completely.
  • As such, ignores health properties and skill levels. Use A_GiveInventory for standard giving.


  • type: the item to give. This should be a valid inventory item.
  • count: the amount to set.
  • ptr: the actor to give the item to. This is an actor pointer selector. Default is AAPTR_DEFAULT, which corresponds to the caller of the function.
  • beyondMax: Unlike A_GiveInventory, this function respects the MaxAmount property at all times. Setting this to true will ignore the maximum value. Default is false.

Return value

The function returns true if the actor has their inventory changed. Thus, if they already have the amount specified, it returns false.


Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.