Saving the game before quitting

Started by JudasFm, Tue 10/02/2004 09:34:37

Previous topic - Next topic

JudasFm

I want to add something to my game that prompts the player to save when the quit button is pressed, something like "Do you want to save your game?" and relevant buttons (yes/no) If they say yes, they're taken to the save screen, then when they've saved, the game quits, if no the game quits immediately.  I've tried a few times on my own but no luck.  Can someone please tell me the script I need and whereabouts it should go?
Thanks! :)
JudasFm

Phemar


Create new gui. Name it PROMPTUSER
make it popup modal and set all buttons to run script

Add label Make it say "Do you first want to save game?"

Make 2 buttons "yes""no"

For yes button type:

SaveGameDialog ();
QuitGame (0);
}

For No button type:

QuitGame (1);

Hope this helps.

P.S. I'm assuming you know how to make a basic gui.

::Zor

JudasFm

Thanks...I think that kind of worked.  I've got the script in place for the buttons but I still can't get the GUI to appear whenever the player clicks on Quit ???

Ishmael

Set teh quit button to:

GUIOff(GUI); // if any needed
GUIOn(QUIT); // if the quit QUI is called "QUIT"
SetCursorMode(6): // set to the arrow pointer
Wait(1); // so that the screen gets to update
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

JudasFm

Oh boy, it REALLY didn't like that one ??? Thanks anyway though; I think I'll have to go back to the drawing board (ie, a warning in the manual  ;))

Ishmael

What do you mean it didn't like it?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

JudasFm

I mean it kept giving me error messages about the script when I tried saving it *is puzzled* Oh well...it's not too important; it's probably something I missed in the script/GUI.  Thanks for your help though; I'll keep playing around with it :)


Ishmael

Ooops... sorry... that happens to me all the time...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk