Most recent save/slot won't restore (SOLVED)

Started by Mugs, Tue 20/12/2005 00:47:27

Previous topic - Next topic

Mugs

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:

Code: ags

RestoreGameSlot (ExampleList.SelectedIndex);
Cool stuff I found out: Men are four times more likely to be struck by lightning than women.  Wow, really? [dirty joke] Maybe this has to do with the fact that us men have "lightning rods"? [/dirty joke]

Ashen

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:

Code: ags
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).
I know what you're thinking ... Don't think that.

Mugs

Cool stuff I found out: Men are four times more likely to be struck by lightning than women.  Wow, really? [dirty joke] Maybe this has to do with the fact that us men have "lightning rods"? [/dirty joke]

SMF spam blocked by CleanTalk