Class BTService
Behavior Tree service nodes is designed to perform "background" tasks that update AI's knowledge.
Inheritance
Inherited Members
Namespace: UE4.AIModule
Assembly: UE4DotNet.dll
Syntax
public class BTService : BTAuxiliaryNode
Remarks
Services are being executed when underlying branch of behavior tree becomes active, but unlike tasks they don't return any results and can't directly affect execution flow.
Usually they perform periodical checks (see TickNode) and often store results in blackboard. If any decorator node below requires results of check beforehand, use OnSearchStart function. Keep in mind that any checks performed there have to be instantaneous!
Other typical use case is creating a marker when specific branch is being executed (see OnBecomeRelevant, OnCeaseRelevant), by setting a flag in blackboard.
Because some of them can be instanced for specific AI, following virtual functions are not marked as const:
- OnBecomeRelevant (from UBTAuxiliaryNode)
- OnCeaseRelevant (from UBTAuxiliaryNode)
- TickNode (from UBTAuxiliaryNode)
- OnSearchStart
If your node is not being instanced (default behavior), DO NOT change any properties of object within those functions! Template nodes are shared across all behavior tree components using the same tree asset and must store their runtime properties in provided NodeMemory block (allocation size determined by GetInstanceMemorySize() )
Properties
| Improve this Doc View SourcebCallTickOnSearchStart
Declaration
public bool bCallTickOnSearchStart { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
bRestartTimerOnEachActivation
Declaration
public bool bRestartTimerOnEachActivation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static BTService DefaultObject { get; }
Property Value
Type | Description |
---|---|
BTService |
Interval
defines time span between subsequent ticks of the service
Declaration
public float Interval { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
RandomDeviation
adds random range to service's Interval
Declaration
public float RandomDeviation { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
Methods
| Improve this Doc View SourceNew(UObject, Name)
Spawn an object of this class
Declaration
public static BTService New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
BTService |
Operators
| Improve this Doc View SourceImplicit(IntPtr to BTService)
Convert from IntPtr to UObject
Declaration
public static implicit operator BTService(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
BTService |