Goal

Use this pattern when survival should interrupt ordinary combat as soon as health falls below a threshold.

Tree structure

Place a Sequence containing Is Health Low? and Flee from Threat first under a Selector. Put Combat and Patrol to its right. Set the Flee Sequence’s Abort Type to Both.

A Selector prioritizes a Flee Sequence with a Both conditional abort over Combat and Patrol.

How it runs

While Combat or Patrol runs, the Lower Priority abort reevaluates Is Health Low. When health falls below the threshold, it stops the lower-priority branch and starts Flee. While Flee runs, the Self abort checks the same condition and ends the branch after health recovers.

The structural tasks and abort setting are built in. The health, flee, combat, and patrol tasks come from your project or integrations.

Variations

Use hysteresis: start Flee below one value, such as 25 percent, but stop only after health rises above a larger value, such as 40 percent. This prevents rapid switching near one boundary.

Tasks used in this tree

Selector, Sequence, Conditionals, and Conditional Aborts.