Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on 23 Mar 2017, 07:10

Title: Deleting Save only under 99
Post by: Slasher on 23 Mar 2017, 07:10
Hi

After completing the game it restores a save slot point (120) to start again...

What i want is to delete only save slots in the list box (under 99) when the game restores save slot 120.

Usually:

Code: Adventure Game Studio
  1. function DeleteAllSaveGames() {
  2.   lb.FillSaveGameList();
  3.   int i;
  4.   while (i < lb.ItemCount) {
  5.     DeleteSaveSlot(lb.SaveGameSlots[i]);
  6.     i++;
  7.   }
  8.   }
  9.  

Title: Re: Deleting Save only under 99
Post by: Crimson Wizard on 23 Mar 2017, 08:08
lb.SaveGameSlots[ i ] stores the number of save slot. So I guess you just need:
Code: Adventure Game Studio
  1. if (lb.SaveGameSlots[i] < 99)
  2.     DeleteSaveSlot(lb.SaveGameSlots[i]);
  3.