save/load dialog box

Started by Phemar, Thu 01/01/2004 19:12:39

Previous topic - Next topic

Phemar

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!

Scorpiorus


Phemar

#2
Thanks, I did all that, but now it says "Parse error at index"

???



Ishmael

You forgot the "int index;" from the start of the global script..?
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.

Phemar

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

Ishmael

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

Phemar


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?

Scorpiorus

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();

SMF spam blocked by CleanTalk