Game authors and players, please read this thread!

Author Topic: Revisiting Quit Game Scripting  (Read 135 times)  Share 

Revisiting Quit Game Scripting
« on: 14 Mar 2012, 22:28 »
I've been searching the boards for the last hour or so and still don't have the answer to my question, as alot of the information is for older versions than the 3.2 version I have...

I HAVE figured out how to create a Quit GUI with buttons and - presumably - I have the buttons linked to the correct scripts ("QuitGame(0);" to quit and "gQuit.Visible = false;" to continue, right?), but I can't get the GUI to come up! When I test the game, it keeps bringing up the default one. So I copied the script  instructions for the default quit and renamed it, changing "btnQuit_OnClick" to "btnQuitYN_OnClick" and then I pointed the Quit instruction on the Panel to run btnQuitYN. Now when I try to test the game, I get the following error:
"GlobalScript.asc(200): Error (line 200): Undefined token 'buttons'" and I'm afraid to go messing around with that line lest I really make matters worse!

Please help, as I'm totally new and have just been stumbling my way up to this point; I HAVE tried to learn scripting but this so-called "simple language" is unimagineably above my head.   :'(

NickyNyce

  • ready...FIRE...aim
  • NickyNyce worked on a game that was nominated for an AGS Award!
Re: Revisiting Quit Game Scripting
« Reply #1 on: 14 Mar 2012, 22:39 »
I found this stashed in my notes, I had the same question.

Create a new custom quit GUI.
Then Go to the global script and look for this line:
  if (keycode == eKeyCtrlQ)  QuitGame(1);   // Ctrl-Q

Change the action part (QuitGame(1)) in to showing the new GUI.
Something like this:
  if (keycode == eKeyCtrlQ)  g<newguinamehere>.Visible=true;   // Ctrl-Q
(where <newguinamehere> is the name of your new GUI.)

Now, when pressing CTRL-Q ingame, the new GUI is shown in stead of the standard dialog.

Hope this helps

Re: Revisiting Quit Game Scripting
« Reply #2 on: 14 Mar 2012, 22:44 »
A-aaaaaaaaaah. Got it. Thanks so much, I'll do that.   :)