I am stumped how to do this.
I can do a raw load into a string of a whole text file using EZ Save 2.
Then I can parse it using indicators like "if next character is a /" then save the last snipped as a new string entry in an array." adding a new string entry for each new /entry, up to infinity?
Okay, so:
My goal is to be able to write all my npc attributes code in a text file using like Notepad++ or Sublime, then load that file during runtime on a "blank" NPC character prefab to set all its properties, from its model and texture to its bark voice, to its walk speed, to its conversation topics and responses.
Basically
The problem is that my system is broader and more abstract than that; I don't have NPCs in my game, I have "entities" which can range from a potted plant to a blacksmith to a door, all of which can have wildly varying traits.
Some entities will be able to move and will therefore need variables for speed, frequency, footstep sounds, etc.
Some entities will be able to converse and will therefore need variable lists for an undefined number of possible text responses and query words.
I COULD make a single "Entity Blank" FSM on the prefab that contains 1 billion variables to describe everything from potted plants to knights and dragons, but in most cases, if I just have an FSM with all possible traits on every single entity, there will be a LOT of bloated FSMs with blank variables that are never used.
Therefore it would be nice if I could scan the entity's profile text file for 'CAN MOVE' then, if that trait type exists here, then create a speed variable and set it to what the text file says, and do the same for a footstep sound, a speed frequency.
I COULD have different fsm prefabs with pre-created blank variables representing every possible attribute for a given trait, (a "Can Walk" FSM with three variables for it)... but what about cases where, say, the entity can only walk over certain terrain types that I need to write out a list of, in its text file ahead of time? what if there are ten blocked terrain types? what if there are 20? what if most moving entities only have 3? do I just make an FSM for blocked terrain types, with 100 blank variables, just in case I need that many someday for some random special npc? Should I use an array if a potential trait list could be 0 to infinite?
Thank you for reading this if you did. I am not sure the best way to approach this issue or if I've been clear. And since I have so many characters, doing it wrong from the beginning could massively multiply my workload down the road.
What do you recommend?