My GUIs are not showing (fixed)

Started by GuyLaDouche, Tue 03/08/2004 09:36:19

Previous topic - Next topic

GuyLaDouche

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?

Mr Jake

doesnt Interface on/off just enable/disable the GUI?

try using GUIOn(int GUI) and GUIIOff(int GUI)

Gilbert

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.

GuyLaDouche

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.

Gilbert

The problem was, where did you put the InterfaceOff() lines? You didn't show us.

GuyLaDouche

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.

Gilbert

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.

GuyLaDouche

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

Gilbert

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
}

GuyLaDouche

Okay, I tried that and now it works. Thanks, Gilbot. :)

SMF spam blocked by CleanTalk