Reply To: Passing variables to dynamic subtrees

NodeCanvas Forums Support Passing variables to dynamic subtrees Reply To: Passing variables to dynamic subtrees

#15015
Gavalakis
Keymaster

Hello again,

I do understand and agree in what you mean by saying that ideally the subtree should be completely decoupled from the root tree and in case where no dynamic subtrees are used this can be the case indeed using the variables mapping feature/GUI, but dynamic subtrees based on a variable impose a challenge. Mapping is such a case can possibly only be done via name/type matching of variables (which can of course be prone to error if a variable is renamed as opposed to normal variables mapping where match is done by ID instead of name). As far as I can tell, name matching is also what you have done here? I would be interested to know what IDynamicSubtreeProvider and IDynamicSubtreeVariablesProvider do more specifically by the way.

With that said, I could probably come up with and add a different mapping GUI approach (based on variable name matching) in SubTree inspector in place of the existing one, specifically when the subtree is dynamic. This way we could have the exiting variables mapping method for when the subtree is a constant assignment and a different mapping method for when subtree is dynamic. Let me know what you think.

Finally, regarding refactoring with virtual methods, no problem in doing that. Which methods do you need made virtual more specifically? Also, your DynamicSubTree class which inherits from BTNodeNested will work fine when you upgrade to a newer version for example, or is it that you would prefer inheriting directly from SubTree class instead?

Let me know.

Thanks!

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