See also How to split code between pawn, controller and behavior trees


Decorator descriptions

You can override GetStaticDescription to customize the node description text. Using the pattern below is useful, as it will handle describing abort and inversed node for you.

//Call the Super and include it in the start of your custom
//description text
return FString::Printf(TEXT("%s: custom description here")
		, *Super::GetStaticDescription());

Flow control

Set next node to execute

You can change which node is executed next using SetChildOverride:

GetParentNode()->SetChildOverride(SearchData, GetChildIndex());

This is how nodes like Loop and ConditionalLoop work. Check them for a more complete example.

Warning: Using the method from ConditionalLoop can cause a hangup due to an infinite loop if the child nodes do nothing. Loop seems to use a slightly different approach which results in it just completing if it’s going to be infinite.

Aborting nodes

You can use ConditionalFlowAbort(OwnerComp, EBTDecoratorAbortRequest) to request an abort of nodes. Depending on where you want to use this, you may need to use an instanced node to be able to store a pointer to OwnerComp.

See BTDecorator_Blackboard for how this function call is used to abort nodes in there. It can also be used to do aborts based on other things, such as custom delegates.

//In constructor:
bCreateNodeInstance = true;