REQUEST EXAMPLES AND TUTORIALS HERE

Examples using Easy Save's API code
xyztankman
Posts: 2
Joined: Mon Jan 24, 2022 4:16 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by xyztankman »

Perfect, that's exactly what I was looking for.

Thanks Joel!
Drandy007
Posts: 3
Joined: Sat Feb 19, 2022 12:40 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Drandy007 »

I'm trying to create a save system using EasySave3. I've got it to save when the variable (ScriptableObject data type) is set in the Inspector but, I need to create an instance of the scriptableobject at runtime, so can't be set in Inspector. It keeps coming up with

ArgumentNullException: Value cannot be null.
Parameter name: s
System.Convert.FromBase64String (System.String s) (at <695d1cc93cca45069c528c15c9fdd749>:0)
ES3Internal.ES3JSONReader.Read_byteArray () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:561)
ES3Types.ES3Type_byteArray.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs:24)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:272)
ES3Types.ES3Type.ReadProperties (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs:155)
ES3Types.ES3ReflectedValueType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs:30)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3Type.ReadProperties (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs:155)
ES3Types.ES3ReflectedScriptableObjectType.ReadScriptableObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs:24)
ES3Types.ES3ScriptableObjectType.ReadObject[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs:69)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:47)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Reader.Read[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:197)
ES3.Load[T] (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:391)
ES3.Load (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:348)
RPG.PlayerSystem.FirstPersonController.RestoreState () (at Assets/Project(Saving)/Scripts/Player/FirstPersonController.cs:64)
RPG.SavingSystem.SaveableEntity.RestoreState () (at Assets/Project(Saving)/Scripts/Saving/SaveableEntity.cs:33)
RPG.SavingSystem.SaveManager.Load () (at Assets/Project(Saving)/Scripts/Saving/SaveManager.cs:70)
RPG.SavingSystem.SaveManager.Update () (at Assets/Project(Saving)/Scripts/Saving/SaveManager.cs:53)

Is there a way to get it to work?

EDIT: Moved to General Discussion. https://moodkie.com/forum/viewtopic.php?f=13&t=2486
Last edited by Drandy007 on Sun Feb 20, 2022 9:39 pm, edited 1 time in total.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Drandy007 wrote: Sat Feb 19, 2022 12:46 am I'm trying to create a save system using EasySave3. I've got it to save when the variable (ScriptableObject data type) is set in the Inspector but, I need to create an instance of the scriptableobject at runtime, so can't be set in Inspector. It keeps coming up with

ArgumentNullException: Value cannot be null.
Parameter name: s
System.Convert.FromBase64String (System.String s) (at <695d1cc93cca45069c528c15c9fdd749>:0)
ES3Internal.ES3JSONReader.Read_byteArray () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:561)
ES3Types.ES3Type_byteArray.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Primitive Types/ES3Type_byteArray.cs:24)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:272)
ES3Types.ES3Type.ReadProperties (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs:155)
ES3Types.ES3ReflectedValueType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedValueType.cs:30)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Types.ES3Type.ReadProperties (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3Type.cs:155)
ES3Types.ES3ReflectedScriptableObjectType.ReadScriptableObject[T] (ES3Reader reader, System.Object obj) (at Assets/Plugins/Easy Save 3/Scripts/Types/Reflected Types/ES3ReflectedScriptableObjectType.cs:24)
ES3Types.ES3ScriptableObjectType.ReadObject[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ScriptableObjectType.cs:69)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:54)
ES3Types.ES3ObjectType.Read[T] (ES3Reader reader) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3ObjectType.cs:47)
ES3Reader.ReadObject[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:249)
ES3Reader.Read[T] (ES3Types.ES3Type type) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:278)
ES3Reader.Read[T] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:197)
ES3.Load[T] (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:391)
ES3.Load (System.String key, ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:348)
RPG.PlayerSystem.FirstPersonController.RestoreState () (at Assets/Project(Saving)/Scripts/Player/FirstPersonController.cs:64)
RPG.SavingSystem.SaveableEntity.RestoreState () (at Assets/Project(Saving)/Scripts/Saving/SaveableEntity.cs:33)
RPG.SavingSystem.SaveManager.Load () (at Assets/Project(Saving)/Scripts/Saving/SaveManager.cs:70)
RPG.SavingSystem.SaveManager.Update () (at Assets/Project(Saving)/Scripts/Saving/SaveManager.cs:53)

Is there a way to get it to work?
Hi there,

As this thread is for requesting examples, please could you create a thread in General Discussion about your issue providing as much detail as possible on how you’re saving and loading your data, and the types of data you’re saving.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Besticle
Posts: 1
Joined: Wed Mar 02, 2022 11:29 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Besticle »

Hi there!

I'm using dictionaries with FixedString32Bytes types (Unity.Collections.FixedString32Bytes). Is it possible to make a custom ES3Type, which handles FixedStrings as regular strings when saving?

In ES3Type i'm using the "writer.Write(instance.ToString());" command, which technically works but in the JSON it creates { } brackets around the string. I would like to get rid of these brackets. Though the brackets are just a small inconvenience, they still annoy me more than it should :lol:

Cheers!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Hi there, and thanks for getting in contact.

You would need to convert your class to a string outside of the ES3Type and save that. The ES3Type will always save it as an object rather than a raw string because the type you are saving is non-primitive.

As this thread is for example requests, if you require further assistance on this issue please could you create a new post in the General Discussion forum.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Chadedala
Posts: 4
Joined: Fri Aug 28, 2020 7:38 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Chadedala »

Hello Joel.
Fist thanks for the Help in the Past.

i run into a small Problem, maybe my mind goes in the wrong direction.

i have a public list, ,from a GameObject (scriptableObject - Inventory Item).
So good so far.

I want to save that list, but:
i use "LoadInto / saveInto"

now the Problem is - the Objects do not come up in my LIst only the Entrys, but all GameObjects are empty.

now : i think EasySave can not handle this in this way.
Any Idea i can reach the Point, to save my Items in a List ?
( Maybe i can define one Scriptable Object for, or something )

i have searched here a while, but found nothing to my Problem.

best Greetings.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Chadedala wrote: Wed Mar 02, 2022 10:16 pm Hello Joel.
Fist thanks for the Help in the Past.

i run into a small Problem, maybe my mind goes in the wrong direction.

i have a public list, ,from a GameObject (scriptableObject - Inventory Item).
So good so far.

I want to save that list, but:
i use "LoadInto / saveInto"

now the Problem is - the Objects do not come up in my LIst only the Entrys, but all GameObjects are empty.

now : i think EasySave can not handle this in this way.
Any Idea i can reach the Point, to save my Items in a List ?
( Maybe i can define one Scriptable Object for, or something )

i have searched here a while, but found nothing to my Problem.

best Greetings.
Hi there,

As this section is for example requests rather than issues please could you create a new thread in General Discussion, also providing samples of the code you’re currently using and the data you’re trying to save.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Chadedala
Posts: 4
Joined: Fri Aug 28, 2020 7:38 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Chadedala »

Hello Joel, i wrote you a PM, to explain it so good as possible.

best Greetings, and thank you.
DylanAron
Posts: 3
Joined: Thu Apr 21, 2022 10:38 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by DylanAron »

Hi are there any examples to autosaving Scriptable Objects?

I am trying to autosave multiple scriptable objects, and I am not sure how to go about this
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Hi there,

By autosaving do you mean using our Auto Save functionality? Auto Save is intended for GameObjects and their Components, so you would need to use code.

Using code, ScriptableObjects are saved and loaded like any other object. I.e. ES3.Save to save them, and ES3.Load to load them. There is an example of this here:

https://moodkie.com/forum/viewtopic.php?f=16&t=1889

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