Hello.
In our project we write a lot of custom nodes. I relly a lot on the node’s callback OnGraphStarted to initialize some stuff. Unfortunately, on the Graph.cs code, the callback is called AFTER the EnterNode (at least in the DialogTree graph). Wouldn’t it be better/clearer if the callback was called before?
I’ve linked a screenshot with the modification I suggest. Do you think its a good idea or is this a design choice?
PS: I did the modification and it trigger some errors. The blackboard doesnt seem to be fully ready when I do this. Do you think you could try to make sure the node callback is called first?
It is critical for the Graph.OnGraphStarted to be called before the nodes .OnGraphStarted callback, so that the graph gets a chance first to initialize anything needed, before the nodes can use it, thus the order here is important.
Having said that, the Graph.OnGraphStarted, also fires the EnterNode in the case of DialogueTrees, which means that, indeed, nodes .OnGraphStarted is called after the initial/first EnterNode, which may not be desirable.
I think the best thing to do, would be for me to change this, so that EnterNode, is ensured to be called only after the nodes .OnGraphStarted callbacks have been called.
If you are in a hurry and don’t want to wait for an update, I could maybe hack together a quickfix solution for you.
Let me know if so.
Thanks 🙂