- Home /
Help with scriptableobjects
I tried to ask this question a while ago but as that got no answers, I'm going to try to rephrase it. I'm creating a fire emblem-style strategy game and wanted to know what the best way of storing character stats (Ally or enemy). Originally I was going to use scriptable objects but I read that they don't work for saving things in deployed games so they wouldn't work if someone levelled up or a weapon's durability needed to drop. Am I misunderstanding this? If not, what other methods could I use for storing this data? Thank you for any help that you can give.
Answer by Tondoy · Feb 21 at 09:31 PM
You´re right scriptableobjects reset them self, whene a game build gets booted, but you can safe theire data to a text file and read them on start. Brackeys made a pretty good video about such a save and load system: https://www.youtube.com/watch?v=XOjd_qU2Ido
What does get kept then when I create the build? Are the scriptableobjects still set with whatever I set them up with in the editor or are they suddenly all default values?
Additionally, I saw that most tutorials create their classes as independent and just have a scriptable object to hold this list. I've never really understood why it's set up that way so can you explain?
Thanks for the help so far.
To answer your first question, in my tests the values I set in the editor were still there, so the scriptableobjects didn´t totaly reset. To your second question, I don´t know either. You can serialize a scriptableobject, too, at least using Json. So maybe it´s because they use another serializer, but as I saied, I dont know for sure.