(Formerly known as character[].inv, which is now obsolete)
int Character.InventoryQuantity[]
Gets/sets the quantity of the specified inventory item that the character currently has.
The array index is the inventory item number, from the Inventory pane in the editor.
Usually, you should use the AddInventory and LoseInventory functions to modify the
character's inventory; however, if you need to add or remove a large number of items
in one go, directly changing this array can be an easier method.
If you change this array directly, the on-screen inventory will not be updated. In this
case, you must call UpdateInventory to see any new or removed items.
If you just want to quickly check whether the character has a particular item or
not, use the HasInventory function instead.
Example:
Display("The player has $%d.", player.InventoryQuantity[iCash.ID]);
will display how many inventory items of type iCash the player has.
See Also: UpdateInventory,
Character.AddInventory,
Character.HasInventory,
Character.LoseInventory
|