How do you create a custom Quit screen?

Started by piraatlife4me, Wed 05/11/2003 19:11:15

Previous topic - Next topic

piraatlife4me

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

Isegrim

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...
This post was generated automatically and therefore bears no signature.

Ben

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..

Alex Lowes

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).

a-v-o

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.

piraatlife4me

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

SMF spam blocked by CleanTalk