Reply To: Alternator Decorator?

Forums 💬 NodeCanvas 🗨️ General Discussion Alternator Decorator? Reply To: Alternator Decorator?

#14993
Gavalakis
Keymaster

    Hey,

    Toggle is a meta-operation which modifies the behaviour tree’s root/start node, so I think that it’s not really what you are after 🙂

    Even though your desired behaviour can be achieved with some ways, I really like your suggested node to make it easier, kind of a Selector that will alter the order of it’s child nodes in some way.
    What came to my mind is a Composite that uses it’s child nodes kind like a ‘Stack’, pushing and looping the indexes forward (or backward) after each execution, something like this (4 child nodes):
    0,1,2,3
    3,0,1,2
    2,3,0,1
    etc…

    I am not sure if thats clear 🙂

    So in effect if you have just 2 childs, it will alter between those 2 after each complete execution of the node.
    I will give some more thought on that of course, but yes, nice idea 🙂

    Thanks