Currently what happens is the functions requires a string representing a serialized DialogTree object and simply deserializes it. This has obvious flaws. Instead, do something like:
dialogTree(
"Dialog_Tree_ID", // dialog tree id
dialogNode(
0, // dialog node id
[ // dialog node requirements
moneyRequirement(),
questRequirement()
],
textOf("Something something player dialog"), // player text
[ // npc text
textOf("Something something npc dialog 1"),
textOf("Something something npc dialog 2")
],
null, // attached quest?
[ // responses
dialogNode(),
dialogNode(),
dialogNode()
]
)
);
Currently what happens is the functions requires a string representing a serialized DialogTree object and simply deserializes it. This has obvious flaws. Instead, do something like: