Easy Save 3 Help Needed (solved)

Discussion and help for Easy Save 3
Post Reply
Johnny Star
Posts: 25
Joined: Sat Mar 21, 2020 2:17 pm

Easy Save 3 Help Needed (solved)

Post by Johnny Star »

Hello! Hope everyone's doing well and healthy!

So apart from local save solution which I'm using this, I got <omitted> for cloud saving (saving to Google Game Services/Game Center) too. I like plugins with the word 'Easy' at the front :lol:

I'm still thinking of how to integrate this. Does anyone have any suggestions?

What I have in mind was, extract data from an ES3.savefile as one long string using System.IO, convert it to byte array and use EMP to store it on the cloud.
Then on fresh installation, once I've gotten the data from the cloud, convert the byte array back to a normal looong string, open an ES3.savefile and using System.IO delete everything on it and replace it with the string.

[Edit01]
What I mentioned above is copy/pasting everything (all data) as a string using System.IO. So I don't think there will be an error in reading it from ES3 functions since I'm not changing any formats/structures. But what if I want to save to cloud just 1 item? How do I format it in a way so that when I download everything back into an ES3.savefile I can read from it normally?
Last edited by Johnny Star on Thu Aug 27, 2020 7:44 am, edited 2 times in total.

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

Re: Easy Save 3 with Easy Mobile Pro Cloud Saving Help Needed

Post by Joel »

Hi there, and thanks for getting in contact.

There's information on integrating with other storage APIs here:
https://docs.moodkie.com/easy-save-3/es ... rage-apis/

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

Johnny Star
Posts: 25
Joined: Sat Mar 21, 2020 2:17 pm

Re: Easy Save 3 Help Needed

Post by Johnny Star »

Thanks for getting back!

I didn't know about this thanks for pointing it out :)
I have a question. I apologies beforehand I'm a bit stupid.

It states:
Saving as a string or byte array
With the code:

Code: Select all

var cacheSettings = new ES3Settings(ES3.Location.Cache);
ES3.Save("transform", this.transform, cacheSettings);
byte[] bytes = ES3.LoadRawBytes(cacheSettings);
Does that mean that if I want to save it as a bytes array, I only have to do this:

Code: Select all

var cacheSettings = new ES3Settings(ES3.Location.Cache);
byte[] bytes = ES3.LoadRawBytes(cacheSettings);
Also, what is the "transform" string supposed to represent? Isn't 'this.tranform' refers to an object's Pos, Rot and Scale?

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

Re: Easy Save 3 Help Needed

Post by Joel »

Hi there,

That is what you need to do to get serialised data as a byte array so that the storage API you're using can save it.

With regards to what the "transform" string represents in the ES3.Save call, this is the key. You can find out more about this in the Getting Started guide:

https://docs.moodkie.com/easy-save-3/getting-started/

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

Johnny Star
Posts: 25
Joined: Sat Mar 21, 2020 2:17 pm

Re: Easy Save 3 Help Needed

Post by Johnny Star »

Oh!
So example what I'm doing now is this to save my coins:

Code: Select all

ES3.Save<int>("collectableGoldCoin", collectableGoldCoin);
But if I want to integrate with a third-party plugin, I have to do this:

Code: Select all

var cacheSettings = new ES3Settings(ES3.Location.Cache);
ES3.Save<int>("collectableGoldCoin", collectableGoldCoin, cacheSettings);
byte[] bytes = ES3.LoadRawBytes(cacheSettings);
// --> Proceed to save the 'bytes' with a third-party plugin.
Am I correct?

[Edit01]
Under Location I don't see Cache. Is it Memory?

Code: Select all

	public enum Location 		{ File, PlayerPrefs, Memory, Resources };
[Edit02]
So I updated. Apparently, Cache was not yet added in my version.
But after updating it, what is this Global Reference thing? I'm backing up my game on source control and eventhough I have not made any changes to my game scene, ES3 seems to be adding/changing some things in my scene? Sorry I'm scared to update things because of this. As idk what is happening under the hood and I'm afraid of my project breaking.

Johnny Star
Posts: 25
Joined: Sat Mar 21, 2020 2:17 pm

Re: Easy Save 3 Help Needed

Post by Johnny Star »

Working great so far for now. Thanks @Joel for the help!

Post Reply