Save and load ScriptableObject

Discussion and help for Easy Save 3
Post Reply
jinliuu
Posts: 3
Joined: Tue Jun 16, 2020 6:26 am

Save and load ScriptableObject

Post by jinliuu »

Hi there,

I just integrated ES3 into my game and everything works fine except the scriptableObject type.

The player gameobject of my game contains several child character objects which has their own skill trees and inventories. Those classes contain lists of scriptableObjects which are defined in the editor. I guess the es3 reference manager should have their references in this case. Also the inventory class and skill tree Class are already ES3Types.

However, I got the references issue when I was trying to save and load the entire player gameobject. I got lots of "Reference for skill xx with ID xxx could not be found in easy save's reference manager" error for those scriptableObject types.

Also, If I save and load without restart the game in the editor, everything works fine.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save and load ScriptableObject

Post by Joel »

Hi there,

Please could you private message me a basic project which replicates this? It's likely than an instance of your ScriptableObjects is being created, rather than it being a reference to the original in Assets.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
jinliuu
Posts: 3
Joined: Tue Jun 16, 2020 6:26 am

Re: Save and load ScriptableObject

Post by jinliuu »

Hi Joel,

I think so. For the inventory system, the item is being created by using something like item.copy() so it create an instance of the item.

For the skill system, the character has a list of skills which reference directly from the resources folder. Should I put it into other folders?

I just send you a basic project. Let me know if you find any problem.

Thanks!

Jin
jinliuu
Posts: 3
Joined: Tue Jun 16, 2020 6:26 am

Re: Save and load ScriptableObject

Post by jinliuu »

Hi Joel,

Is there any updates?

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

Re: Save and load ScriptableObject

Post by Joel »

Hi there,

I've replied to your PM.

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