Save complete scene state with a name

Discussion and help for Easy Save 3
landixus
Posts: 12
Joined: Mon Nov 29, 2021 4:08 pm

Save complete scene state with a name

Post by landixus »

Hi,
i like to save the complete scene with a name, for example workout1, workout2, workout3.... so that the user can choose which state
to use.
I create an interval app, where i add childs with different values to a parent GameObject:
https://youtu.be/ByHDpDFAEfM

I have no idea how to do this with easy save 3 (MayBe it is to easy?)
The project have only the stuff on the video and is really small.
So i think it makes sense to save all to a file.
Any suggestions, or example?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save complete scene state with a name

Post by Joel »

Hi there,

Saving the entire state of a scene is impossible as much of a scene is not serializable at runtime due to limitations at Unity's end.

For more information on what is serializable, please see the Supported Types guide:
https://docs.moodkie.com/easy-save-3/es ... ted-types/

For information on how you might incorporate Easy Save into your project, please see the guides:
https://docs.moodkie.com/product/easy-s ... s3-guides/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
landixus
Posts: 12
Joined: Mon Nov 29, 2021 4:08 pm

Re: Save complete scene state with a name

Post by landixus »

Ah Ok,

so i mark only my Timer (GameObject) and add ES3 Prefab and ES3 AutoSave and mark all items.
then i create 2 buttons for save and load.
Then i start the App and add my intervals like in my video.
When i have added all i call the save

and add then start my App and add all my interval child objects.

the both function for the button is then:

Code: Select all

 public void save()
    {
       // To save
        ES3AutoSaveMgr.Current.Save();
    }
    public void load() 
    {
        // To load
        ES3AutoSaveMgr.Current.Load();
    }
correct?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save complete scene state with a name

Post by Joel »

Hi there,

You should not manually add an ES3Prefab and ES3AutoSave Component and should instead follow the instructions in the Auto Save guide. Other than that, what you've described sounds correct, though I am unsure what you are describing here:
and add then start my App and add all my interval child objects.
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
landixus
Posts: 12
Joined: Mon Nov 29, 2021 4:08 pm

Re: Save complete scene state with a name

Post by landixus »

Joel wrote: Mon Nov 29, 2021 6:44 pm Hi there,

You should not manually add an ES3Prefab and ES3AutoSave Component and should instead follow the instructions in the Auto Save guide. Other than that, what you've described sounds correct, though I am unsure what you are describing here:
I try tomorrow :)
then start my App and add all my interval child objects.
its late here :)
i report back when i have tried a bit more.
landixus
Posts: 12
Joined: Mon Nov 29, 2021 4:08 pm

Re: Save complete scene state with a name

Post by landixus »

Looks like it works.

But what means "RectTransform is being set with parent property. Consider using the SetParent methos instead, with the worlPositionStays argument set to false"?

I dont find this options
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save complete scene state with a name

Post by Joel »

Hi there,

This doesn’t sound like an error thrown from Easy Save. Please could you paste the complete error message with line numbers.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
landixus
Posts: 12
Joined: Mon Nov 29, 2021 4:08 pm

Re: Save complete scene state with a name

Post by landixus »

Code: Select all

Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
UnityEngine.Transform:set_parent (UnityEngine.Transform)
ES3Types.ES3UserType_RectTransform:ReadComponent<UnityEngine.Component> (ES3Reader,object) (at Assets/Easy Save 3/Types/ES3UserType_RectTransform.cs:67)
ES3Types.ES3ComponentType:ReadUnityObject<UnityEngine.Component> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ComponentType.cs:36)
ES3Types.ES3UnityObjectType:ReadObject<UnityEngine.Component> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3UnityObjectType.cs:65)
ES3Types.ES3ObjectType:ReadInto<UnityEngine.Component> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadComponents (ES3Reader,UnityEngine.GameObject) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:216)
ES3Types.ES3Type_GameObject:ReadObject<object> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:167)
ES3Types.ES3ObjectType:ReadInto<object> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject<object> (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:131)
ES3Types.ES3ObjectType:Read<object> (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection<object> (ES3Reader,System.Collections.Generic.ICollection`1<object>,ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read<UnityEngine.GameObject[]> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3Reader:Read<UnityEngine.GameObject[]> () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:126)
ES3Types.ES3Type_GameObject:ReadObject<object> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:164)
ES3Types.ES3ObjectType:ReadInto<object> (ES3Reader,object) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:77)
ES3Types.ES3Type_GameObject:ReadObject<object> (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_GameObject.cs:131)
ES3Types.ES3ObjectType:Read<object> (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Reader:ReadObject<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader:Read<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3CollectionType:ReadICollection<object> (ES3Reader,System.Collections.Generic.ICollection`1<object>,ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3CollectionType.cs:52)
ES3Types.ES3ArrayType:Read (ES3Reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Collection Types/ES3ArrayType.cs:36)
ES3Reader:Read<object> (ES3Types.ES3Type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:274)
ES3:Deserialize (ES3Types.ES3Type,byte[],ES3Settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:799)
ES3:Deserialize<UnityEngine.GameObject[]> (byte[],ES3Settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:788)
ES3File:Load<UnityEngine.GameObject[]> (string,UnityEngine.GameObject[]) (at Assets/Plugins/Easy Save 3/Scripts/ES3File.cs:246)
ES3:Load<UnityEngine.GameObject[]> (string,UnityEngine.GameObject[],ES3Settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:433)
ES3AutoSaveMgr:Load () (at Assets/Plugins/Easy Save 3/Scripts/Auto Save/ES3AutoSaveMgr.cs:85)
SaveLoad:load () (at Assets/Scripts/SaveLoad.cs:28)
UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:385)
BTW, can i save with the

Code: Select all

public void save()
    {
        ES3AutoSaveMgr.Current.Save();
       
    }
also different save names, and the user can choose to load what file?
So far, is all working for me, but for a workout it could be a good idea to save and load more than one :)
An exxample would be great.
Thanks for support so far.

Unity 2020.3.22f1
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save complete scene state with a name

Post by Joel »

Hi there,

The issue is that you’ve tried to add support for RectTransform in the types window but support is built in. If you delete the ES3UserType_RectTransform file in /Easy Save 3/Types/ folder this should resolve your issue.

Regarding your question, there’s information on setting the file name at the very bottom of the Auto Save guide.

https://docs.moodkie.com/easy-save-3/es ... hout-code/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
landixus
Posts: 12
Joined: Mon Nov 29, 2021 4:08 pm

Re: Save complete scene state with a name

Post by landixus »

Joel wrote: Tue Nov 30, 2021 11:58 am Regarding your question, there’s information on setting the file name at the very bottom of the Auto Save guide.
https://docs.moodkie.com/easy-save-3/es ... hout-code/
All the best,
Joel
Ah thats help a lot!!!!1 :)
Many Thanks!
Post Reply