Show / Hide Table of Contents

Class BTService

Behavior Tree service nodes is designed to perform "background" tasks that update AI's knowledge.

Inheritance
System.Object
UObject
BTNode
BTAuxiliaryNode
BTService
BTService_BlackboardBase
BTService_BlueprintBase
Inherited Members
BTNode.TreeAsset
BTNode.ParentNode
UObject.TransientPackage
UObject.CastTo<T>(UObject)
UObject.CastTo(UObject, Type)
UObject.RemoveObject(UObject)
UObject.MakeObjectArrayField<T>(NativeArray*)
UObject.NotImplemented<T>()
UObject.Construct()
UObject.GetHashCode()
UObject.GetName()
UObject.ToString()
UObject.Name
UObject._None
UObject.None
UObject.ObjPointer
UObject.LoadObjectFromClass(Class, UObject, String, String, LoadFlags, PackageMap, Boolean)
UObject.LoadClass(Class, UObject, String, String, LoadFlags, PackageMap)
UObject.GetPropertyFor<T>(Name)
UObject.ExecuteUbergraph
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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 Source

bCallTickOnSearchStart

Declaration
public bool bCallTickOnSearchStart { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

bRestartTimerOnEachActivation

Declaration
public bool bRestartTimerOnEachActivation { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

DefaultObject

Get UE4 Default Object for this Class

Declaration
public static BTService DefaultObject { get; }
Property Value
Type Description
BTService
| Improve this Doc View Source

Interval

defines time span between subsequent ticks of the service

Declaration
public float Interval { get; set; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

RandomDeviation

adds random range to service's Interval

Declaration
public float RandomDeviation { get; set; }
Property Value
Type Description
System.Single
| Improve this Doc View Source

StaticClass

Get UE4 Class

Declaration
public static Class StaticClass { get; }
Property Value
Type Description
Class

Methods

| Improve this Doc View Source

New(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 Source

Implicit(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
  • Improve this Doc
  • View Source
Back to top Generated by DocFX