Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mugs on Tue 20/12/2005 00:47:27

Title: Most recent save/slot won't restore (SOLVED)
Post by: Mugs on Tue 20/12/2005 00:47:27
I made my own GUI to load and save games.Ã,  I'm having this problem with the load part.Ã,  It works, but it won't restore the most recent slot.Ã,  It tells me that there's no such file when I try to load it.Ã,  All the other slots restore without a problem, and if I make a new save slot, the slot that didn't work before, works, but then the newest one doesn't. What's going on?

This is the script used:


RestoreGameSlot (ExampleList.SelectedIndex);
Title: Re: Most recent save/slot won't restore
Post by: Ashen on Tue 20/12/2005 01:06:44
Quick guess, not sure if it's right:

ExampleList.SelectedIndex can go down to 0 (assuming there's anything selected at all), where 0 is the top item. The save games (I think) start from slot 1 - if you try to restore slot 0, you'll get an error. If you're using the built-in save array (i.e. you use ListBox.FillSaveGameList() to get your savegames) try this:

RestoreGameSlot (savegameindex[ExampleList.SelectedIndex]);

That said, I'm not sure why the other games would load OK - it should load the game from the slot above the selected index (you select the second game, it restores the top one, select the third it restores the second, etc).
Title: Re: Most recent save/slot won't restore
Post by: Mugs on Tue 20/12/2005 01:14:51
Thanks!