Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: GuyLaDouche on Tue 03/08/2004 09:36:19

Title: My GUIs are not showing (fixed)
Post by: GuyLaDouche on Tue 03/08/2004 09:36:19
I'm having difficulty programming the GUIs to not appear in the introduction screen but still be capable of using them once I begin a game. I have tried following the example from Demo Quest 2.3, and disabled the GUIs at the beginning of the game and added this text to the for the introduction room:

function room_c() {
Ã,  InterfaceOn(1);
Ã,  InterfaceOn(5);
}

However it still doesn't work. Any suggestions?
Title: Re: My GUIs are not showing
Post by: Mr Jake on Tue 03/08/2004 09:53:25
doesnt Interface on/off just enable/disable the GUI?

try using GUIOn(int GUI) and GUIIOff(int GUI)
Title: Re: My GUIs are not showing
Post by: Gilbert on Tue 03/08/2004 10:45:20
GUIOn/Off() and InterfaceOn/Off() just did the same things. (Note: in older version of AGS, the GUIs were called interfaces, later to avoid confusions they're now called GUI's, you're recommended to use the GUI...() for function names though.)

What I suspect was that you prolly just add a function blindly without putting it to use in an interaction, did you just type the whole function into the script; or use the interaction menu to add an action (in an event of your choice), set it to "Run Script...", press "Edit Script" then add the two "GUIOn()" lines there?

You should do the latter.
Title: Re: My GUIs are not showing
Post by: GuyLaDouche on Tue 03/08/2004 11:01:45
I honestly don't understand what you are asking. When I remove the "InterfaceOff"s, the GUIs do show up. The problem is they get in the way of the introduction page then. But, when I add them, even with the function, the GUIs don't appear.
Title: Re: My GUIs are not showing
Post by: Gilbert on Wed 04/08/2004 02:30:09
The problem was, where did you put the InterfaceOff() lines? You didn't show us.
Title: Re: My GUIs are not showing
Post by: GuyLaDouche on Wed 04/08/2004 03:31:18
Part of the main script:

function game_start() {
  // called when the game starts, before the first room is loaded
  SetCursorMode(0); 
  GUIOff(1);
  InterfaceOff(2);
  GUIOff(5);
  InterfaceOff(8);
  InterfaceOff(9);
}

I recently changed interface to GUI as a test, but produced no results.
Title: Re: My GUIs are not showing
Post by: Gilbert on Wed 04/08/2004 03:54:03
They're  in game_start, so should be ok.

The problem was, where did you put the InterfaceOn() lines?

Like I said before:
Quote from: Gilbot V7000a on Tue 03/08/2004 10:45:20
What I suspect was that you prolly just add a function blindly without putting it to use in an interaction, did you just type the whole function into the script; or use the interaction menu to add an action (in an event of your choice), set it to "Run Script...", press "Edit Script" then add the two "GUIOn()" lines there?

You should do the latter.

You can't just define a function called room_c() and never specify how or where to use it.
Title: Re: My GUIs are not showing
Post by: GuyLaDouche on Wed 04/08/2004 04:22:40
I understand that now, I did copy and paste a function, but I now set it so when I press New Game it goes to the players start room and runs script:

function hotspot1_a() {
  // script for hotspot1: Any click on hotspot
  InterfaceOn(1);
  InterfaceOn(5);
}

But the GUI still doesn't show
Title: Re: My GUIs are not showing
Post by: Gilbert on Wed 04/08/2004 04:47:47
Try putting the "change room" interaction AFTER "Run script..." and see if it helps.

Though a better solution is, change room within the script, as you'd made one already, delete that change room interaction. Like:

function hotspot1_a() {
  // script for hotspot1: Any click on hotspot
  InterfaceOn(1);
  InterfaceOn(5);
NewRoom(5);//Change to your desired parameters
}
Title: Re: My GUIs are not showing
Post by: GuyLaDouche on Wed 04/08/2004 08:31:45
Okay, I tried that and now it works. Thanks, Gilbot. :)