ES3 AutoSave Missing References

Discussion and help for Easy Save 3
Post Reply
Berncat
Posts: 14
Joined: Tue May 26, 2020 12:28 am

ES3 AutoSave Missing References

Post by Berncat »

Using a fresh install of ES3, I have autosave set up in each of my scenes. I want to autosave a prefab with a script that contains a list of Sprites. In the dropdown for Prefabs under Autosave I've enabled it so it only saves this exact script, and only checkmarked a single boolean as a test. When I exit and re-enter. The prefab is instantiated but all of the sprites in the list are missing references. What is the intended way to save changes to prefabs in runtime. I should mention that these prefabs are instantiated at runtime using ES3AutoSave.Instantiate.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3 AutoSave Missing References

Post by Joel »

Hi there,

If it's only the Sprites which are missing, it suggests that a reference to that specific sprite no longer exists. Firstly I would try right-clicking the Sprite in the Assets folder and selecting "Add Reference to Manager".

If this doesn't resolve the issue, please could you create a new, basic project with a simple scene which replicates this and private message it to me with instructions?

It's likely that the sprite is created or duplicated at runtime, meaning it's not possible to save it by reference (as the reference ID will not exist between loads).

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Berncat
Posts: 14
Joined: Tue May 26, 2020 12:28 am

Re: ES3 AutoSave Missing References

Post by Berncat »

I added the references as you suggested but it did the same thing, at runtime I changed the value of some integers and booleans and all of them were set to 0 or false after loading it in the next time the scene was entered. Any values I hadn't changed remained consistent. And the Sprite elements are all missing despite having not been changed. I feel as if I'm using this incorrectly. These were working as intended on version 3.3.1f9 But after updating to the newest version this is happening.

I tried removing all components to be saved entirely on the prefab via the prefab manager in es3 autosave settings, but the sprites are still missing when it is re-loaded (It says no components will be saved on this game object) These sprites are assigned on the prefab itself, they are not assigned at runtime.


Is there a working demo that includes autosaving components? The example scene only covers the most bare bones prefabs without children/basic scripts.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3 AutoSave Missing References

Post by Joel »

Hi there,

Please could you private message me a new, basic project with a simple scene which replicates this? It's hard for me to tell what is happening from what you've said as we've had no other reports of this, and it appears to be working fine at our end.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Berncat
Posts: 14
Joined: Tue May 26, 2020 12:28 am

Re: ES3 AutoSave Missing References

Post by Berncat »

I've found the problem, this is probably intentional but I figured I'd explain what happened anyway. My Prefab that I was saving was a prefab variant. the master prefab it derived from had es3prefab/autosave components on it. The prefab variant I was trying to save also had these components. When it saved the data of the prefab variant, it was instead saving the default values of the master prefab it derived from instead. And then when it loaded it would load in those values, in this case int 0, and missing sprite references from the master rather than the local component of the script.

To reproduce it you would simply make a prefab and give it es3 prefab/autosave components. Make a variant and give it different values on a simple test script, and the values on the master prefab are saved instead.

My solution was to exclude ES3 scripts from the master prefab and instead do it separately on each variant.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3 AutoSave Missing References

Post by Joel »

Hi there,

This is intended behaviour as by creating a variant, you're indicating that you also want the ES3Prefab and ES3AutoSave to be the same (which means it will use the same reference ID). If you want it to refer to the variant but still use ES3Prefab/Auto Save with the master, you can simply remove the Components from the variants and re-add them.

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