REQUEST EXAMPLES AND TUTORIALS HERE

Examples using Easy Save's API code

REQUEST EXAMPLES AND TUTORIALS HERE

Postby Joel » Tue Apr 10, 2018 3:58 pm

Please post any suggestions for examples and tutorials in this thread.

Note that we can only create examples which only help individual people, and should be useful to most people.
Joel @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2626
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby MrLee » Sat Apr 14, 2018 7:17 am

Hey Joel.

I have a suggestion. I know its simple and most of people knows it. But I think most of the beginners feel difficulty to implement in the beginning so simple things must be considered.
My suggestion is in the section of supported type. Just write single line of each type to save and load.
Like as you support DateTime then write.

ES3.Save<DateTime>("Key", gameStopTime);
gameStopTime = ES3.Load<DateTime>("key", gameStopTime);

Plus is there any thread where I can give suggestion to add more fields to save. Like I think TimeSpan is not included yet to save in ES3. Where I can give suggestion for that ?
Thanx,
Regards,
Mr Lee.
MrLee
 
Posts: 4
Joined: Mon Apr 09, 2018 11:16 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby Joel » Sun Apr 15, 2018 10:12 am

Hi there,

Thanks for the suggestion, this is something we will definitely consider. Just to clarify for anyone coming across this, in Easy Save 3 the examples for each supported type are almost identical. i.e.

ES3.Save<YourType>("yourKey", yourData);
yourData = ES3.Load<YourType>("yourKey");


With regards to saving and loading TimeSpans, you can do this by converting it to and from an integer. i.e.

ES3.Save<long>("myTimespan", timespan.Ticks);
timespan = new TimeSpan( ES3.Load<long>("myTimespan") );


All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2626
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby Hodofca » Mon Apr 23, 2018 6:26 pm

It would be nice to have some example scenes or tutorials for ES3 like "ES3 file" and "ES3 cloud" features for playmaker users.
I'm trying to create an app for maintaining goods production. There will be 2 pages. One where "boss" will be setting new tasks for example:
- Desk (2 pcs, green, high, wooden etc.)
- Chair (3 pcs, red, low, metal etc.)

2nd app page will be "production" where worker will see his current tasks to do. (So tasks will be downloaded from MySQL and parsed, probably by string split).
I guess every task must have different record in MySQL. If all jobs would be in 1 single file there could be discrepancies if "boss" would add new task (so whole file would be updated) and in a second later "worker" would finish his single task so whole file would be resynced again by worker and new task from "boss" would be lost.

I don't know yet if i should use ES2 or ES3 as both throw me some errors (see topic on ES2 forum) or when i try to upload to the cloud then MYSQL database gives BLOB with info:
Code: Select all
<br />
<b>Notice</b>:  Only variables should be passed by reference in <b>E:\xampp\htdocs\ES3Cloud.php</b> on line <b>45</b><br />
<br />
<b>Notice</b>:  Only variables should be passed by reference in <b>E:\xampp\htdocs\ES3Cloud.php</b> on line <b>46</b><br />


So...
It would be nice to have some more examples for such a noob like myself, user of playmaker. Uploading and downloading data from MySql.
Image
Hodofca
 
Posts: 2
Joined: Mon Apr 23, 2018 10:34 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby Joel » Tue Apr 24, 2018 6:34 am

Hi there,

Thanks for the example request.

I've responded to your bug report regarding the Easy Save 2 error you were having, and it looks like you're using actions which were not created by us.

With regards to your Easy Save 3 error, this is fixed in the upcoming version. If you PM me your invoice number I'll send you the updated ES3Cloud.php.

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2626
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby PabloAM » Sun Jun 17, 2018 10:43 am

Hello, I don´t know if there already is some tutorial to upgrade from Easy Save 2 to Easy Save 3 but could be awesome one.

Thanks!
PabloAM
 
Posts: 26
Joined: Tue Nov 18, 2014 8:43 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby Joel » Sun Jun 17, 2018 11:04 am

Thanks for the suggestion, we'll certainly consider this if there's demand for it. However, I generally suggest to stick with Easy Save 2 if your project already uses it, because Easy Save 2 save files are not compatible with Easy Save 3.

I can outline the major differences here though:

  • ES2.Save(myData, "myData") in Easy Save 3 would be ES3.Save<DataType>("myData", myData).
  • myData = ES2.Load<DataType>("myData") in Easy Save 3 would be myData = ES3.Load<DataType>("myData").
  • Instead of self-assigning load using ES2.Load<DataType>(myData, "myData"), we now provide a separate LoadInto method: ES3.LoadInto<DataType>("myData", myData)
  • Instead of specifying the filename like ES2.Save(myData, "myFile.txt?tag=myData"), there is now a separate filename parameter: ES3.Save<DataType>("myData", myData, "myFile.txt")
  • Instead of caching using ES2Writer/Reader, it is now achieved using the ES3File class.
  • If converting ES2Types to Easy Save 3, you should generate new ES3Types from the Window > Easy Save 3 > Types pane (see here).

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2626
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby Zafaron » Wed Nov 27, 2019 10:04 am

I've just recently purchased your Easy Save asset and I haven't yet been able to figure out how to save a class. An example of that would be very helpful, thanks.
Zafaron
 
Posts: 1
Joined: Wed Nov 27, 2019 8:45 am

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby Joel » Wed Nov 27, 2019 6:50 pm

Hi there,

This is documented in the Getting Started guide. Classes are saved and loaded like any other data. I.e.

ES3.Save<MyClass>("key", value);
MyClass value = ES3.Load<MyClass>("key");


All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2626
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Postby nMikharev » Fri Jan 03, 2020 2:40 am

Hi Joel!

I would like to understand how to use ES3.Types

- I have a component that holds 7 serializeble values. badGuys_holder
- I created ES3.Types script with manager window, so i have my lists attached to ES3 now. ES3Type_badGuys_holder

But i dont know what to do next, i mean there is no manual how to call them to actually save or load.

Could you advise me where to look for answer, or give some code that helps me with saveng\loading my lists.

here is some my lists:
Code: Select all
   [SerializeField]
    public List<int> badID = new List<int>();
    public List<string> badName = new List<string>();
    public List<bool> badActive = new List<bool>();
    public List<float> badLVL= new List<float>();


now i just using
Code: Select all
 ES3.Save<List<int>>("idList", badGuys_holder.badID );

is its sufficient?
I mean, maybe i dont even need use of ES3.Types, and there is other a methods i can utilize to Autosave my lists.
nMikharev
 
Posts: 4
Joined: Fri Dec 27, 2019 8:42 am

Next

Return to Code Examples

Who is online

Users browsing this forum: No registered users and 1 guest