Page 1 of 1

autsave manger, changing the file path

Posted: Fri Aug 27, 2021 12:39 pm
by seaniboy2009
Hi,

I have been implementing save slots for my game, I change the path for the save manager and the autosave path using below:

public void SetSaveSlotAndLoad(int slot)
{
if (slot == 1)
{
ES3AutoSaveMgr.Instance.settings.path = "SaveFile1/AutoSave1.es3";
ES3Settings.defaultSettings.path = "SaveFile1/SaveSlot1";
}
else if (slot == 2)
{
ES3AutoSaveMgr.Instance.settings.path = "SaveFile2/AutoSave2.es3";
ES3Settings.defaultSettings.path = "SaveFile2/SaveSlot2";
}
else if (slot == 3)
{
ES3AutoSaveMgr.Instance.settings.path = "SaveFile3/AutoSave3.es3";
ES3Settings.defaultSettings.path = "SaveFile3/SaveSlot3";
}

else
{
ES3AutoSaveMgr.Instance.settings.path = "SaveFile1/AutoSave1.es3";
ES3Settings.defaultSettings.path = "SaveFile1/SaveSlot1";
}
}

the ES3Settings.defaultSettings.path = "SaveFile1/SaveSlot1";
this works and stays like that until i change it, but the autosave path goes back to default when i quit/load change scene.

Also when the scene loads because it has been set back to default file path the autosave does not load anything.

Re: autsave manger, changing the file path

Posted: Fri Aug 27, 2021 1:00 pm
by Joel
Hi there,

The Auto Save Manager is specific to the scene, so you would need to change it each time you enter a scene.

All the best,
Joel

Re: autsave manger, changing the file path

Posted: Fri Aug 27, 2021 2:09 pm
by seaniboy2009
Thanks again joel, it is working now, just one more question is the below the best way to see if a file and save exists, or is there a function i can use?

if (ES3Settings.defaultSettings.path == "SaveFile1/SaveSlot1")
{
do something
}

else
{
save does not exist
}

Re: autsave manger, changing the file path

Posted: Fri Aug 27, 2021 2:48 pm
by seaniboy2009
I also noticed its not loading the prefabs that i place in the game once i load the level again.

i set the autosave folder on awake, then i call ES3AutoSaveMgr.Instance.Load();, but non of the prefabs are spawned.

Re: autsave manger, changing the file path

Posted: Fri Aug 27, 2021 3:09 pm
by Joel
Hi there,

You can use ES3.FileExists to check whether a file exists.

Regarding your issue, we've had no reports of this. Please could you replicate this in a new, empty project with a very simple scene using the latest version of Easy Save and private message it to me with step-by-step instructions.

All the best,
Joel