Getting ES3 Auto Save to work

Discussion and help for Easy Save 3
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Getting ES3 Auto Save to work

Post by Joel »

Hi there,

Auto Save works synchronously, so it works immediately. For example:

Code: Select all

// Data isn't saved at this point.
ES3AutoSaveMgr.Current.Save();
// Data is now saved.
 
// Data isn't loaded at this point.
ES3AutoSaveMgr.Current.Load();
// Data is now loaded.
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yimingt
Posts: 21
Joined: Fri Apr 30, 2021 3:07 am

Re: Getting ES3 Auto Save to work

Post by yimingt »

Reference with ID 1073397176277201534 could not be found in Easy Save's reference manager. If you are loading objects dynamically (i.e. objects created at runtime), this warning is expected and can be ignored.
I'm getting this warning when loading a save. I understand that this is supposed to happen if the object was created during runtime. The problem is 1 of my list was storing a reference to that object and is now coming up null after loading causing an error when running one of its methods.

Do I have to change the list to store values instead of references? What is the cause of this happening?

I have also noticed that references that are loaded would not be the same references as before. I had 3 objects. 2 of them would get a reference to a variable from Object1. After loading, the variable of the 2 objects don't seem to be a reference to Object1 rather they are new instances of the data.

Is there a way to change it? Maybe something in the ES3Type Script or would I have to reassign the references when loading?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Getting ES3 Auto Save to work

Post by Joel »

Hi there,

It's not possible to tell for certain from what you've said, but it sounds like the reference is loaded after the list. In this case you would need to load twice: once to load the reference, and once to load the list item.
I have also noticed that references that are loaded would not be the same references as before. I had 3 objects. 2 of them would get a reference to a variable from Object1. After loading, the variable of the 2 objects don't seem to be a reference to Object1 rather they are new instances of the data.
I've not seen this happen before with Auto Save. Please could you replicate this in a new, empty project with a very simple scene and private message it to me with instructions?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yimingt
Posts: 21
Joined: Fri Apr 30, 2021 3:07 am

Re: Getting ES3 Auto Save to work

Post by yimingt »

Hey Joel,

What is the purpose of the "Save Children" option in the ES3AutoSave? So far I have noticed that if it's not enabled, objects that were instantiated and placed under the parent won't be placed under the same parent after loading. Am I right in assuming that the "Save Children" option is to allow instantiated objects to be saved under a parent and when loaded would be placed under that parent?
yimingt
Posts: 21
Joined: Fri Apr 30, 2021 3:07 am

Re: Getting ES3 Auto Save to work

Post by yimingt »

On another note. How does EasySave handle the destruction of default scene objects? The way I understand how it works right now, is that objects and data from the save file are loaded after the scene is loaded. So the scene is loaded like its default form and then the data from the save file is added on top so newly created objects / value changes are brought in later.

Capture.JPG
Capture.JPG (13.95 KiB) Viewed 2838 times
(Default scene setup)


So right now, I'm trying to the Cube object that would be in the scene by default but it keeps coming back when I reload the save file. I'm guessing it's because the save file doesn't have any data that the object was destroyed thus it keeps coming back. If so, then how would we destroy default scene objects and make sure they stay destroyed when reloading?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Getting ES3 Auto Save to work

Post by Joel »

Hi there,

The Save Children option overrides the Auto Save settings and saves all children of the GameObject.

Regarding destruction of objects, Auto Save does not handle this as it's only intended for saving variables on the GameObject and it's Components.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yimingt
Posts: 21
Joined: Fri Apr 30, 2021 3:07 am

Re: Getting ES3 Auto Save to work

Post by yimingt »

Sorry I still don't quite understand what you mean by "override the Auto Save settings". So when it saves all children of the GameObject, would that include all the components of the children?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Getting ES3 Auto Save to work

Post by Joel »

Hi there,

If you select it then it will revert to the default behaviour when calling ES3.Save<GameObject>, which is described here:
https://docs.moodkie.com/easy-save-3/es ... s-prefabs/

Note that as previously mentioned, it is only recommended to interact with Auto Save using the Auto Save window, and directly modifying the Auto Save Component is likely to lead to unexpected behaviour.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
yimingt
Posts: 21
Joined: Fri Apr 30, 2021 3:07 am

Re: Getting ES3 Auto Save to work

Post by yimingt »

Hey Joel,

It's been awhile. Hope you've been doing well.

Today I got a question for the selection of data to save for the AutoSave ES3Type. In the case of inherited data, do I select to save the data from the base script or the child script?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Getting ES3 Auto Save to work

Post by Joel »

Hi there,

You would select it from the child script.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply