Saving Scriptable Object Data - Inconsistent Between Builds

Discussion and help for Easy Save 3

Saving Scriptable Object Data - Inconsistent Between Builds

Postby gumbomasta » Sun Aug 18, 2019 8:55 pm

Hi,

I've set up several of my Scriptable Objects so that I can reference them as-is to be read by ES3.Load<SOInventoryItem>.

this is what saved data looks like in a JSON file:

For example,

"Picture_Of_Saxophone": {
"__type": "SOInventoryItem,Assembly-CSharp",
"value": {
"_ES3Ref": 6028262174322791446,
"itemState": 11,
"price": 0
}

This reference should save the SO's data and reference it for future loading using it's _ES3Ref #.

The problem is, the ES3Ref number changes, usually when I'm making new builds, or changing something around in my scene architecture, or working with multiple scenes.

Is there a way to keep the ES3ref consistent? Or a recommended practice to avoid having it change?

Or should I avoid using ES3Refs at all for my saving and loading of data (since I have the objects loaded in their own database - I don't actually need to load the data itself) and instead just use something like a string match.

guidance appreciated!

-G
gumbomasta
 
Posts: 7
Joined: Thu Jun 01, 2017 4:24 pm

Re: Saving Scriptable Object Data - Inconsistent Between Bui

Postby gumbomasta » Sun Aug 18, 2019 9:19 pm

Also, I'm seeing multiple references to the same item in the ES3 Reference manager: Image

Many of these items are scriptable objects and are referenced in many places.

Is this normal? Is there something I should be doing about this? Is this the cause of my issues?

thanks!
gumbomasta
 
Posts: 7
Joined: Thu Jun 01, 2017 4:24 pm

Re: Saving Scriptable Object Data - Inconsistent Between Bui

Postby Joel » Mon Aug 19, 2019 6:07 pm

Hi there,

I've had no reports of references spontaneously losing their ID or duplicate IDs. Is it possible to PM me a basic project which replicates this?

The reference ID can be lost if the GameObject is deleted, and Unity generates new reference IDs (this is true of Unity also, not just Easy Save), or if the reference manager is in a different scene to the references which were used to create it.

Note that if you're not using the latest version of Easy Save, I recommend updating as we've change the implementation in newer versions to address a bug. If you're able to (i.e. if you're not dependent on existing save data), it might also be worth deleting your reference mangers after doing this so that they're automatically recreated.

Let me know how you get on.

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

Re: Saving Scriptable Object Data - Inconsistent Between Bui

Postby gumbomasta » Mon Aug 19, 2019 9:33 pm

Thanks for the response.

I hadn't upated ES since you posted, so I'll do that and keep you posted about the issue at hand.
gumbomasta
 
Posts: 7
Joined: Thu Jun 01, 2017 4:24 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron