USMStateMachineInstance¶
Module: SMSystem
#include <SMStateMachineInstance.h>
Inherits from USMStateInstance_Base, USMNodeInstance, UObject
Description¶
The base class for state machine nodes. These are different from regular state machines (SMInstance) in that they can be assigned to a state machine directly either in the class defaults or in the details panel of a nested state machine node. Think of this as giving a state machine a 'type' which allows you to identify it in rule behavior. This is still considered a state as well which allows access to hooking into Start, Update, and End events even when placed as a nested state machine.
Public Functions¶
Protected Functions¶
| Name | |
|---|---|
| virtual void | OnStateMachineCompleted_Implementation() |
| virtual void | OnEndStateReached_Implementation() |
| virtual void | OnStateInitialized_Implementation() |
| virtual void | OnStateShutdown_Implementation() |
Protected Attributes¶
Additional inherited members¶
Public Functions inherited from USMStateInstance_Base
| Name | |
|---|---|
| USMStateInstance_Base() | |
| virtual bool | IsInEndState() const override |
| void | OnStateBegin() ![]() |
| void | OnStateUpdate(float DeltaSeconds) ![]() |
| void | OnStateEnd() ![]() |
| bool | IsEndState() const ![]() |
| void | GetStateInfo(FSMStateInfo & State) const ![]() |
| bool | IsStateMachine() const ![]() |
| bool | IsEntryState() const ![]() |
| void | SetActive(bool bValue, bool bSetAllParents =false, bool bActivateNow =true) ![]() |
| void | EvaluateTransitions() ![]() |
| bool | GetOutgoingTransitions(TArray< USMTransitionInstance * > & Transitions, bool bExcludeAlwaysFalse =true) const ![]() |
| bool | GetIncomingTransitions(TArray< USMTransitionInstance * > & Transitions, bool bExcludeAlwaysFalse =true) const ![]() |
| USMTransitionInstance * | GetTransitionToTake() const ![]() |
| bool | SwitchToLinkedState(USMStateInstance_Base * NextStateInstance, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| bool | SwitchToLinkedStateByName(const FString & NextStateName, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| bool | SwitchToLinkedStateByTransition(USMTransitionInstance * TransitionInstance, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| bool | SwitchToLinkedStateByTransitionName(const FString & TransitionName, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| USMTransitionInstance * | GetTransitionByIndex(int32 Index) const ![]() |
| USMTransitionInstance * | GetOutgoingTransitionByName(const FString & Name) const ![]() |
| USMTransitionInstance * | GetIncomingTransitionByName(const FString & Name) const ![]() |
| USMStateInstance_Base * | GetNextStateByTransitionIndex(int32 Index) const ![]() |
| USMStateInstance_Base * | GetNextStateByName(const FString & StateName) const ![]() |
| USMStateInstance_Base * | GetPreviousStateByName(const FString & StateName) const ![]() |
| USMStateInstance_Base * | GetPreviousActiveState() const ![]() |
| USMTransitionInstance * | GetPreviousActiveTransition() const ![]() |
| bool | AreAllOutgoingTransitionsFromAnAnyState() const ![]() |
| bool | AreAllIncomingTransitionsFromAnAnyState() const ![]() |
| const FDateTime & | GetStartTime() const ![]() |
| float | GetServerTimeInState(bool & bOutUsedLocalTime) const ![]() |
| void | GetAllNodesOfType(TArray< USMNodeInstance * > & OutNodes, TSubclassOf< USMNodeInstance > NodeClass, bool bIncludeChildren =true, const TArray< UClass * > & StopIfTypeIsNot =TArray< UClass * >()) const |
| const FLinearColor & | GetEndStateColor() const |
| bool | ShouldDisplayNameWidget() const |
| bool | ShouldUseDisplayNameOnly() const |
| const FSMStateConnectionValidator & | GetAllowedConnections() const |
| virtual bool | IsRegisteredWithContextMenu() const |
| virtual bool | HideFromContextMenuIfRulesFail() const |
| bool | GetAlwaysUpdate() const ![]() |
| void | SetAlwaysUpdate(const bool bValue) ![]() |
| bool | GetDisableTickTransitionEvaluation() const ![]() |
| void | SetDisableTickTransitionEvaluation(const bool bValue) ![]() |
| bool | GetDefaultToParallel() const ![]() |
| void | SetDefaultToParallel(const bool bValue) ![]() |
| bool | GetAllowParallelReentry() const ![]() |
| void | SetAllowParallelReentry(const bool bValue) ![]() |
| bool | GetStayActiveOnStateChange() const ![]() |
| void | SetStayActiveOnStateChange(const bool bValue) ![]() |
| bool | GetEvalTransitionsOnStart() const ![]() |
| void | SetEvalTransitionsOnStart(const bool bValue) ![]() |
| bool | GetExcludeFromAnyState() const ![]() |
| void | SetExcludeFromAnyState(const bool bValue) ![]() |
| bool | GetCanBeEndState() const ![]() |
| void | SetCanBeEndState(const bool bValue) ![]() |
| FName | GetHideFromContextMenuIfRulesFailPropertyName() |
| FName | GetRegisteredWithContextMenuPropertyName() |
Protected Functions inherited from USMStateInstance_Base
| Name | |
|---|---|
| virtual void | OnStateBegin_Implementation() |
| virtual void | OnStateUpdate_Implementation(float DeltaSeconds) |
| virtual void | OnStateEnd_Implementation() |
Public Attributes inherited from USMStateInstance_Base
| Name | |
|---|---|
| uint8 | bEvalGraphsOnStart |
| uint8 | bEvalGraphsOnUpdate |
| uint8 | bEvalGraphsOnEnd |
| uint8 | bEvalGraphsOnRootStateMachineStart |
| uint8 | bEvalGraphsOnRootStateMachineStop |
| FOnStateBeginSignature | OnStateBeginEvent |
| FOnStateBeginSignature | OnPostStateBeginEvent |
| FOnStateUpdateSignature | OnStateUpdateEvent |
| FOnStateEndSignature | OnStateEndEvent |
Protected Attributes inherited from USMStateInstance_Base
| Name | |
|---|---|
| FLinearColor | NodeEndStateColor |
| FSMStateConnectionValidator | ConnectionRules |
| uint16 | bHideFromContextMenuIfRulesFail |
| uint16 | bRegisterWithContextMenu |
| uint16 | bShowDisplayNameOnly |
| uint16 | bDisplayNameWidget |
Friends inherited from USMStateInstance_Base
| Name | |
|---|---|
| class | USMGraphNode_StateNodeBase |
Public Functions inherited from USMNodeInstance
| Name | |
|---|---|
| USMNodeInstance() | |
| virtual void | Serialize(FArchive & Ar) override |
| virtual UWorld * | GetWorld() const override |
| virtual void | BeginDestroy() override |
| virtual UObject * | GetContext() const override ![]() |
| virtual void | NativeInitialize() |
| virtual void | NativeShutdown() |
| void | OnRootStateMachineStart() ![]() |
| void | OnRootStateMachineStop() ![]() |
| void | RunConstructionScript() |
| bool | ShouldSkipNativeEditorConstructionScripts() const |
| USMInstance * | GetStateMachineInstance(bool bTopMostInstance =false) const ![]() |
| void | SetOwningNode(FSMNode_Base * Node, bool bInIsEditorExecution =false) |
| const FSMNode_Base * | GetOwningNode() const |
| T * | GetOwningNodeAs() const |
| USMStateMachineInstance * | GetOwningStateMachineNodeInstance() const ![]() |
| TScriptInterface< ISMStateMachineNetworkedInterface > | GetNetworkInterface() const ![]() |
| virtual float | GetTimeInState() const ![]() |
| virtual bool | IsInEndState() const |
| virtual bool | HasUpdated() const ![]() |
| bool | IsActive() const ![]() |
| const FString & | GetNodeName() const ![]() |
| const FGuid & | GetGuid() const ![]() |
| UTexture2D * | GetNodeIcon() const |
| FVector2D | GetNodeIconSize() const |
| FLinearColor | GetNodeIconTintColor() const |
| void | EvaluateGraphProperties(bool bTargetOnly =false) ![]() |
| const FGuid & | GetTemplateGuid() const |
| const FVector2D & | GetNodePosition() const ![]() |
| bool | IsInitialized() const ![]() |
| bool | IsInitializedAndReadyForInputEvents() const |
| FSMGraphProperty * | FindExposedPropertyOverrideByName(const FName & VariableName) const |
| virtual void | PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) override |
| bool | WasArrayPropertyModified(const FName & PropertyName) const |
| bool | IsNodePinChanging() const |
| void | SetDisplayName(FName NewDisplayName) ![]() |
| void | SetNodeDescriptionText(FText NewDescription) ![]() |
| FText | GetNodeDescriptionText() const ![]() |
| void | SetNodeColor(FLinearColor NewColor) ![]() |
| void | SetUseCustomColor(bool bValue) ![]() |
| void | SetUseCustomIcon(bool bValue) |
| void | SetVariableReadOnly(FName VariableName, bool bSetIsReadOnly) ![]() |
| void | SetVariableHidden(FName VariableName, bool bSetHidden) ![]() |
| bool | IsEditorExecution() const ![]() |
| void | WithExecutionEnvironment(ESMExecutionEnvironment & ExecutionEnvironment) ![]() |
| TScriptInterface< ISMEditorGraphNodeInterface > | GetOwningEditorGraphNode() const ![]() |
| void | K2_TryGetOwningEditorGraphNode(TScriptInterface< ISMEditorGraphNodeInterface > & EditorNode, ESMValidEditorNode & IsValidNode) const ![]() |
| bool | IsInitializationThreadSafe() const |
| void | ResetVariables() ![]() |
| bool | GetResetVariablesOnInitialize() const |
| bool | HasCustomColor() const |
| const FLinearColor & | GetNodeColor() const |
| const FSMNodeDescription & | GetNodeDescription() const |
| bool | HasCustomIcon() const |
| FString | GetNodeDisplayName() const |
| void | SetTemplateGuid(const FGuid & NewTemplateGuid) |
| void | SetIsThreadSafe(bool bNewValue) |
| void | SetIsEditorThreadSafe(const bool bNewValue) |
| bool | GetIsEditorThreadSafe() const |
| TEnumAsByte< ESMNodeInput::Type > | GetInputType() const |
| int32 | GetInputPriority() const |
| bool | GetBlockInput() const |
| UInputComponent * | GetInputComponent() const ![]() |
| FName | GetConstructionScriptFunctionName() |
| FName | GetNodeDescriptionPropertyName() |
| FName | GetHideFromDropDownIfRulesFailPropertyName() |
Protected Functions inherited from USMNodeInstance
| Name | |
|---|---|
| virtual void | OnRootStateMachineStart_Implementation() |
| virtual void | OnRootStateMachineStop_Implementation() |
| void | ConstructionScript() ![]() |
| FSMGraphProperty * | FindOrAddExposedPropertyOverrideByName(const FName & VariableName) |
| void | OnPreCompileValidate(USMCompilerLog * CompilerLog) const |
| virtual void | OnPreCompileValidate_Implementation(USMCompilerLog * CompilerLog) const |
| virtual void | ConstructionScript_Implementation() |
| virtual UTexture2D * | GetNodeIcon_Implementation() const |
| virtual FVector2D | GetNodeIconSize_Implementation() const |
| virtual FLinearColor | GetNodeIconTintColor_Implementation() const |
| void | EnableInput() Input. |
| void | DisableInput() |
| void | OnContextPawnControllerChanged(APawn * Pawn, AController * NewController) |
Public Attributes inherited from USMNodeInstance
| Name | |
|---|---|
| TArray< FSMGraphProperty > | ExposedPropertyOverrides |
| uint8 | bEvalDefaultProperties |
| uint8 | bAutoEvalExposedProperties |
Protected Attributes inherited from USMNodeInstance
| Name | |
|---|---|
| bool | bSkipNativeEditorConstructionScripts |
| TObjectPtr< UTexture2D > | NodeIcon |
| FVector2D | NodeIconSize |
| FLinearColor | NodeIconTintColor |
| bool | bResetVariablesOnInitialize |
| FSMNodeDescription | NodeDescription |
| FLinearColor | NodeColor |
| uint8 | bDisplayCustomIcon |
| uint8 | bUseCustomColors |
| uint8 | bHideFromDropDownIfRulesFail |
| TObjectPtr< UInputComponent > | InputComponent |
| TEnumAsByte< ESMNodeInput::Type > | AutoReceiveInput |
| int32 | InputPriority |
| uint8 | bBlockInput |
Friends inherited from USMNodeInstance
| Name | |
|---|---|
| class | USMGraphNode_StateNode |
| class | USMGraphNode_TransitionEdge |
| struct | FSMNode_Base(FSMNode_Base ) |
| class | USMGraphNode_Base |
| class | USMGraphK2Node_PropertyNode_Base |
Public Functions Documentation¶
function USMStateMachineInstance¶
function PostLoad¶
function OnStateMachineCompleted¶

Called after the state machine has completed its internal states.
function OnEndStateReached¶

Called when an end state has been reached.
function OnStateInitialized¶

Called before OnStateBegin and before transitions are initialized.
function OnStateShutdown¶

Called after OnStateEnd and after transitions are shutdown.
function GetAllStateInstances¶

Retrieve all contained state instances defined within the state machine graph this instance represents. These can be states, state machines, and conduits.
This does not include nested states in sub state machines.
function GetContainedStateByName¶

Retrieve an immediate state owned by this state machine node in O(1) time. This will not retrieve nested states.
Parameters:
StateName- The name of the state node to search for.
Return: The state instance or nullptr.
function GetEntryStates¶

Return the entry states of the state machine. Generally one unless parallel states are used.
function GetActiveStates¶

Return all states active within this state machine node.
function GetStateMachineReference¶

Return an SMInstance reference if one is assigned. This will be null if this is not a state machine reference.
function GetOwningNodeContainer¶
Special handling to retrieve the real FSM node in the event this is a state machine reference.
Reimplements: USMNodeInstance::GetOwningNodeContainer
function IsStateMachineInEndState¶

If this state machine node is in an end state.
function GetAllowedNodes¶
Retrieve the node placement rules for this state machine.
function GetAllowedStates¶
Deprecated:
Use GetAllowedNodes() instead.
function GetWaitForEndState¶

Public getter for bWaitForEndState.
function SetWaitForEndState¶

Public setter for bWaitForEndState.
function GetReuseCurrentState¶

Public getter for bReuseCurrentState.
function SetReuseCurrentState¶

Public setter for bReuseCurrentState.
function GetReuseIfNotEndState¶

Public getter for bReuseIfNotEndState.
function SetReuseIfNotEndState¶

Public setter for bReuseIfNotEndState.
Protected Functions Documentation¶
function OnStateMachineCompleted_Implementation¶
function OnEndStateReached_Implementation¶
function OnStateInitialized_Implementation¶
function OnStateShutdown_Implementation¶
Protected Attributes Documentation¶
variable NodePlacementRules¶
Define what types of nodes are allowed or disallowed. Default is all.
variable StatePlacementRules_DEPRECATED¶
Deprecated:
Use NodePlacementRules instead.
Private Attributes Documentation¶
variable bWaitForEndState¶
Wait for an end state to be hit before evaluating transitions or being considered an end state itself.
variable bReuseCurrentState¶
When true the current state is reused on end/start. When false the current state is cleared on end and the initial state used on start. References will inherit this behavior.
variable bReuseIfNotEndState¶
Do not reuse if in an end state. References will inherit this behavior.







































































