AutoSave load chosen value

Discussion and help for Easy Save 3, The Complete Save Game & Data Serializer System for the Unity Engine
Post Reply
Yazou
Posts: 8
Joined: Mon Jan 06, 2025 11:21 pm

AutoSave load chosen value

Post by Yazou »

Hello Is it possible to load a value after using autosave? In the documentation in Autosave it doesn't mention it.
I can use save with code in addition to auto save , on 2 locationbut it's not great.
What I would like to do is simply retrieve a value saved during the game so that in the main menu scene in order to unlock chapters.
User avatar
Joel
Moodkie Staff
Posts: 5069
Joined: Wed Nov 07, 2012 10:32 pm

Re: AutoSave load chosen value

Post by Joel »

Hi there,

I'm not fully sure I understand what you mean. However, I will assume that you mean loading a specific variable.

Auto Save is for saving GameObjects and their supported Components and loading them in the same scene they were saved. If you want to save specific values and load them in a different scene then you would need to do this with code as you've suggested.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Yazou
Posts: 8
Joined: Mon Jan 06, 2025 11:21 pm

Re: AutoSave load chosen value

Post by Yazou »

So thank you if our game has several scenes, we need several save locations to know which scene to launch from the main menu of the game if we use Auto Save. 1 location for the auto save and 1 other location for the save by code in which there is the scene that needs to be loaded.

If the game has a single scene ES3.FileExists(saveFileName) will be enough.
User avatar
Joel
Moodkie Staff
Posts: 5069
Joined: Wed Nov 07, 2012 10:32 pm

Re: AutoSave load chosen value

Post by Joel »

Hi there,

You can save your ES3.Save data in the same file as your Auto Save data if you prefer. You just need to ensure that you've set the Location to Cache in Tools > Easy Save 3 > Settings (as Auto Save stores to the Cache by default).

Then to save using code you would simply do ...

Code: Select all

ES3.Save("sceneName", SceneManager.GetActiveScene().name);
... without specifying a filename. This stores the data to the default file (the same place that Auto Save stores its data).

And then to load it:

Code: Select all

if(ES3.FileExists())
	SceneManager.LoadScene( ES3.Load<string>("sceneName") );
Also note that data saved using ES3.Save isn't scene specific, so you can load it from any scene.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Yazou
Posts: 8
Joined: Mon Jan 06, 2025 11:21 pm

Re: AutoSave load chosen value

Post by Yazou »

it's great thank you for these clarifications.
Post Reply