Feature Request: Call OnEnable / OnDisable on ConditionTasks in BTs

Forums 💬 NodeCanvas ⚙️ Support Feature Request: Call OnEnable / OnDisable on ConditionTasks in BTs

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16607
    zornor90
    Participant

      Hey,

      As mentioned on discord, ConditionTasks are currently not working 100% as when using in a BehaviorTree, OnEnable / OnDisable are not getting called

      The ideal behavior for my use case would be to call them when the graph starts and stops, so that I could do things like reference events on other components, etc

      #16610
      Gavalakis
      Keymaster

        Hello there.

        Based on some other people request as well, I’ve decided to make the OnEnable and OnDisable be called for conditions in Behaviour Trees, but not OnGraphStart and OnGraphStop.

        OnEnable is called when the BT node was Resting and is now active.
        OnDisable is called when the BT node is reset back to Resting.

        This keeps the calls more consistent with when those calls are made in the FSM context and also make certain ConditionTasks (like Timeout) work in BTs correctly as well now.

        I believe that for usage with Events, the way OnEnable and OnDisable calls are made now will work fine.
        If the moment these are called do not work for you, I am also looking into adding callbacks in tasks (both ActionTask and ConditionTask) for when the graph is started (OnGraphStarted) as well as when it is stopped (OnGraphStopped).

        Let me know what you think.
        Thank you!

        #16609
        zornor90
        Participant

          Hey that sounds great! Honestly, OnGraphStarted and OnGraphStopped would probably work better for events then OnEnable / OnDisable but that could just be because I’m not 100% familiar with the difference between resting and active

          However at least having the callbacks at some point will allow our nodes to work so I greatly appreciate it!

          #16608
          Gavalakis
          Keymaster

            Hey 🙂

            The new version where OnEnable and OnDisable are called, has recently gone live on the asset store.

            Can you please give it a check and let me know if that works for you and your use cases?

            Thanks!

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