Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: dikla on Sat 24/07/2004 17:09:23

Title: how to make gui disapear (not guioff)
Post by: dikla on Sat 24/07/2004 17:09:23
I have in the room 4 hotspot which directs to several rooms. one of the hotspot is the speed slider. after you click it, and after you click on the other hotspot - the slider keep showing in every room.
the GUIOff command make the slider not shown at all.
i tried to put guioff in the other hotspots but it does not help.
here is the script:
function interface_click(int interface, int button) {
Ã,  if (interface == 4) {Ã,  // gui the slider is on

Ã,  Ã, if (button == 0) SetGameSpeed(GetSliderValue(4,0));Ã, 
//all this in the gloabl scipt

in the hotspot
ShowGUI (4);

RUNSCRIPT

SetGUIPosition (4,33, 146);Ã, 

if (IsGamePaused() == 1) UnPauseGame();

now what should i do to make the gui(4) not appearing in every room.
tx diklaÃ, 

Title: Re: how to make gui disapear (not guioff)
Post by: Radiant on Mon 26/07/2004 14:36:49
check the on_event function, and in LEAVE_ROOM turn the GUI off.
Title: Re: how to make gui disapear (not guioff)
Post by: dikla on Mon 26/07/2004 21:06:04
first, the function on-event does not appear in my gloabl script, but i added it:
function on_event (LEAVE_ROOM, 13){
  GUIOff (4);
}
but when i try to save it says:
PEO(3): parse error at 1.
can you tell me whats worng?
dikla
Title: Re: how to make gui disapear (not guioff)
Post by: on Tue 27/07/2004 01:11:11
it should go like this:

function on_event(int event, int data){
  if (event==LEAVE_ROOM) GUIOff(4);
  }

DO NOT CHANGE THIS SCRIPT. I made is specifically for you. Just copy it, and paste it in place of your on_event script.  ;D I'm in such a great mood!
Title: Re: how to make gui disapear (not guioff)
Post by: on Tue 27/07/2004 01:14:27
Correction:

function on_event(int event, int data){
  if (event==LEAVE_ROOM){
    if (data==13) GUIOff(4);
    }
  }

I really should just log in. But this script will turn the GUI off when you leave room 13. Which is what it appears you are trying to do.