Feature request: Improved "Replace"

NodeCanvas Forums General Discussion Feature request: Improved "Replace"

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13852
    timv
    Participant

    I’d like to request some improvements to the Replace right-click functionality. Right now, any tasks inside nodes are lost when you replace the node. It would be great if the replacement node could take over the tasks from the old node. Normally, these would be condition tasks, so I think it would be possible to add this:

    to “public static Node ReplaceWith(this Node node, System.Type t)” in BehaviorTreeExtensions.cs. Do you see any issues with this? Would you add this, or something similar to the official release?

    Another thing: I noticed that the replace functionality is missing from the Binary Selector node. It seems it is not a BTComposite. Is there a reason for this?

    #13876
    Gavalakis
    Keymaster

    Hey,

    Thats a good suggestion and no issues with doing that.
    I’ve just added this functionality (slightly different to work for both actions and conditions just in case) for the next version.

    Because Binary Selector is special in that it only has 2 max children, it is treated differently than other composites which all of them can have any number of children and that is why it does not derive from BTComposite. Replacing a Sequencer with say 5 children for example, with a Binary Selector, would make 3 of those child connections to be lost (even though that needs some changes to the ‘ReplaceWith’ method), which I am not sure it’s a good thing.

    Thanks.

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

    #13887
    timv
    Participant

    Great, thanks! And thanks for the explanation on the binary selector. I was thinking that in some cases you might want to change between a conditional (or other decorator, or even a condition node) and a binary selector. That would still require you to copy/paste the conditions manually. I guess it’s not a very common operation, so that’s probably fine.

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