/tg/ Station 13 - Modules - TypesVar Details

subplan

Subplan node: Runs child and applies configurable restart policies when the child completes instead of propagating completion directly.

success_policy: BT_SUBPLAN_SUCCEED_ON_SUCCESS (default) propagates BT_SUCCESS when all children succeed. BT_SUBPLAN_LOOP_ON_SUCCESS resets all children and returns BT_RUNNING, restarting next tick.

failure_policy: BT_SUBPLAN_FAIL_ON_FAILURE (default) propagates BT_FAILURE when a child fails. BT_SUBPLAN_LOOP_ON_FAILURE resets all children and returns BT_RUNNING, restarting next tick.

Combining both loop policies creates an infinite loop that only exits via an external observer abort or cancel_current_plan(), so be careful pls

Vars

failure_policyBT_SUBPLAN_FAIL_ON_FAILURE: propagate failure (default). BT_SUBPLAN_LOOP_ON_FAILURE: restart.
loop_delayMinimum delay before ticking again after a loop policy restarts the child. 0 = immediate (default).
next_loop_timeworld.time when this subplan is next allowed to tick after a loop restart.
success_policyBT_SUBPLAN_SUCCEED_ON_SUCCESS: propagate success (default). BT_SUBPLAN_LOOP_ON_SUCCESS: restart.

Var Details

failure_policy

BT_SUBPLAN_FAIL_ON_FAILURE: propagate failure (default). BT_SUBPLAN_LOOP_ON_FAILURE: restart.

loop_delay

Minimum delay before ticking again after a loop policy restarts the child. 0 = immediate (default).

next_loop_time

world.time when this subplan is next allowed to tick after a loop restart.

success_policy

BT_SUBPLAN_SUCCEED_ON_SUCCESS: propagate success (default). BT_SUBPLAN_LOOP_ON_SUCCESS: restart.