Skip to content

FSMTransition¶

Module: SMSystem

#include <SMTransition.h>

Inherits from FSMNode_Base

Description¶

struct FSMTransition;

Transitions determine when an FSM can exit one state and advance to the next.

Public Functions¶

Name
virtual void UpdateReadStates() override
FSMTransition()
virtual void Initialize(USMInstance * Instance) override
virtual void InitializeGraphFunctions() override
virtual void Reset() override
virtual bool IsNodeInstanceClassCompatible(UClass * NewNodeInstanceClass) const override
virtual UClass * GetDefaultNodeInstanceClass() const override
virtual void ExecuteInitializeNodes() override
virtual void ExecuteShutdownNodes() override
void TakeTransition()
bool DoesTransitionPass()
bool CanTransitionFromEvent()
bool CanTransition(TArray< FSMTransition * > & Transitions)
void GetConnectedTransitions(TArray< FSMTransition * > & Transitions) const
bool CanEvaluateConditionally() const
bool CanEvaluateFromEvent() const
FORCEINLINE FSMState_Base * GetFromState() const
FORCEINLINE FSMState_Base * GetToState() const
void SetFromState(FSMState_Base * State)
void SetToState(FSMState_Base * State)
const FDateTime & GetLastNetworkTimestamp() const
void SetLastNetworkTimestamp(const FDateTime & NewTimestamp)
virtual bool IsDebugActive() const override
virtual bool WasDebugActive() const override
virtual void ResetGeneratedValues() override
bool CanEvaluateWithStartState(const TArray< FSMTransition * > & TransitionChain)
FSMState_Base * GetFinalStateFromChain(const TArray< FSMTransition * > & TransitionChain)
bool CanChainEvalIfNextStateActive(const TArray< FSMTransition * > & TransitionChain)

Protected Functions¶

Name
virtual TSharedPtr< FSMNodeRuntimeData > CreateRuntimeData() const override
virtual void InitializeFunctionHandlers() override

Public Attributes¶

Additional inherited members¶

Public Classes inherited from FSMNode_Base

Public Functions inherited from FSMNode_Base

Name
FSMNode_FunctionHandlers * GetFunctionHandlers() const
FSMNode_Base()
virtual ~FSMNode_Base() =default
FSMNode_Base(const FSMNode_Base & Node) =default
FSMNode_Base & operator=(const FSMNode_Base & Node)
const TSharedPtr< FSMNodeRuntimeData > & GetRuntimeData() const
TSharedPtr< T > GetRuntimeDataAs() const
virtual void OnStartedByInstance(USMInstance * Instance)
virtual void OnStoppedByInstance(USMInstance * Instance)
bool HaveGraphFunctionsInitialized() const
bool IsInitializedForRun() const
const FGuid & GetNodeGuid() const
void GenerateNewNodeGuid()
const FGuid & GetGuid() const
virtual void CalculatePathGuid(TMap< FString, int32 > & InOutMappedPaths, bool bUseGuidCache =false)
FString GetGuidPath(TMap< FString, int32 > & InOutMappedPaths) const
FGuid CalculatePathGuidConst() const
void GenerateNewNodeGuidIfNotSet()
void SetNodeGuid(const FGuid & NewGuid)
void SetOwnerNodeGuid(const FGuid & NewGuid)
const FGuid & GetOwnerNodeGuid() const
void SetOwnerNode(FSMNode_Base * Owner)
virtual FSMNode_Base * GetOwnerNode() const
USMInstance * GetOwningInstance() const
void CreateNodeInstance()
void CreateStackInstances()
virtual void RunConstructionScripts()
void SetNodeInstanceClass(UClass * NewNodeInstanceClass)
virtual USMNodeInstance * GetNodeInstance() const
virtual USMNodeInstance * GetOrCreateNodeInstance()
virtual bool CanEverCreateNodeInstance() const
const TArray< TObjectPtr< USMNodeInstance > > & GetStackInstancesConst() const
TArray< TObjectPtr< USMNodeInstance > > & GetStackInstances()
USMNodeInstance * GetNodeInStack(int32 Index) const
USMNodeInstance * GetNodeInStack(const FGuid & InTemplateGuid) const
UClass * GetNodeInstanceClass() const
bool IsUsingDefaultNodeClass() const
void AddVariableGraphProperty(const FSMGraphProperty_Base_Runtime & GraphProperty, const FGuid & OwningTemplateGuid)
void SetNodeName(const FString & Name)
const FString & GetNodeName() const
void SetTemplateName(const FName & Name)
FName GetTemplateName(USMNodeInstance * InNodeInstance =nullptr) const
void AddStackTemplateName(const FName & Name, UClass * TemplateClass)
virtual bool IsActive() const
virtual void SetServerTimeInState(float InTime)
float GetServerTimeInState() const
virtual bool CanExecuteGraphProperties(ESMGraphPropertyEvalFlags OnEvent, const class USMStateInstance_Base * ForTemplate, ESMGraphPropertyDirection InDirection) const
virtual bool TryExecuteGraphProperties(ESMGraphPropertyEvalFlags OnEvent, ESMGraphPropertyDirection InDirection)
void TryExecuteGraphProperties(ESMGraphPropertyEvalFlags OnEvent)
void ExecuteGraphProperties(USMNodeInstance * ForNodeInstance, const FGuid * ForTemplateGuid)
void ExecuteGraphProperties(const FFilterGraphPropertyArgs & InArgs)
const TArray< FSMGraphProperty_Base_Runtime * > & GetGraphProperties() const
const TMap< FGuid, FSMGraphPropertyTemplateOwner > & GetTemplateGraphProperties() const
virtual void TryResetVariables()
virtual void EditorShutdown()
void TriggerDebugBreakpoint()
FName GetNodeGuidPropertyName()
FName GetPathGuidPropertyName()

Protected Functions inherited from FSMNode_Base

Name
virtual void PrepareGraphExecution()
virtual void SetActive(bool bValue)
void CreateGraphProperties()
void CreateGraphPropertiesForTemplate(USMNodeInstance * Template, const TMap< FGuid, FSMGraphProperty_Base_Runtime * > & MappedGraphPropertyInstances)

Public Attributes inherited from FSMNode_Base

Name
bool bValidateGuids
FVector2D NodePosition
float TimeInState
int32 DuplicateId
uint8 bIsInEndState
uint8 bHasUpdated
uint8 bHasInputEvents

Protected Attributes inherited from FSMNode_Base

Name
FGuid Guid
FGuid OwnerGuid
FGuid PathGuid
FString NodeName
FName TemplateName
TArray< FName > StackTemplateNames
TArray< TObjectPtr< USMNodeInstance > > StackNodeInstances
TObjectPtr< USMInstance > OwningInstance
TObjectPtr< USMNodeInstance > NodeInstance
TMap< FGuid, FSMGraphPropertyTemplateOwner > TemplateVariableGraphProperties
TObjectPtr< UClass > NodeInstanceClass

Friends inherited from FSMNode_Base

Public Functions Documentation¶

function UpdateReadStates¶

virtual void UpdateReadStates() override

Reimplements: FSMNode_Base::UpdateReadStates


function FSMTransition¶

FSMTransition()

function Initialize¶

virtual void Initialize(
    USMInstance * Instance
) override

Initializes various properties and associate the node with its owning state machine instance.

Parameters:

Instance
The state machine instance used to initialize the node.

Reimplements: FSMNode_Base::Initialize


function InitializeGraphFunctions¶

virtual void InitializeGraphFunctions() override

Initialize all graph evaluator functions. Must be called from GameThread!

Reimplements: FSMNode_Base::InitializeGraphFunctions


function Reset¶

virtual void Reset() override

Resets persistent data.

Reimplements: FSMNode_Base::Reset


function IsNodeInstanceClassCompatible¶

virtual bool IsNodeInstanceClassCompatible(
    UClass * NewNodeInstanceClass
) const override

Derived nodes should overload and check for the correct type.

Reimplements: FSMNode_Base::IsNodeInstanceClassCompatible


function GetDefaultNodeInstanceClass¶

virtual UClass * GetDefaultNodeInstanceClass() const override

The default node instance class. Each derived node class needs to implement.

Reimplements: FSMNode_Base::GetDefaultNodeInstanceClass


function ExecuteInitializeNodes¶

virtual void ExecuteInitializeNodes() override

Reimplements: FSMNode_Base::ExecuteInitializeNodes


function ExecuteShutdownNodes¶

virtual void ExecuteShutdownNodes() override

Reimplements: FSMNode_Base::ExecuteShutdownNodes


function TakeTransition¶

void TakeTransition()

Will execute any transition tunnel logic.


function DoesTransitionPass¶

bool DoesTransitionPass()

Execute the graph and return the result. Only determines if this transition passes.


function CanTransitionFromEvent¶

bool CanTransitionFromEvent()

Checks if this transition has been notified it can pass from an event.


function CanTransition¶

bool CanTransition(
    TArray< FSMTransition * > & Transitions
)

Checks the execution tree in the event of conduits.

Parameters:

Transitions
All transitions that pass.

Return: True if a valid path exists.


function GetConnectedTransitions¶

void GetConnectedTransitions(
    TArray< FSMTransition * > & Transitions
) const

Retrieve all transitions in a chain. If the length is more than one that implies a transition conduit is in use.

Parameters:

Transitions
All transitions connected to this transition, ordered by traversal.

function CanEvaluateConditionally¶

bool CanEvaluateConditionally() const

If the transition is allowed to evaluate conditionally. This has to be true in order for the transition to be taken.


function CanEvaluateFromEvent¶

bool CanEvaluateFromEvent() const

If the transition is allowed to evaluate from an event.


function GetFromState¶

inline FORCEINLINE FSMState_Base * GetFromState() const

function GetToState¶

inline FORCEINLINE FSMState_Base * GetToState() const

function SetFromState¶

void SetFromState(
    FSMState_Base * State
)

Sets the state leading to this transition. This will update the state with this transition.


function SetToState¶

void SetToState(
    FSMState_Base * State
)

function GetLastNetworkTimestamp¶

inline const FDateTime & GetLastNetworkTimestamp() const

function SetLastNetworkTimestamp¶

inline void SetLastNetworkTimestamp(
    const FDateTime & NewTimestamp
)

function IsDebugActive¶

inline virtual bool IsDebugActive() const override

Reimplements: FSMNode_Base::IsDebugActive


function WasDebugActive¶

inline virtual bool WasDebugActive() const override

Reimplements: FSMNode_Base::WasDebugActive


function ResetGeneratedValues¶

virtual void ResetGeneratedValues() override

Reset any values set from state machine generation.

Reimplements: FSMNode_Base::ResetGeneratedValues


function CanEvaluateWithStartState¶

static bool CanEvaluateWithStartState(
    const TArray< FSMTransition * > & TransitionChain
)

Checks to make sure every transition is allowed to evaluate with the start state.


function GetFinalStateFromChain¶

static FSMState_Base * GetFinalStateFromChain(
    const TArray< FSMTransition * > & TransitionChain
)

Get the final state a transition chain will reach. Attempts to find a non-conduit first.


function CanChainEvalIfNextStateActive¶

static bool CanChainEvalIfNextStateActive(
    const TArray< FSMTransition * > & TransitionChain
)

Checks if any transition allows evaluation if the next state is active.


Protected Functions Documentation¶

function CreateRuntimeData¶

inline virtual TSharedPtr< FSMNodeRuntimeData > CreateRuntimeData() const override

Reimplements: FSMNode_Base::CreateRuntimeData


function InitializeFunctionHandlers¶

virtual void InitializeFunctionHandlers() override

Map the FunctionHandler pointer. Must be implemented per child struct!

Reimplements: FSMNode_Base::InitializeFunctionHandlers


Public Attributes Documentation¶

variable Priority¶

int32 Priority;

Lower number means this transition is checked sooner.


variable bCanEnterTransition¶

uint16 bCanEnterTransition;

Set from graph execution.


variable bCanEnterTransitionFromEvent¶

uint16 bCanEnterTransitionFromEvent;

Set from graph execution when updated by event.


variable bIsEvaluating¶

uint16 bIsEvaluating;

Set internally and from auto bound events. True only during evaluation.


variable bCanEvaluate¶

uint16 bCanEvaluate;

Set from graph execution or configurable from details panel. Must be true for the transition to be evaluated conditionally.


variable bCanEvaluateFromEvent¶

uint16 bCanEvaluateFromEvent;

Allows auto-bound events to evaluate.


variable bRunParallel¶

uint16 bRunParallel;

This transition will not prevent the next transition in the priority sequence from being evaluated. This allows the possibility for multiple active states.


variable bEvalIfNextStateActive¶

uint16 bEvalIfNextStateActive;

If the transition should still evaluate if already connecting to an active state.


variable bCanEvalWithStartState¶

uint16 bCanEvalWithStartState;

Secondary check state machine will make if a state is evaluating transitions on the same tick as Start State.


variable bAlwaysFalse¶

uint16 bAlwaysFalse;

The transition can never be taken conditionally or from an event.


variable bFromAnyState¶

uint16 bFromAnyState;

The transition has been created by an Any State.


variable bFromLinkState¶

uint16 bFromLinkState;

The transition has been created by a Link State.


variable FromGuid¶

FGuid FromGuid;

Guid to the state this transition is from. Kismet compiler will convert this into a state link.


variable ToGuid¶

FGuid ToGuid;

Guid to the state this transition is leading to. Kismet compiler will convert this into a state link.


variable ConditionalEvaluationType¶

ESMConditionalEvaluationType ConditionalEvaluationType;

The conditional evaluation type which determines the type of evaluation required if any.