- Home /
Best way to store NPC data and how to do it?
Hello!
I want all the data for the NPC's in my game to be stored in one file so I can easily edit it. It should contain stuff like names, dialogue, items, quests, etc.
I've looked into XML parsing but I couldn't for the life of me figure it out (though it looks like a good option).
Are there any other ways to store this type of data? Maybe something on the asset store that might help me? Any help is greatly appreciated!
I strongly suggest using either json or xml. I personnally prefer json simply because it looks better. If you need help parsing/saving data on these files, I would happily help.
Answer by RLord321 · Oct 27, 2020 at 01:31 AM
How many NPC's do you or will you have in your game? If it's not that many, you can just store them in Unity itself. You can have a GameObject and put a script on it which will have a List which contains a list of a custom NPC class you will create. The class can have all the variables you need for NPC data. Then, you can reference this list in your game.
Good Luck!!
Your answer
![](https://koobas.hobune.stream/wayback/20220613014605im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Scriptable Objects as a datatable 1 Answer
saving data 1 Answer
Storing data on a server to be used for player currency in a multiplayer game 1 Answer
A node in a childnode? 1 Answer
Saving important data securely 2 Answers