All new custom save/load problems 2/7/04 SOLVED!

Started by Sam., Wed 30/06/2004 21:25:55

Previous topic - Next topic

Sam.

okay. I have my script which is working, to an extent. Both of my save and load boxes work fine, BUT:
MY restopre box works backwards. If you choose to load the first game, it loads the last. And if you choose to load the last game, it loads the first and so on. My script is below, any answers?

if (interface==6) {
Ã,  Ã, 
SetMouseCursor(0);
Ã,  Ã, if (button==2) {
Ã,  Ã,  Ã,  // if save is pressed
Ã,  Ã,  Ã,  // Count saved games
Ã,  Ã,  Ã,  index=ListBoxGetNumItems(6,3); // Count saved games
Ã,  Ã,  Ã,  if (index<20) {
Ã,  Ã,  Ã,  Ã,  Ã, GetTextBoxText(6,0,text); // Get the typed text
Ã,  Ã,  Ã,  Ã,  Ã, GUIOff (6);
Ã,  Ã,  Ã,  Ã,  Ã, SaveGameSlot(index,text); // Save game (text as description)
Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  else { // if saved games are 20
Ã,  Ã,  Ã,  Ã,  Ã, index=ListBoxGetSelected(6,3); // Get the selected save game
Ã,  Ã,  Ã,  Ã,  Ã, GetTextBoxText(6,0,text); // Get the typed text
Ã,  Ã,  Ã,  Ã,  Ã, 
Ã,  Ã,  Ã,  Ã,  Ã, SaveGameSlot(savegameindex[index],text); // Overwrite the selected game
Ã,  Ã,  Ã,  }
Ã,  Ã, }

Ã,  Ã, if (button==4) {
Ã,  Ã,  Ã,  SetMouseCursor(0);
Ã,  Ã,  Ã,  GUIOff (6);
Ã,  Ã,  Ã,  game.text_shadow_color = 4;
Ã,  Ã, }

}
if (interface == 7) {

if (button == 1) {
RestoreGameSlot(savegameindex[index]);
Ã,  SetCursorMode(0);
GUIOff(7);
Ã,  Ã,  game.text_shadow_color = 4;
Ã,  Ã,  }
Ã,  else if (button == 2) {
Ã,  Ã,  SetCursorMode(0);
Ã,  Ã,  Ã, GUIOff(7);
Ã,  Ã,  }
Ã,  }
Bye bye thankyou I love you.

Lazy Z

#1
You can find a tutorial at http://atticwindow.adventuredevelopers.com just go to the tutorials section.

That tutorial is missing some bits, so for help check these threads:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14684.0
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=11790.0
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=11515.0
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=10095.0

And there's another thread, which deals with the Save/Load GUI found in the BlueGUI, but I can't find it right now... BlueGUI can be found here: http://www.gaia-spa.com/blusoft/Download/download.html
'Twas brillig, and the slithy toves did gyre and gimble in the wabe. All mimsy were the borogroves and the mome raths outgrabe.'

Top-5 Games

Sam.

Bye bye thankyou I love you.

Pumaman

are you sure you're doing ListBoxSaveGameList when you turn the GUI on?

Sam.

Bye bye thankyou I love you.

Sam.

okay. I have my script which is working, to an extent. Both of my save and load boxes work fine, BUT:
MY restopre box works backwards. If you choose to load the first game, it loads the last. And if you choose to load the last game, it loads the first and so on. My script is below, any answers?

if (interface==6) {
   
SetMouseCursor(0);
   if (button==2) {
      // if save is pressed
      // Count saved games
      index=ListBoxGetNumItems(6,3); // Count saved games
      if (index<20) {
         GetTextBoxText(6,0,text); // Get the typed text
         GUIOff (6);
         SaveGameSlot(index,text); // Save game (text as description)
         
      }
      else { // if saved games are 20
         index=ListBoxGetSelected(6,3); // Get the selected save game
         GetTextBoxText(6,0,text); // Get the typed text
         
         SaveGameSlot(savegameindex[index],text); // Overwrite the selected game
      }
   }

   if (button==4) {
      SetMouseCursor(0);
      GUIOff (6);
      game.text_shadow_color = 4;
   }

}
if (interface == 7) {

if (button == 1) {
RestoreGameSlot(savegameindex[index]);
  SetCursorMode(0);
GUIOff(7);
    game.text_shadow_color = 4;
    }
  else if (button == 2) {
    SetCursorMode(0);
     GUIOff(7);
    }
  }
Bye bye thankyou I love you.

Pumaman

looks like you're missing:

index = ListBoxGetSelected(7, XXX);

before RestoreGameSlot (where XXX is the object number of the list control).

Sam.

Bye bye thankyou I love you.

SMF spam blocked by CleanTalk