Event Subscription

Forums 💬 NodeCanvas ⚙️ Support Event Subscription

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18587
    kevynm
    Participant

      Hi! Is there an implementation like the graphs themselves listen to events to objects they are subscribed to like your typical c# events? Since the current implementation is to have a target object and send to them specifically. I want may graph to not care and just send it to whoever is subscribed to it. I know there is global but it sends to everyone and very performance heavy. Thanks!

      #18590
      Gavalakis
      Keymaster

        Hello,

        I am bit confused with your question sorry.
        There is a condition “Check CSharp Event” which you can use to subscribe to c# events of type System.Action and System.Action<T>.
        Can you please provide a bit more information or even an example of what you sought to achieve?
        Thanks a lot.

        #18589
        kevynm
        Participant

          What I meant is within behaviour trees and how events are handled. Because with the current setup the graphOwner sending the event needs either the specific graph it will send to or do it globally, can it be like the other way around? the receiving graph having the reference and the sending graph will just send events to graphs subscribed to it?

          #18588
          Gavalakis
          Keymaster

            Hey,

            The graph only acts as a way of dispatching the event. In reality, only the tasks (eg CheckEvent) subscribe to an event using the MessageRouter class for later to be raised also through MessageRouter when SendEvent is called.

            Can you provide an example of what you are after since I can’t think of a reason why events don’t work for you as they stand now?

            Thanks.

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