Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Babar on Thu 04/09/2003 18:33:17

Title: Disabling Inventory
Post by: Babar on Thu 04/09/2003 18:33:17
There is this part in my game where the character is driving around in a car. I want to disable everything except look and walk icons. Is there a way to disable the inventory icon for that screen and enable it again after the player leaves the screen?
Title: Re:Disabling Inventory
Post by: Scummbuddy on Thu 04/09/2003 21:37:35
I think what you want is 'DisableCursorMode', since I have no clue as to what style game you are creating.

You could also need 'GuiOff'

Depending on what type of interface you are using, look up each one in the ags manual for more information.
Title: Re:Disabling Inventory
Post by: Babar on Fri 05/09/2003 07:42:17
I used DisableCursormode but that does not stop the player from clicking on the inventory button and opening and looking at the inventory. I tried using GUIOff(2) to disablr the inventory, but it doesn't work, as the inventory still opens when the player clicks the button
Title: Re:Disabling Inventory
Post by: Scummbuddy on Fri 05/09/2003 07:49:04
Okay, then, you need to either post some screenshots that will help us, or please give a good description, or a good example game thats like it.
Title: Re:Disabling Inventory
Post by: Gilbert on Fri 05/09/2003 09:28:27
Use a globalint to track whether a GUI should be active. Say, for example, I'll use globalint 5 here.

When you want the GUI to be disabled, just do something like:

SetGlobalInt(5,1);


In the interfaceclick script, where it described something like clicking on the button to bring up the GUI, it would be something like:

GUIOn(Whatever);

Instead, put it into a if statement:

if (GetGlobalInt(5)==0) GUIOn(whatever);


At points where you want the GUI to be enabled again, just do:

SetGlobalInt(5,0);