Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 18/12/2003 09:11:23

Title: nother question from an idiot. addinv in dialogue??
Post by: on Thu 18/12/2003 09:11:23
when engaging in normal dialogue, how do you add an item to the characters inventory? you see, one part in my game, the character is talking to an NPC, and i want one of the NPC's responses to not only be a message (as in "here have this") but to also give the item. i have tried several methods, but even when i dont get errors in the dialouge, it still never works. thanks in advance!
Title: Re:nother question from an idiot. addinv in dialogue??
Post by: Gilbert on Thu 18/12/2003 09:17:21
From the AGS manual:

Quote
add-inv X
Adds inventory item X to the current player's inventory. This does the same thing as the AddInventory text script command, but is provided here because it is frequently used in dialogs.

So basically, when at some stage you want to add item, say, #10, to the player's inventory, just put the line:

add-inv 15

to the dialog script.