Hello there!
The implementation is really up to you! I would parse the graph.nodes
array, locate the “start” node (or any other useful node) and start crawling from there.
Some useful props:
- In the
extras
property you have the type, and the scriptID associated with that node. - Inside each node you have a
ports
array which you can use to get all in and “out” ports (1 for script nodes) so you can build your flow with that. - Once you reach a choice node, you can query its “out” ports to show the different options to the player, the
link
array associated with that port will give you the id of each connection the port has, so you can navigate to the next node.
Basically what you have there is the whole graph serialized. The dialogue player is a (super simple) example on how to implement.
Hope it helps!