Skip to content

Inverter @invert

Inverter would check underlying node or decorator and would return 'success' status if it is 'failure' and 'failure' status if it is 'success', otherwise it would return same status as underlying node or decorator.

Example

<seq> // eat food only if hungry and have food and no enemies around
  <seq @if:IsHungry @if:HaveFood>
  <dyn from=EatFood> @invert @if:AreEnemiesAround

In this example, @invert would change the status of the AreEnemiesAround condition. If the condition returns 'success', @invert would return 'failure' and vice versa, thus enabling the EatFood behavior to be executed only if there are no enemies around, otherwise failing the whole sequence.