Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: steptoe on Mon 20/02/2012 13:01:25

Title: SOLVED: Deleting Auto Saves
Post by: steptoe on Mon 20/02/2012 13:01:25
Hi

I have an Auto save system that I use which seems to work fine (as per code below (No manual saves))



function room_RepExec()
{
 if (cjonesy.PPCollidesWithO(osave) == 1)
 if (Game.DoOnceOnly("Oasis"))
 {
 Game.DoOnceOnly("Sudan Oasis");
 SaveGameSlot(2, "Sudan Oasis");
 aFlag.Play();
 Display("Auto Saved: Sudan Red Oasis");
 Wait(2);
 object[6].Visible=false;
 }
}



The bugbear is when wanting to Delete all the Auto Saved Slots.

I use as an example{


 DeleteSaveSlot(0);


I have noticed that my Deleted Save Slots list is longer then all the Auto Saves list.

So far I have about 9 Auto Saves yet have to Delete Save Slots up to about 28 for all Auto Saves to all be deleted.

I'm using the standard 1-50 slots.

Dumbfounded and hoping for an answer.

cheers if you can help





Title: Re: Deleting Auto Saves
Post by: Khris on Mon 20/02/2012 18:05:40
Not sure if one can do this, just try it:

function DeleteAllSaveGames() {
  ListBox*lb;
  lb.FillSaveGameList();
  int i;
  while (i < lb.ItemCount) {
    DeleteSaveSlot(lb.SaveGameSlots[i]);
    i++;
  }
}


If the ListBox has to actually be on a GUI, remove the first line inside the function and put a Listbox called "lb" on an invisible GUI.
Title: Re: Deleting Auto Saves
Post by: steptoe on Mon 20/02/2012 18:18:14
Hi Khris

I was thinking along the lines of giving the user the option to delete all saves.

In the Options panel would be a button 'Delete all saves' pressing this button brings up a small Gui confirming. If YES is clicked then all saves would be deleted.

Thanks for your post

steptoe



Title: Re: Deleting Auto Saves
Post by: Khris on Mon 20/02/2012 18:33:48
So?
Just put my function in the global script and call DeleteAllSaveGames() after the user clicked YES.
Title: Re: Deleting Auto Saves
Post by: steptoe on Mon 20/02/2012 18:37:27
Cheers Khris

I'll do just that

:=
Title: Re: Deleting Auto Saves
Post by: steptoe on Tue 21/02/2012 08:52:35
Quote from: Khris on Mon 20/02/2012 18:33:48
So?
Just put my function in the global script and call DeleteAllSaveGames() after the user clicked YES.

Hi Khris,

Scripted and configured it and it works a treat.

Many thanks

steptoe

P.S. Sorry, should have put this in edit last post