BTNode
- Module
- AINavigation
- Header
#include "AINavigation/BehaviorTree.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
virtual ~BTNode() = default | ~BTNode |
Public functions
| Returns | Name | Description |
|---|---|---|
EBTStatus | Execute | Enter-on-fresh + Tick + reset-on-terminal. |
bool | IsRunning | |
void | AbortIfRunning | Cancels an abandoned Running subtree: aborts the running children first, then runs OnAbort and clears the running flag, so the next Execute is a fresh entry (OnEnter runs, per-entry state resets). |
EBTFlowAbortMode | GetAbortMode | Observer contract, honoured by the enclosing Selector. |
bool | EvaluateCondition | |
void | CollectObservedKeys | Blackboard keys whose change can flip this node's condition. |
void | VisitChildren | Public face of ForEachChild for walks that are not aborts (observer collection, debugging). |
void | SetDebugNodeIndex | |
int32_t | GetDebugNodeIndex |
Function details
~BTNode
virtual ~BTNode() = defaultExecute
EBTStatus Execute(BTContext& ctx)Enter-on-fresh + Tick + reset-on-terminal. A node entered last tick that returned Running is NOT re-entered (OnEnter skipped) so it can resume.
IsRunning
bool IsRunning() constAbortIfRunning
void AbortIfRunning(BTContext& ctx)Cancels an abandoned Running subtree: aborts the running children first, then runs OnAbort and clears the running flag, so the next Execute is a fresh entry (OnEnter runs, per-entry state resets). A node that is not running is left alone. Call it wherever a branch stops being ticked — a gate decorator that starts failing, a composite restarting from 0, a parallel whose main task finished.
GetAbortMode
virtual EBTFlowAbortMode GetAbortMode() constObserver contract, honoured by the enclosing Selector. A gate decorator reports the mode it was authored with and whether its condition passes right now; everything else opts out.
EvaluateCondition
virtual bool EvaluateCondition(BTContext&) constCollectObservedKeys
virtual void CollectObservedKeys(std::vector<FName>&) constBlackboard keys whose change can flip this node's condition. A tree collects them from every node with an abort mode, so a throttled tree wakes the frame one of them changes (UE's blackboard observers) instead of finding out on its next scheduled tick.
VisitChildren
void VisitChildren(const std::function<void(BTNode&)>& fn)Public face of ForEachChild for walks that are not aborts (observer collection, debugging).
SetDebugNodeIndex
void SetDebugNodeIndex(int32_t index)GetDebugNodeIndex
int32_t GetDebugNodeIndex() const