-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pausing the behavior tree #29
Comments
You should be able to stop it via the Root-node of the tree by calling the The way I do such things is usually to have a Selector below the Root node and something like a "is-stunned-branch" at the very left. This branch has a decorator that will have a stop rule for any lower priority branches and is active until the stun is over. That way I don't have to start/stop the entire tree. |
What do you mean with:
What does the BB stand for? In my tree there is a sequence of first going to a player target position and then later going to a cover position. When the enemy is hurt, I want to stop the current executing node, pause the tree and then immediatly restart the node again. Is this possible? |
sorry, with BB I mean the Blackboard.
You could just do the set-up I suggest above within every subbranch of your tree instead, however it looks like you look for some kind of "pause" functionality. I suggest you to add something like a virtual
I guess something like that basically should work, however there's a couple of additional things to keep in mind:
|
Thank you very much for the elaborate explanation how I can implement this functionality. |
Nice, your suggestions worked very well. It's exactly how I wanted to have it. Thank you very much. Instead of making your suggested changes in the I changed only the following decorators to stop their timers / observing when paused:
Do you think it's enough? I opened a pull request. So you might want to consider adding this to the libary. |
wow that was quick! glad that my suggestion worked :) You'll need to give me some time to review your changes, write some tests and potentially update the readme. |
I have written some tests. Noted a problem. It's explained in the pull request. I need your help on this. |
oh that's really cool! thanks. I'll check the P/R |
Hi there,
is there a way to stop the execution of the behavior tree temporarily and then start it again.
I have different kind of enemies which behaviors are controlled by behavior trees.
When they get hurt, I want to stop the behavior tree for a moment so that a hurt animation can be played.
The text was updated successfully, but these errors were encountered: