SOLVED: Deleting Auto Saves

Started by steptoe, Mon 20/02/2012 13:01:25

Previous topic - Next topic

steptoe

Hi

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

Code: ags


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{

Code: ags

  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





It's not over until the fat lady sings..

Khris

Not sure if one can do this, just try it:

Code: ags
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.

steptoe

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



It's not over until the fat lady sings..

Khris

So?
Just put my function in the global script and call DeleteAllSaveGames() after the user clicked YES.

steptoe

Cheers Khris

I'll do just that

:=
It's not over until the fat lady sings..

steptoe

#5
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

It's not over until the fat lady sings..

SMF spam blocked by CleanTalk