I want to add a basic "array" of strings to actors, and I'm not too fond of parsing a JSON string every time I want to access it, nor do I want to spend too long writing editor code.
I thought about simply having fields with the same name, and a helper function to gather them in an array when needed.
Like this:
Short question, would that break anything? The dialogue editor doesn't seem to mind.
Is it dangerous to have multiple fields with the same title
Re: Is it dangerous to have multiple fields with the same title
That's fine. Make sure to get the field values from your dialogue database, such as:
and not from Lua:
since Lua will only have one of the values (the last one in the All Fields list).
Code: Select all
List<Field> portraitFields = DialogueManager.masterDatabase.GetActor("Player").fields.Find(x => x.title == "Portrait");
Code: Select all
string value = DialogueLua.GetActorField("Player", "Portrait").asString;