Hello!
I’m working on a dialogue-heavy game with a team of a few other people as a programmer. I already have a rudimentary “branching dialogue” system from an older project, but i’d like to make it easier for my teammates to write dialogue and import it into the game with relatively few issues.
I’ve been experimenting with JSON files as a way to accomplish this, but i’m struggling to find a way to format a JSON that can be imported in this way with the system i have set up.
The main issue is that the system relies on multiple “chunks” of dialogue referencing each other at the end of the current “chunk”.
I used JSONUtility to convert this specific instance of the BranchingDialogue and realized an issue; the other instances which this one references in the responses are only saved as the Instance IDs. This makes a lot of sense, but when importing a full conversation, I wouldn’t be aware of the Instance IDs until those instances were created, therefore I wouldn’t be able to put them in when loading from JSON.
{"_dialogue":[{"_talkerData":{"instanceID":21214},"_eventsToInvoke":[],"_sentences":"hello! this is a test of the branching dialogue system."},{"_talkerData":{"instanceID":21214},"_eventsToInvoke":[],"_sentences":"something something nothingburger placeholder maclunky"},{"_talkerData":{"instanceID":21214},"_eventsToInvoke":[],"_sentences":"how about you?"}],"_responses":[{"_response":"Can you repeat dialogue?","_resultingDialogue":{"instanceID":21132}},{"_response":"Can choices be saved?","_resultingDialogue":{"instanceID":21133}}]}
(mainly looking at the “_resultingDialogue” field as the issue here, the rest could theoretically be worked around even though it’d be pretty annoying)
I programmed this system this way in an attempt to make everything as organized as possible and not just end up with a massive array of different encounters/variations of dialogue out of order, but now I just have no idea how to make it convenient to work with. I’m also not sure at all how I could accomplish this in a more JSON friendly way.