Reply To: Custom Node with 3 outputs

Forums 💬 NodeCanvas 🗨️ General Discussion Custom Node with 3 outputs Reply To: Custom Node with 3 outputs

#14997
Gavalakis
Keymaster

    Hey,

    Well, you can kind of contrain the possible connections but they would still be as you called them ‘dynamic’, meaning that they will fill up as you add them and not keep their connected index.
    You do that you can derive from BTComposite for example and override:
    virtual public int maxOutConnections{get;}

    By the way, you can also override the following if you want to hook the new connection/node to something:
    virtual public void OnPortConnected(index int)
    virtual public void OnPortDisconnected(index int)

    Again, the connections/ports UI will work the same but you will be able to hook up to 3 connections for example. Their indexes will still be autosorted.

    Let me know of your node use case so that I can provide more help with it, although generaly speaking in the context of behaviour trees I haven’t ever seen any node type with a very specific amount of childs 🙂