REQUEST EXAMPLES AND TUTORIALS HERE

Examples using Easy Save's API code
User avatar
Joel
Moodkie Staff
Posts: 4362
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Hi there,

Just to clarify, collections such as arrays and Lists are saved and loaded in the same way as any other data. See the Saving and Loading Collections section of the Getting Started guide.

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

dragon
Posts: 2
Joined: Fri Nov 18, 2022 1:50 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by dragon »

Greetings,

I would like to see an example of ES3 using scriptable objects. (And preferably a SO contained in a SO, like an item and container)

User avatar
Joel
Moodkie Staff
Posts: 4362
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.

ScriptableObjects are saved in the same way as any other data (see the Getting Started guide: https://docs.moodkie.com/easy-save-3/getting-started/).

Is there anything in particular you are struggling with, or which is not working for you?

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

dragon
Posts: 2
Joined: Fri Nov 18, 2022 1:50 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by dragon »

Joel wrote:
Fri Nov 18, 2022 2:09 pm
Is there anything in particular you are struggling with, or which is not working for you?
Thanks for the fast reply, in regards to that it's taking a lot of things that I have some experience with and putting them all in one basket. I mostly understand your random prefab demo. However I'm not sure how to gracefully put all the information from a SO object into a list also I'm not really familiar with the "var" declaration and it looks some sort of magic atm. Google results are giving me mixed results.
This line in particular (well 2 lines combined into 1)
var prefabInstance = Instantiate(prefabs[Random.Range(0, prefabs.Length)], Random.insideUnitSphere * 5, Random.rotation);

It seems var is doing a hell of a lot of stuff here, let's say I get it. But, I don't need to Instantiate my SOs, so would I just make something like a populate container function and hold it in a var and add it to the list? Something like
AddScriptableObjectToContainer(name,type,whateverA,whateverB,whateverC);
In this case my list won't be a game object or even a scriptable object though, so I'm not sure it would work.

Well, Hopefully I've properly demonstrated my confusion. :lol:
regards.

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

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Hi there,
dragon wrote:
Sat Nov 19, 2022 12:35 pm
I'm not really familiar with the "var" declaration and it looks some sort of magic atm.
'var' is just a way of declaring a variable in C# without having to write the type at the beginning. For example, this:

Code: Select all

var myList = new List<string>();
Is a more readable and maintainable way of writing:

Code: Select all

List<string> myList = new List<string>();
For more information see the C# documentation on 'Implicitly typed local variables', which explains the 'var' keyword:
https://learn.microsoft.com/en-us/dotne ... -variables
so would I just make something like a populate container function and hold it in a var and add it to the list? Something like
AddScriptableObjectToContainer(name,type,whateverA,whateverB,whateverC);
In this case my list won't be a game object or even a scriptable object though, so I'm not sure it would work.
I'm not sure what you mean by this. You don't need to add an object to a container to save it, if that's what you mean; you can save and load the ScriptableObject directly. For example, if you have a ScriptableObject that you want to save, you would save it using:

Code: Select all

ES3.Save("myScriptableObject", myScriptableObject);
And then load it into an existing instance:

Code: Select all

ES3.LoadInto<YourScriptableObjectType>("myScriptableObject", myScriptableObject);
Or to load it as a new instance if the same instance doesn't already exist:

Code: Select all

var myScriptableObject = ES3.Load<YourScriptableObjectType>("myScriptableObject");
If you have multiple ScriptableObjects of the same type that you want to save at the same time, you'd simply put them into a List or array and save it in the same way as saving a single ScriptableObject:

Code: Select all

// Saving a List of ScriptableObjects
ES3.Save("listOfScriptableObjects", listOfScriptableObjects);

Code: Select all

// Loading a List of ScriptableObjects
var listOfScriptableObjects = ES3.Load<List<YourScriptableObjectType>>("listOfScriptableObjects");
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started

patrickn
Posts: 1
Joined: Sat Nov 26, 2022 3:01 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by patrickn »

Are there any step by step video tutorials?

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

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Hi there,

We’re currently in the process of making a tutorial video which shows how you would integrate Easy Save into one of the sample projects which we’re hoping will be available in the next couple of weeks (we have studio time books in to record the narration next week).

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

Post Reply