Reply To: SubTrees: How to pass down agent and blackboard of the root BT?

NodeCanvas Forums Support SubTrees: How to pass down agent and blackboard of the root BT? Reply To: SubTrees: How to pass down agent and blackboard of the root BT?

#15016
Gavalakis
Keymaster

Hello again and sorry for the late reply.

I see what you are after now. The problem with  subgraphs based on a variable, is that since the sub-graph is/can be dynamically assigned, we can’t do the variables mapping since mapping and variables are identified by a unique id instead of their name (so that it’s safe to rename variables without any problems). Of course all variables have their own ID and as such, even if two subgraphs share the same variable name, the mapping will be lost when changing from one subgraph to the other.

One solution would be like you said, to set the mapping via code, but I think that this would become complicated to perform. I could however add some methods if that helps.

Another solution would indeed be to use gameobject variables instead since you want to parametrize the sub-graphs per-agent and since variables mapping feature is not really possible (at least GUI-wise) because you are using different subgraph per agent (as far as I understand). I think that in this case (with dynamic sub-graphs), using the gameobject blackboard is probably better.

If of course you have any other suggestions at all (some kind of feature or ability) that you think can help in what you want to achieve, please let me know.

PS: Coincidentally, there is another post related to this where someone seems to have rolled some custom solution which may or may not work for you. I am still checking this out but maybe there is something that works for you there? -> https://nodecanvas.paradoxnotion.com/forums/topic/passing-variables-to-dynamic-subtrees/

I also posted another possible solution in my answer in that post. For your convenience I am copy/pasting it for you here:

“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.”

Thanks!

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