Is there a way to create DialogueTrees at runtime like you can with BehaviorTrees like shown in the documentation here? There doesn’t appear to be a way set the necessary fields for DT nodes at runtime like you can with behavior tree nodes
While there exists the API for creating a dialogue tree, adding and connecting nodes, unfortunately because creating dialogue trees in runtime was not taken into consideration (since it defies the need of a node editor 🙂 ), most of the fields (like for example in StatementNode) are private. With that said, I could make them public in a future version though if that is something required.
Here is how you would create a dialogue tree controller, a simple dialogue tree with two nodes, and assigning it to the controller.
As mentioned earlier though, the StatementNode.statement field is private, thus not much of a use, unless it is made public, so that it is possible to set the statement (the dialogue to be displayed, which is called a “statement” in NodeCanvas).
Do you mean the possibility to make dialogue tree graphs purely from code?
I really think that doing so defies the purpose of using a visual graph representation, but if it is requested I can make the necessary changes.
Can you please elaborate on a use case please?