spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Character functions and properties

InventoryQuantity property

(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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.