Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Dualnames on Mon 09/03/2009 16:21:40

Title: Excluding certain savegames after FillDirSaveGameList is called (Suggestion)
Post by: Dualnames on Mon 09/03/2009 16:21:40
I'm having types of save games handled by my game for certain occasions, that I don't want them to appear in the savegame list.

One of them is:
Name:
"System-RestartPoint"
Slot:
52

I use function FillSaveListDir, to fill a list with savegames. How to exclude for example System restart point from appearing? I'm using AGS 3.1.2. If I forgot something really important, I apologize.
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: thezombiecow on Mon 09/03/2009 17:32:20
I might be missing something in your original post here, but if your system restore is always guaranteed being saved to slot 52, can you call:

yourSaveList.RemoveItem(52);

... immediately after filling the list?

??

EDIT: as I understand it, RemoveItem() doesn't delete any files, it simply removes it from a list...
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: GarageGothic on Mon 09/03/2009 17:53:30
"FillSaveListDir"? Do you mean FillSaveGameList? Anyway, what works for me is to simply use high numbers for those special savegame slots (I use 100+, but actually I thought anything above 50 should be safe which doesn't seem to be the case). These shouldn't show up when filling the list. I wouldn't recommend removing entries manually as I think this could mess up the SelectedIndex references.
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: Trent R on Mon 09/03/2009 21:37:23
If he doesn't have SelectedIndex stored anywhere, he can set it to -1 after the RemoveItem call.


~Trent
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: Pumaman on Tue 10/03/2009 00:14:18
Save game slot numbers above 100 will not be shown by FillSaveGameList, so use a slot number in the range 101-900 instead.
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: Dualnames on Tue 10/03/2009 09:25:46
Quote from: GarageGothic on Mon 09/03/2009 17:53:30
"FillSaveListDir"? Do you mean FillSaveGameList? Anyway, what works for me is to simply use high numbers for those special savegame slots (I use 100+, but actually I thought anything above 50 should be safe which doesn't seem to be the case). These shouldn't show up when filling the list. I wouldn't recommend removing entries manually as I think this could mess up the SelectedIndex references.

It does cause a mess. I guess CJ gave the best answer...thanks a lot, once again.
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: GarageGothic on Tue 10/03/2009 11:48:02
Not sure CJ will check this thread again. But actually, what would be great would be  if you could supply FillSaveGameList with an optional range parameter. That way you could for instance use FillSaveGameList(40) for your save game menu but FillSaveGameList(50) for your restore game menu so it would also display special savegames like autosave and quicksave (correctly ordered by save time) without risking the player overwriting them.
Title: Re: Excluding certain savegames after FillDirSaveGameList is called.
Post by: Dualnames on Tue 10/03/2009 12:14:31
Quote from: GarageGothic on Tue 10/03/2009 11:48:02
Not sure CJ will check this thread again. But actually, what would be great would be  if you could supply FillSaveGameList with an optional range parameter. That way you could for instance use FillSaveGameList(40) for your save game menu but FillSaveGameList(50) for your restore game menu so it would also display special savegames like autosave and quicksave (correctly ordered by save time) without risking the player overwriting them.

Nice one there, I was thinking of a function similar to that, but well, yours appears to be really easy to use as well.