Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Nintengame on Mon 29/05/2006 22:55:35

Title: Inventory interaction
Post by: Nintengame on Mon 29/05/2006 22:55:35
I want to set up my inventory so that when the player clicks on, say, a box, it will open and give him another item
Title: Re: Inventory interaction
Post by: Khris on Mon 29/05/2006 23:35:15
Go to inventory items, select the box, click "Interactions", double click on "Interact with inventory item", add a RunScript-Interaction, then enter this
Ã,  if (GetGlobalInt(100)==1) player.Say("It's empty.");
Ã,  else {
Ã,  Ã,  SetGlobalInt(100, 1);
Ã,  Ã,  player.AddInventory(iContents);
Ã,  Ã,  player.Say("Hey, there's a whatever in there.");
Ã,  }


This is even too basic to be a beginner's question. You really need to read the manual and do the included tutorial.
Maybe you should've figured out the very basics of AGS first, before opening a Game in production-thread...
Title: Re: Inventory interaction
Post by: Nintengame on Tue 30/05/2006 02:34:44
look, my manual doesn't work, ok?
Title: Re: Inventory interaction
Post by: Gilbert on Tue 30/05/2006 02:36:20
But did you try fixing it or reading the online manual as suggested in this thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26782.0)?
Title: Re: Inventory interaction
Post by: Nintengame on Tue 30/05/2006 02:45:00
Oh, thanx.  :-[