How to work with multiple save slots?

Discussion and help for Easy Save 3
Post Reply
funtomata
Posts: 26
Joined: Tue Feb 23, 2021 4:25 pm

How to work with multiple save slots?

Post by funtomata »

Hi,
if I understand correctly, if I want to work with multiple save slots, I have to use settings.

My understanding is that for the ES3 class I can either Load things using a specific settings instance

Code: Select all

myValue = ES3.Load("myKey", mySettings, defaultValue);
Now if I wanted to just change the target folder, I guess could also just modify the defaultSettings at runtime.
Correct me if I'm wrong, but I expect this will save the data into a SaveSlot1 folder relative to the default Location

Code: Select all

ES3Settings.defaultSettings.path = "SaveSlot1";
//and then later, not have to worry about specifying the settings I want to use
        myValue = ES3.Load("myKey", defaultValue);
I also see there's a property of ES3Settings which is this one:

Code: Select all

ES3Settings.pathToEasySaveFolder = "SaveSlot1";
Though I suspect this would actually be the full path, considering the location etc, so I imagine the above code wouldn't work.

One thing that is not clear at all though, is how this would work for autosave, as there's 0 documentation on the AutoSave API
ES3AutoSaveMgr seems to be some sort of singleton, but it has one public field and two properties: _current, Current and Instance so not sure which one I should be using.

I expect the following code is how you change the save slot with auto save

Code: Select all

ES3AutoSaveMgr.Instance.settings.path = "SaveSlot1";
My concern is that simply changing this at runtime may not be the right way, but I can only play a guessing game

Does this look right?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: How to work with multiple save slots?

Post by Joel »

Hi there,

You do not need to use settings to do this. You simply need to specify a different filename/path as the filePath parameter of the Easy Save methods.

Regarding doing this with Auto Save, there is a section documenting this in the Auto Save guide:
https://docs.moodkie.com/easy-save-3/es ... -from-code

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
funtomata
Posts: 26
Joined: Tue Feb 23, 2021 4:25 pm

Re: How to work with multiple save slots?

Post by funtomata »

Thanks,
followup question: in the autosave doc it is said that it's better to set the "Save Event" to "none" when calling ES3AutoSaveMgr.Current.Save via code. Does this mean I should avoid calling Save via code in OnApplicationQuit and OnApplicationLoad?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: How to work with multiple save slots?

Post by Joel »

Hi there,

We advise that you set the Save Event to none because otherwise you'll risk calling the Save function twice unnecessarily.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
funtomata
Posts: 26
Joined: Tue Feb 23, 2021 4:25 pm

Re: How to work with multiple save slots?

Post by funtomata »

Ok so as long as I know what I'm doing, I can let the autosave to "OnApplicationQuit" and still save at other times in my code. Great news, thanks.
Post Reply