Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Wed 11/05/2011 06:09:10

Title: Delete all saved slots option for player
Post by: barefoot on Wed 11/05/2011 06:09:10
Hi

I searching for the best method to delete all saved slots. Giving the player that option.

I understand someone had made a custom one but i'm a bit dubious about it.

I know about DeleteSaveSlot but does that not do just 1 saved slot?

cheers

barefoot
Title: Re: Delete all saved slots option for player
Post by: Khris on Wed 11/05/2011 11:01:28
Before we reinvent the wheel, could you post the code you already found?
Title: Re: Delete all saved slots option for player
Post by: barefoot on Thu 12/05/2011 06:53:28
Hi Khris

I think it was not quite what i thought it was at first read.. It was a custom save and load so not sure if it does what i was thinking of..

Obviously if the player saves during the game it goes into a saved slot.. if he quits the game he can go back to it later via a saved slot.

Of course that's a great option to have, to continue game that it. I know you can delete them yourself within the game and that's all well and good.

What about if you had a button which says "Delete all saved games'? That way the player would need to begin from the beginning or if someone else was going to play it after them? That would make sense, wouldn't it?

An option to do this within the script is something that would be advantageous.

Something like:

DeleteAllSaveSlot (1);


It's not really a big issue I know, but an added thought..

barefoot


Title: Re: Delete all saved slots option for player
Post by: Gilbert on Thu 12/05/2011 07:51:46
I have a quick text. It seems that it won't break anything if the file is non-existing, so the task is trivial. Just use a loop:

   int ii=998; //999 is for the quick save feature I think. Better not touch it.
   while (ii){
     DeleteSaveSlot(ii);
     ii--;  //The deal with decreasing indices is that the manual says the save game indices will be rearranged after deleting something
   }
Title: Re: Delete all saved slots option for player
Post by: keaponlaffin on Thu 12/05/2011 21:20:47
This might sound like a dumb question but does AGS support for() loops?
Title: Re: Delete all saved slots option for player
Post by: Khris on Thu 12/05/2011 21:21:53
No.
Title: Re: Delete all saved slots option for player
Post by: Gilbert on Fri 13/05/2011 02:24:41
It did, long time ago, but not any more.
Title: Re: Delete all saved slots option for player
Post by: monkey0506 on Fri 13/05/2011 04:07:36
For loops?? We don't need no stinkin' for loops!!

8)
Title: Re: Delete all saved slots option for player
Post by: keaponlaffin on Fri 13/05/2011 04:31:55
Yeah yeah for loops are just glorified while loops. But why remove them if they were already there?
Title: Re: Delete all saved slots option for player
Post by: Gilbert on Fri 13/05/2011 06:18:29
It's not actually as simple as having it "removed" as people may think. More appropriately, it's "not implemented again".

At the beginning, the scripting system of AGS AC was borrowed from some script engine module, which had for loops, and CJ later scraped the original engine and wrote his own one (since AC V1.14 I think, which was more than 10 years ago) that was more flexible and powerful, but the for loops were not implemented yet in the new engine.

There have been requests (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=110) for adding this feature back, but as CJ is always busy and there are always features that are of higher priority this never happens.

Since the engine and editor are now open-sourced, I wonder whether some people would be interested in implementing this in near future.
Title: Re: Delete all saved slots option for player
Post by: keaponlaffin on Fri 13/05/2011 08:49:51
Interesting. Thanks for the info.
Title: Re: Delete all saved slots option for player
Post by: monkey0506 on Fri 13/05/2011 13:46:35
I figured it was something like that, but I didn't show up until I believe AGS 2.6. I think I used the 2.61 betas, but I know I definitely used the 2.62 betas. Also, what happened to 2.63 Beta? And 2.8 Alpha for that matter?

:P