UMassAgentComponent

There are two primary use cases for this component:

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MassActors

Header

/Engine/Plugins/Runtime/MassGameplay/Source/MassActors/Public/MassAgentComponent.h

Include

#include "MassAgentComponent.h"

Syntax

UCLASS(Blueprintable, ClassGroup=Mass, Meta=(BlueprintSpawnableComponent),
       HideCategories=(Sockets, Collision))
class UMassAgentComponent : public UActorComponent

Remarks

There are two primary use cases for this component:

If placed on an AActor blueprint can it lets the used specify additional fragments that will be created for entities spawned based on this given blueprint.

If present present on an actor in the world it makes it communicate with the MassSimulation which will create an entity representing given actor. Use case 1) will also applicable in this case. The component is unregistered by default and requires manual enabling via a 'Enable' call

Variables

Name Description

Protected variable

FMassEntityHand...

 

AgentHandle

Protected variable UProperty Category, EditAnywhere

uint32: 1

 

bAutoRegisterInEditorMode

Protected variable UProperty Category, EditAnywhere

FMassEntityConf...

 

EntityConfig

Protected variable UProperty replicatedusing

FMassNetworkID

 

NetID

Protected variable

FMassArchetypeC...

 

PuppetSpecificAddition

Contains all the fragments added to the entity during puppet's initialization.

Protected variable

EAgentComponent...

 

State

Protected variable

FMassEntityTemp...

 

TemplateID

Constructors

Name Description

Public function

UMassAgentComponent()

Functions

Name Description

Public function

void

 

ClearEntityHandle()

Protected function

void

 

ClearEntityHandleInternal()

Public function

void

 

ClearReplicatedPuppetHandle()

Protected function

void

 

DebugCheckStateConsistency()

Public function UFunction BlueprintCallable, Category

void

 

Disable()

Registers the component with the owner effectively turning it off

Public function UFunction BlueprintCallable, Category

void

 

Enable()

Registers the component with the owner effectively turning it on.

Public function

void

 

EntityCreationAborted()

Public function

void

 

EntityCreationPending()

Public function Const

const FMassE...

 

GetEntityConfig()

Public function Const

FMassEntityH...

 

GetEntityHandle()

Methods handling the state for actors that needs mass entity creation

Public function

FMassArchety...

 

GetMutablePuppetSpecificAddition()

Public function Const

FMassNetwork...

 

GetNetID()

Public function Const

const FMassA...

 

GetPuppetSpecificAddition()

Public function Const

FMassEntityT...

 

GetTemplateID()

Public function Const

bool

 

IsEntityPendingCreation()

Public function Const

bool

 

IsPuppet()

Public function Const

bool

 

IsPuppetPaused()

Public function Const

bool

 

IsPuppetPendingInitialization()

Public function Const

bool

 

IsPuppetReplicationPending()

Public function Const

bool

 

IsReadyForPooling()

Public function UFunction BlueprintCallable, Category

void

 

KillEntity

(
    const bool bDestroyActor
)

Public function

void

 

MakePuppetAReplicatedOrphan()

Public function Virtual UFunction

void

 

OnRep_NetID()

Public function

void

 

PausePuppet

(
    const bool bPause
)

Re-adds/Removes all puppet fragments added on the mass agent This is only supported in Puppet flow

Public function

void

 

PuppetInitializationAborted()

Public function

void

 

PuppetInitializationDone()

Public function

void

 

PuppetInitializationPending()

Public function

void

 

PuppetReplicationPending()

Methods handling the state of a server replicated puppet

Public function

void

 

PuppetUnregistrationDone()

Public function

void

 

RegisterWithAgentManager()

Support poolable mass agents going into stasis.

Public function

void

 

SetEntityConfig

(
    const FMassEntityConfig& InEntityC...
)

Public function

void

 

SetEntityHandle

(
    const FMassEntityHandle NewHandle
)

Protected function

void

 

SetEntityHandleInternal

(
    const FMassEntityHandle NewHandle
)

Public function

void

 

SetPuppetHandle

(
    const FMassEntityHandle NewHandle
)

Methods handling the state of puppet actors that needs fragments initialization

Public function

void

 

SetReplicatedPuppetHandle

(
    FMassEntityHandle NewHandle
)

Protected function

void

 

SwitchToState

(
    EAgentComponentState NewState
)

Public function

void

 

UnregisterWithAgentManager()

Overridden from UActorComponent

Name Description

Protected function Virtual

void

 

OnRegister()

Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called.

Protected function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Overridden from UObject

Name Description

Public function Virtual Const

void

 

GetLifetimeReplicatedProps

(
    TArray< FLifetimeProperty >& OutLi...
)

Returns properties that are replicated for the lifetime of the actor channel

Protected function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Protected function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.