A_GiveInventory

From ZDoom Wiki
Jump to: navigation, search

A_GiveInventory (string type, int count)
A_GiveInventory (string type, int count[, pointer giveto])


Tries to add count items of type type to the calling actor's inventory. This function will not add more items than can be carried. This is only really useful for weapons and Custom Inventory.

Giveto is an optional Actor pointer selector.

Examples

Actor BigBoost : CustomInventory 10492
{
  Inventory.PickupMessage "Energy Boost!!!"
  Inventory.PickupSound "misc/p_pkup"
  +COUNTITEM
  States
  {
  Spawn:
    AWI3 A -1
    Stop
  Pickup:
    TNT1 A 0 A_GiveInventory ("Soulsphere", 2)
    TNT1 A 0 A_GiveInventory ("BFG9000")
    Stop
  }
}

This actor uses the CustomInventory's special behavior to give two inventory items with one pickup using A_GiveInventory.

Personal tools
Namespaces

Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox