Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Phemar on Thu 01/01/2004 19:12:39

Title: save/load dialog box
Post by: Phemar on Thu 01/01/2004 19:12:39
save/load dialog box

I want my whole game to be customized. I've created my own quitbox, I know exactly how to do that. I just wandered if anyone out there knew how to create a customized save/load dialog box. It can be popup like the default one or if anyone knows how to do in a listbox that would be even better! I played that alien rape escape and their save/load dialog box was customized so I know it is possible. (breath!)

So if anyone can help out it would be greatly appreciated!
Title: Re:save/load dialog box
Post by: Scorpiorus on Thu 01/01/2004 20:13:02
Check the SAVE/LOAD GUI tutorial by Spyros http://atticwindow.adventuredevelopers.com/tutorials.php?id=1 (http://atticwindow.adventuredevelopers.com/tutorials.php?id=1)

~Cheers
Title: Re:save/load dialog box
Post by: Phemar on Fri 02/01/2004 05:04:45
Thanks, I did all that, but now it says "Parse error at index"

???


Title: Re:save/load dialog box
Post by: Ishmael on Sat 03/01/2004 15:11:29
You forgot the "int index;" from the start of the global script..?
Title: Re:save/load dialog box
Post by: Phemar on Sun 04/01/2004 04:49:56
Ok thanks, now that's fine but now it says "parse error at else.
My script looks like this:

function interface_click(int interface, int button) {

if (interface==0) {
// if Restore interface

if (button==1) {
// if cancel is pressed

InterfaceOff(0);
// Close interface

else { index=ListBoxGetSelected(0,0);
// else get the selected game

RestoreGameSlot(savegameindex[index]);}
// restore the game
Title: Re:save/load dialog box
Post by: Ishmael on Sun 04/01/2004 12:02:27
function interface_click(int interface, int button) {

if (interface==0) {
// if Restore interface

if (button==1) {
// if cancel is pressed

InterfaceOff(0);
// Close interface

} else { index=ListBoxGetSelected(0,0);
// else get the selected game

RestoreGameSlot(savegameindex[index]);}
// restore the game
Title: Re: save/load dialog box
Post by: Phemar on Fri 21/05/2004 13:05:11

Sorry for bringing this topic back from the dead, but I finally decided to use this in a proper game. I now have this problem. I can't save multiple times. Everytime I save, it just overwrites the current one, even if I specify a different name.

Also, if I want to summon the load/save GUI, do I always have to put in the folowing script, or will "GUIOn (SAVE/LOAD);" work?


  if (keycode==363) {
    CentreGUI (SAVE);
    SetTextBoxText (SAVE, 0, "");
    ListBoxSaveGameList (SAVE, 3);
    index=ListBoxGetNumItems (SAVE,3);
    if (index>19) {
      Display ("You must overwrite a previous saved game.");
      }
    InterfaceOn (SAVE);
    }
  if (keycode==365) {
    CentreGUI (RESTORE);
    ListBoxSaveGameList (RESTORE, 0);
    InterfaceOn (RESTORE);
    }   


without the "if keycode (x) {" stuff.

Any help?
Title: Re: save/load dialog box
Post by: Scorpiorus on Fri 21/05/2004 18:05:31
We need the interface_click()'s code to help you out.

QuoteAlso, if I want to summon the load/save GUI, do I always have to put in the folowing script, or will "GUIOn (SAVE/LOAD);" work?
You have to put it, yes. You can, however, write two functions and put the code there. Then just call these functions when you need the save/load GUI to appear:

function ShowSaveGUI() {
CentreGUI (SAVE);
SetTextBoxText (SAVE, 0, "");
ListBoxSaveGameList (SAVE, 3);
index=ListBoxGetNumItems (SAVE,3);
if (index>19) {
Ã,  Display ("You must overwrite a previous saved game.");
}
InterfaceOn (SAVE);
}

function ShowLoadGUI() {
CentreGUI (RESTORE);
ListBoxSaveGameList (RESTORE, 0);
InterfaceOn (RESTORE);
}


on_key_press:

if (keycode==363) ShowSaveGUI();
if (keycode==365) ShowLoadGUI();