EZPZ Branching Dialogue – Week 3

Previous Post:

EZPZ Branching Dialogue – Week 2

This Week’s Snapshot:

What’s New:

  • Added functionality for nodes:
    • Start node has an ID number so the user can manually choose which node to start from if they want.
    • Dialogue node has an expandable text box that the user can type in
    • All nodes have the correct input and output connections (Start only has an out and End only has an in)

Challenges:

The biggest challenge this week was getting the node data to save. Previously, I had saved the node data as a custom struct, but now I was working with classes themselves, since I made the dialogue node, start node, and plan on making anything with custom data its own class. This proved to be a challenge since I was having trouble getting the data to carry over without making some crazy translations and modifications to the code, so I decided to take a step back and reevaluate the whole architecture. I ended up transferring the ownership of the custom node data to the ScriptableObject instead of the nodes themselves. This way the data could be easily serializable and called from the editor, since having the nodes own it meant there was no way for the ScriptableObject to know about them. Once I got that working the rest of the features were smooth sailing.

What’s Next:

  • A reader script that allows the user to get data from the tree ScriptableObjects at runtime.
  • Info and Branch nodes created and implemented.

Next Post:

EZPZ Branching Dialogue – Week 4