REQUEST EXAMPLES AND TUTORIALS HERE

Examples using Easy Save's API code
zephyrus.mck
Posts: 5
Joined: Thu Aug 19, 2021 11:16 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by zephyrus.mck »

Joel wrote: Sun Aug 22, 2021 2:57 pm Hi there,

You should just be able to go to the Assets > Easy Save 3 > Add Manager to Scene menu item and this will add the manager to your scene, which will prevent your error.

If you're saying that you've pressed this menu item and it's not added a manager to your scene, or the error is still occurring despite there being a manager in your scene, please could you replicate this in a new, empty project with a simple scene and private message it to me with step-by-step instructions, as I've had no reports of this.

All the best,
Joel
Gotcha, it must have been something with unity. Loaded it back up and add worked under the Assets tab. But, now I have a follow up question:

Here is the result of saving the List twice in the save file:

Code: Select all

"SecResult" : {
		"__type" : "System.Collections.Generic.List`1[[Secret, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]],mscorlib",
		"value" : [
			{
				"_ES3Ref" : "8948249286813316128", 
				"goID" : "4450230572562688044",
				"hasComplete" : true
			},{
				"_ES3Ref" : "5338263205905447223",
				"goID" : "1767588316125008645",
				"hasComplete" : false
			},{
				"_ES3Ref" : "6031188263815519535",
				"goID" : "9169626741511879044",
				"hasComplete" : false
			},{
				"_ES3Ref" : "8156237266779651359",
				"goID" : "8092536055564373622",
				"hasComplete" : false
			},{
				"_ES3Ref" : "5549341424585872672",
				"goID" : "1385805828706851820",
				"hasComplete" : false
			},{
				"_ES3Ref" : "8948249286813316128",
				"goID" : "4450230572562688044",
				"hasComplete" : true
			},{
				"_ES3Ref" : "5338263205905447223",
				"goID" : "1767588316125008645",
				"hasComplete" : false
			},{
				"_ES3Ref" : "6031188263815519535",
				"goID" : "9169626741511879044",
				"hasComplete" : false
			},{
				"_ES3Ref" : "8156237266779651359",
				"goID" : "8092536055564373622",
				"hasComplete" : false
			},{
				"_ES3Ref" : "5549341424585872672",
				"goID" : "1385805828706851820",
				"hasComplete" : false
			}

With that I see that it the save adds a new iteration of the list to the save file each time. What is the best practice for this as I can see this getting out of hand fast. Is it recommended to clear the save file of that List before saving it again? If so, what is the best way you would suggest to do that. I dont mean cleaning the Unity List, I mean clearing the List in the save file that is made by ES3.

Please advise,
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,

As long as you store the data to the same key as the previously saved data, it will overwrite it, not add to the end of it. If more items are added to your List each time you save, it will mean that there is somewhere in your code which is adding more items to that list before it is saved.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
zephyrus.mck
Posts: 5
Joined: Thu Aug 19, 2021 11:16 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by zephyrus.mck »

Joel wrote: Sun Aug 22, 2021 5:06 pm Hi there,

As long as you store the data to the same key as the previously saved data, it will overwrite it, not add to the end of it. If more items are added to your List each time you save, it will mean that there is somewhere in your code which is adding more items to that list before it is saved.

All the best,
Joel
Understood. Thank you.
Feartheway
Posts: 4
Joined: Sat Oct 02, 2021 4:04 pm

Simple top 10 high scores table

Post by Feartheway »

q1 How do I implement a simple top 10 scores table?
q2 then how do i shuffle all the scores if someone adds a new score that is first or maybe fifth place?

first place Player name, Score
second Player name, Score
third Player name, Score
fourth Player name, Score
fifth Player name, Score
sixth Player name, Score
seventh Player name, Score
eighth Player name, Score
ninth Player name, Score
tenth place Player name, Score

saves to local .dat file and / or optionally to other places. would linq help or this? https://stackoverflow.com/questions/417 ... eaderboard
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,

Unfortunately we can only assist with things relating to Easy Save. As this relates to scoreboards rather than Easy Save I'm afraid we can't assist with this. Instead I would recommend asking on the Unity forums.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Feartheway
Posts: 4
Joined: Sat Oct 02, 2021 4:04 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Feartheway »

OK regarding saving a high score table I found this but still not sure how to implement it into easy save
it uses a list for easy sorting.

https://gamedevbeginner.com/how-to-keep ... 5eUjIAUfg8
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Joel »

Feartheway wrote: Sat Oct 02, 2021 10:29 pm OK regarding saving a high score table I found this but still not sure how to implement it into easy save
it uses a list for easy sorting.

https://gamedevbeginner.com/how-to-keep ... 5eUjIAUfg8
Saving Lists is covered in the Getting Started guide:
https://docs.moodkie.com/easy-save-3/ge ... ollections

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Feartheway
Posts: 4
Joined: Sat Oct 02, 2021 4:04 pm

how do I check if ES3 is available?

Post by Feartheway »

Ok thanks for the heads up of where to find lists!

How Do i do a check if ES3 manager is loaded as an object in the scene?

eg

if (ES3ManagerLoaded)
{
ES3.Save("myList", myList);
myList = ES3.Load("myList", defaultValue);
}
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: how do I check if ES3 is available?

Post by Joel »

Feartheway wrote: Sun Oct 03, 2021 12:10 pm How Do i do a check if ES3 manager is loaded as an object in the scene?
I'm afraid I don't understand the question. What is it that you're trying to do?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Feartheway
Posts: 4
Joined: Sat Oct 02, 2021 4:04 pm

Re: REQUEST EXAMPLES AND TUTORIALS HERE

Post by Feartheway »

How do I programmably check if Easy Save is available / enabled / included in a project for a function? or scene or project.

i have made some code that saves to XML and also saves to BitFormat
I want another option to use easy save if its available, if its not a available in the project then just to skip using easy save.
Post Reply