Previous Post:
This Week’s Snapshot:
What’s New:
- Added an object field for the user to put in the branching dialogue tree they want to edit.
- Custom nodes can be created (Start, Dialogue, End). They don’t have functionally yet but they display and work differently in code.
- Saving works between instances of the editor, everything is on a ScriptableObject.
- Documentation for the nodes and general tree architecture, available here.
Challenges:
There was a lot going on this week for the tool. While the What’s New list looks small, there was a ton that went into it. The custom nodes were actually fairly easy to set up, but getting them working “optimally” in code was something I spent too much time on. I was trying to get all the Context Menu options to work as a switch statement for the different nodes, but getting the delegates to even recognize my functions was a struggle. So I just took the easy road and made all the nodes have their own creation function. Not the best, but I’m not too worried about optimization right now. I just need it to work!
Getting everything saved was also a headache. I got stuck in a circular loop where the tool wasn’t saving any data because it thought it didn’t have any nodes but it couldn’t load the node data because nothing was saving. Fun. I eventually broke that loop and it all works great now! The next big headache is the object selector for the editor. When a new instance of the editor is loaded with the tool up by default, or when there are more than one tree ScriptableObject available, things get a little funky. The tool doesn’t load any of the data until it is cleared (Selected None). I’m looking into ways to clear it from code, and when to know to clear it, but so far the searches haven’t been too helpful.
What’s Next:
- Two more nodes created (Info and Branch) and all node functionality implimented.
- A reader script that allows the user to get data from the tree ScriptableObjects at runtime.
Next Post: