Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: deedee on Sat 28/02/2004 15:30:56

Title: Giving a NPC an object in a dialog
Post by: deedee on Sat 28/02/2004 15:30:56
Let me explain first: My character is gathering some items for another character. I have managed to make the dialog options appear (when he has the specified object) saying that he has the item and he is giving it to the NPC.
I want a reaction from the NPC when all items are in his inventory (the NPC's inventory)... but i can't find a way to add an inv item to the NPC's inventory in the dialog scripting.

Any ideas?
Title: Re:Giving a NPC an object in a dialog
Post by: RickJ on Sat 28/02/2004 15:57:31
In the dialog you can do a "Run Script Command".  This will trigger an event handler to run in the global scriopt file.  Check the help file to see how to do this.

In the global script file just do the following to give the NPC one of the inventory-1 objects.  

character[NPC].inv[1] = 1;  

Title: Re:Giving a NPC an object in a dialog
Post by: deedee on Mon 01/03/2004 23:26:15
i managed to add the run-script and all that... but i have a doubt on that script line you wrote: What do those numbers mean? wich one is the inventory item number; and what does the other stand for?


tnx
Title: Re:Giving a NPC an object in a dialog
Post by: Fabiano on Mon 01/03/2004 23:47:49
NPC is the npc's name
.inv[1] means the object 1
= 1 means true
so
character[NPC].inv[1]=1 means
the NPC has the object 1