conditional aborts and external events

marius

New member
Hello,
i am new to BTs and BehaviorDesigner, i read the docs but i can't solve a problem with this behavior tree.

Screenshot 2024-12-05 203750.pngScreenshot 2024-12-05 205541.png

The left branch receives an event from a coroutine in my script, moves an agent and sends an event back to my coroutine.
The right branch should just run until a conditional abort is triggered when the event is received on the left branch.

What i expect/want to happen
When the event is received, the idle is aborted and the left branch runs, then back to idle.

What happens
With an idle task in the right branch: just runs Forever, no aborts.

With a wait 10s task in the right branch: when the timer expires after 10s, the event is received and the left branch runs.
It is wierd because it's like it receives the event but then waits until the wait task returns success.


so my question is, what is the right way to do this?
 
You do not need the Selector that has the lower priority abort. Remove that Selector and instead add the lower priority abort to the Sequence task. When you do this you should see the Has Received Event task being reevaluated with the circular execution status icon. Right now Has Received Event isn't being reevaluated because the parent Sequence task doesn't have any aborts set.
 
ok thank you that fixed it!

now i have another problem. under the selector, i have 1 to 4 sequences that listen to different events.

events in sequence 1 are received, while events on sequence two are ignored.
i need to achieve two things:
- I would like all the sequences to be evaluated at the same time, and abort the idle when any of them receives an event.
- the sequences should interrupt themselves if a new event is received, restarting the sequence

can you point me in the right direction? thank you!


Screenshot 2024-12-06 094347.png
 
Branch 2 doesn't have any conditional aborts set so the conditional task won't be reevaluated. When the tree is running remember to look at the execution status icon so you can see what is being reevaluated. I also recommend that you take a look at the Stacked Conditional task which allows you to reevaluate multiple conditional tasks under the same node.
 
Back
Top