Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: cece0808 on Mon 09/01/2006 17:42:54

Title: Automaticly closing inventory? help!
Post by: cece0808 on Mon 09/01/2006 17:42:54
Ok I have item in inventory, and ingame when I look at the item, it takes player into another room. Now the inventory stays open even the room changes. How can I change that? Can I make the inventory go shut when changing to another room? Is there any simple script that should do it?

thx alot!
Title: Re: Automaticly closing inventory? help!
Post by: ManicMatt on Mon 09/01/2006 18:00:16
GUIOff (INVENTORY);

Could this work? I don't have time to try it out. You try that out until an expert comes along! (After the command to change rooms in your interaction editor, tell it to "run script" and plonk that writing in it)

Man, if this is wrong the mods are gonna kill me for trying to help when I don't even know what I'm doing!
Title: Re: Automaticly closing inventory? help!
Post by: Ashen on Mon 09/01/2006 18:30:23
Well, it WAS right, in versions 2.62 and lower, which counts for something ...

Now (2.7 +) you'd use the GUI.Visible property, e.g. gInventory.Visible = false;. Or, if you're using the interaction editor, the 'Game - Hide GUI' interaction.

Where to put it ... either just before the command to change room (Probably the simplest way), when you enter the room (e.g. 'Player enters screen - before fadein'), or set up on_event and use the EnterRoomBeforeFadein event.