Suggestion: NodeGraph node.OnGraphStarted BEFORE starting the node logic

NodeCanvas Forums General Discussion Suggestion: NodeGraph node.OnGraphStarted BEFORE starting the node logic

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14108
    digixart
    Participant

    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?

    Attachments:
    You must be logged in to view attached files.
    #14119
    Gavalakis
    Keymaster

    Hello,

    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 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    #14127
    digixart
    Participant

    Hey thank you for your answer. I can wait for the next update.

    Thanks !

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.