Issue with conditional aborts

athasiop

New member
1702420799282.png

I am new to behavior trees so maybe I am missing something obvious. After adding conditional abort to the SpecialAttacks sequence I thought that if WantsToRun or WantsToJump changes status the right branches will be discontinued. To test it out I added a debug log on the aforementioned conditionals to see if they are evaluated every frame. It seems like they are not so probably my conditional abort setup is wrong. What am I missing? When the AI is on Run->FollowTargetAction and suddenly it WantsToRunAttack I want to abort the Run branch and go to the SpecialAttacks branch.
 
Make sure you set the conditional abort on the sequence task above the conditional tasks. Right now those tasks will not be reevaluated because the parent task has no abort set.
 
Thanks a lot for your answer! So conditional aborts check their immediate children. Another thing I am currently struggling to get right is how to have some blocking actions. So for example the CombatAction Task executes a combat animation. When this task executes it should block the conditional aborts. Should I implement some logic which states if the character is in a blocking state and this condition will be checked by all conditional aborts?(This seems kinda wrong). Is there a better way to restructure my tree to achieve this?
 
You could implement another conditional task that checks if the character is blocking. Combine that with the stacked conditional task and you can have the conditional abort only trigger when all of those conditions are true.
 
Top