I'm having issues implementing my behaviour tree. I think I understand the basics, but I am stuck with running events and specifically how to stop them (or rather how not to stop them)
Assume the following simple tree:
Tree
while "talk_to_lady"
sequence
move_to_position
talk
while "dance"
sequence
dance_move_1
dance_move_2
All of the nodes in the sequences are longer running actions, and thus return the running state until finished.
Assume dance is true, the character dances, which is fine. Now talk_to_lady is true, which means the character should go there and talk with her. While that task does have higher priority and I do want it to happen, I do still want to have the character finish the current dance node (i.e. an animation) before moving to the talk_to_lady while loop (though there might be other situations where I would not want to wait).
My solution would be to have the tree call a, say, Abort() method on the dance_move action, but if this returns the running state, it will ignore the talk action, until the dance_move action returns success or failure. Also, if the higher priority event in the tree is another action instead of a while node, it might already have made state changes that could interfere with the dance_move action.
Am I missing something or is there a solution to this I did not read about?