Shared FSM Asset without binding, how to assign subtree variables?

NodeCanvas Forums Support Shared FSM Asset without binding, how to assign subtree variables?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17248
    jacky655121
    Participant

    Hi, I need some help with my current project:
    I want to use only one FSM asset to control different NPCs. I do not bind the graph because I want a change in the FSM asset can be assign to all NPC using that asset in the future, so I don’t need to fix every bound graph one by one when there are only universal changes requested.
    But now there is a problem. When I add a subtree variable on the graph blackboard and assign the subtree to a FSM state, I cannot assign subtree’s exposed variables because the assign field will not show up in editor mode. And when I add a subtree variable on the object blackboard, although the assign field shows up, whenever I assign one NPC’s subtree variable, the other NPC’s variable will be cleared out.
    Is there any way I can assign individual variables to subtree’s exposed variable without binding the FSM graph?

    #17270
    Gavalakis
    Keymaster

    Hello and sorry for the late reply.
    Can you please clarify what you mean by saying “add subtree variable on the graph blackboard”? Do you mean a Behaviour SubTree in the root asset FSM, which in turn is assigned to the FSMOwner, so that your setup is like this for example:
    FSMOwner -> FSM Asset -> Behaviour SubTree State.

    Any exposed variables of the graph blackboard, should be shown and be possible to map from the node inspector in the parent graph that uses that graph.
    If that graph is the root graph (instead of being used as a sub-graph), then the variables should be visible and be possible to map from the GraphOwner (eg FSMOwner) inspector instead.
    This is the related documentation section just in case [LINK]

    I am sorry that I didn’t quite understand your setup :/
    Please let me know.

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

    #17276
    jacky655121
    Participant

    Hello, thanks for your reply.
    Sorry that I did not make clear of my problem, I’ll use some picture to show the problem that I’m facing.
    So now I have a behavior tree asset that has exposed variable, and I want to assign it to a non-bind FSM.
    If I do it as the picture ( put the subtree variable in FSM’s graph variable and set it to exposed ), I cannot assign the BT’s variable to the subtree.

    2

    Attachments:
    You must be logged in to view attached files.
    #17278
    jacky655121
    Participant

    If I do it as a blackboard variable, the subtree variable can be assign.
    But when I have multiple NPC that is using the same FSM asset, the subtree’s variable (TestFloatBT in the picture) cannot be assign individually. When I change one NPC’s variable, the other NPC’s variable will be changed too.

    3

    So is there a way to not bind the FSM but can set subtree’s variable individually? Thank you.

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