310
edits
mNo edit summary |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 182: | Line 182: | ||
''I want an interaction to happen only when the player has an Inventory Item (like a key to open a door) OR something not to happen when the player has an Item. How do I do that?'' | ''I want an interaction to happen only when the player has an Inventory Item (like a key to open a door) OR something not to happen when the player has an Item. How do I do that?'' | ||
Simply use the [http://www. | Simply use the [http://www.adventuregamestudio.co.uk/manual/ags49.htm#character.inventoryquantity InventoryQuantity] property, e.g.: | ||
if (player.InventoryQuantity[iKey.ID] == 0) | if (player.InventoryQuantity[iKey.ID] == 0) | ||
Line 196: | Line 196: | ||
'''Note:''' | '''Note:''' | ||
* The InventoryQuantity property was introduced in V2.7. Before that, use the ''character[].inv'' array. | * The InventoryQuantity property was introduced in V2.7. Before that, use the ''character[].inv'' array. | ||
[[Category: | |||
[[Category:Beginner Tutorials]] |