Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: piraatlife4me on Wed 05/11/2003 19:11:15

Title: How do you create a custom Quit screen?
Post by: piraatlife4me on Wed 05/11/2003 19:11:15
I want to creat a custom quitgame screen so when the player clicks on quit game a dialog box will pop up saying random things each time with a different graphic being displayed. Like "Are you sure you want to quit", or "OH is your mommy calling you" etc.  I know how to create a custom GUI but how do I acess the default one in AGS.  I can't find where it is located.  I can change the global message in the global messages to what ever I like but I cant seem to find where the quitgame gui is located.  If I could just find that out I could probably just make my own GUI for it, have some sets of pics, set up a random event to do the rest. Please let me know thanks!

Daniel
Winebarger
Title: Re:How do you create a custom Quit screen?
Post by: Isegrim on Wed 05/11/2003 19:19:38
I fear that the standard Quit GUI is rigged into the Engine directly and cannot be accessed in the Editor.
You can however make a GUI with the desired Text and buttons, and the final "Quit"-Button of it must trigger the script command 'QuitGame(0)' (The "0" stands for "do not ask user again").
All that remains to do is making the above GUI appear at the desired user input...
Title: Re:How do you create a custom Quit screen?
Post by: Ben on Wed 05/11/2003 21:32:43
So, you want a new quit GUI that shows a random message with a matching picture next to it?

First make a GUI with your quit and cancel butons. Add a label, and next to that add a button with a sprite (this will be the picture that goes along with the message.

In the script that brings up the gui, do something like this (in this case, the quit window is GUI #4, the message label is object 2, and the button with the picture is object 3):

int quit_message = Random(10);

if(quit_message==0) {
SetLabelText(4, 2, "Message 0");
SetButtonPic(4, 3, 1, slot);
}

else if(quit_message==1) {
SetLabelText(4, 2, "Message 1");
SetButtonPic(4, 3, 1, slot);
}

.
.
.

else if(quit_message==10) {
SetLabelText(4, 2, "Message 10");
SetButtonPic(4, 3, 1, slot);
}

GUIOn(4);

All you need to do is plug in the number of the sprite you want (can be found in the sprite manager), and write the messages. I know I haven't realy explained this well, so tell me if you don't understand..
Title: Re:How do you create a custom Quit screen?
Post by: Alex Lowes on Thu 06/11/2003 11:57:54
CJ I think it would be grate to edit the quit screen in the GUI editor instead of scripting such a long time for just making a quit game screen :)
(of course I can only wish for it,and script till then).
Title: Re:How do you create a custom Quit screen?
Post by: a-v-o on Thu 06/11/2003 13:30:26
The long script is only necessary because piraatlife4me wants random quit messages. Otherwise you'd design your quit game gui in the gui editor and just show it with GUIon (4); which is one simple line of code.
Title: Re:How do you create a custom Quit screen?
Post by: piraatlife4me on Fri 07/11/2003 04:25:48
Hey Ben! It's Dan here,  thanks alot I tried that and it works! I am totally liking this addition to my game. Thanks alot!

Daniel
Winebarger