Assigning sub tree at runtime – can't view when running

NodeCanvas Forums General Discussion Assigning sub tree at runtime – can't view when running

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13156
    bzwill
    Participant

    Hi there,

    I have a behaviour tree for a person. They cant interact with a lot of different objects. In part of my behaviour tree on thh person theres a branch which sets up this interaction, and the person is assigned an interactionTree from the object, The behaviour tree then sets the Subtree from the person’s stored Interaction tree and then runs it, thus performing the unique objects interaction.

    The problem I am having is that at runtime I can’t view the subtrees when the person is running them, and I get this message:
    You cant view sub-graphs in play mode until they are initialized to avoid editing asset references accidentally.

    However, this is while they are running – yellow.

    Any thoughts?

    #13158
    Gavalakis
    Keymaster

    Hey!

    Sorry for the late reply.
    Just to confirm, can you please share how you are setting up the SubTree of the root Behaviour Tree?
    Are you using a variable for the “Behaviour SubTree” parameter of the SubTree node (as per the image bellow) and then change the variable in runtime, or some other way around?
    SubTreeParameter

    I am just trying to reproduce the problem.
    Please let me know how. 🙂

    Thanks in advance!

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

    Attachments:
    You must be logged in to view attached files.
    #13166
    bzwill
    Participant

    Correct – so it appeared like the attached image.

    For now, I have moved to using an enum and explicitly embedding every subtree into the main tree, the problem obviously then goes away, but in effect I now have to make a very long switch statement. It’s fine either way, NC is already saving me sooo much development time, just the initial approach was my intuitive one, as it reflected more closely the way I was changing states in my previous implementation.

    One other drawback that I had using the dynamic subtree, was I couldn’t find an ‘intentional’ way to ‘assume’ the blackboard it would have access to (inherit from the main tree and BT Owner) while designing them. What I did as a workaround was had a detached set subtree tasks on the main tree, and I would enter them from there, which gave me that blackboard to design with 🙂

    Don’t know how unique my desire was to use dynamic subtrees, so can’t say if this would be useful for other people, but might be a good thing to add to the docs if there isn’t another way.

    Anyway, still really enjoying NC 🙂

    Attachments:
    You must be logged in to view attached files.
    #13178
    Gavalakis
    Keymaster

    Hey,

    Indeed, using Dynamic SubTrees currently has that problem where you can’t “assume” the blackboard “to be used” taken from the root tree due to it’s dynamic nature and the only workaround, is either what you did, or inputting the variable a parameter needs to link to, by it’s name. Having said that, I know that both of these workarounds are not exactly intuitive, but I have some ideas to improve on that aspect for a future version 🙂

    I will also double check your initial problem posted, where you can’t view the dynamic SubTree in runtime even though it’s running. I think that this is just a UI-wise bug that needs to be fixed.

    Thank you for your input and for your positive feedback!

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

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