I am just starting out with Unity and I’m trying to wrap my brain around Scriptable objects but I’m struggeling. I understand how to use them, but not really sure when.
I have a scenario where my game will have 30-40 NPCs, each will hold a List of Conversations and Quests. When I play a Conversation or finish a Quest the stage of that NPC is increased, and I use that stage to decide what Conversation/Quest to be prompted when I interact with the NPC. And this stage needs to be saved. as well as the Quest information (isActive, currentAmountGathered, etc)
Currently I save all this data in a Json, and save/load without any issues. But I am wondering, is this the type of things Scriptable Objects should be used for, if we are talking best practices? I’m only doing this to learn so I want to do it right. It’s a bit of a headache to contantly edit the Json to be honest.
If you are storing the current state of your player’s progress, then no, don’t use ScriptableObjects.
If you are storing things like what the quest is, then they could be a good fit.
ScriptableObjects (like all other assets) can’t be changed after you build the game, so you can’t use them for save files. For something creating questlines and conversations and whatnot, they’re great, since you don’t have to parse the file, and you can much more easily create editors to work with them if that’s required.
Thanks, so basically for any data that wont change, like a conversation, they are great. But for something Like a quest they wont work since I need to change the quest state during the game.