Skip to content

BehaviorTree DSL #495

Answered by deviodesign
Quillraven asked this question in Q&A
Jan 4, 2025 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

It's been a while since I used this. If I understand it correctly, you want to guard against using offensive magic if the entity has no offensive magic capabilities for example.

A sequence fails as soon as one of its children fails, so you could create your own task which acts as a guard like so:

sequence {
    checkOffensiveMagicTask(world)
    useOffensiveMagic(world)
}

Another option would be that useOffensiveMagic could fail if its conditions aren't met.
Otherwise there's no guard task in gdx ai as far as I know.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Quillraven
Comment options

You must be logged in to vote
1 reply
@deviodesign
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
ai Issues of the ktx-ai module
3 participants