autsave manger, changing the file path

Discussion and help for Easy Save 3
Post Reply
seaniboy2009
Posts: 13
Joined: Thu Sep 17, 2020 9:55 am

autsave manger, changing the file path

Post 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.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: autsave manger, changing the file path

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
seaniboy2009
Posts: 13
Joined: Thu Sep 17, 2020 9:55 am

Re: autsave manger, changing the file path

Post 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
}
seaniboy2009
Posts: 13
Joined: Thu Sep 17, 2020 9:55 am

Re: autsave manger, changing the file path

Post 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.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: autsave manger, changing the file path

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply