Skip to main content

FB2Action_ChangePosture

Overview

  • ChangePosture action. Override the OnPlay/OnFinish/OnPaused/OnCanceled/OnTick timing hooks in Lua.

Metadata

FieldValue
Kindaction
EnvironmentB2 - Simulation
Categoryactions
ExtendsFB2Action_Base
Requirerequire('Actions.B2Action_ChangePosture')

Properties (15)

NameTypeDescription
ChangePostureStateFB1PostureStateResolved posture state (id, direction, target entity, slot) to apply on finish
CurrentAnimTimenumberElapsed time since the posture animation started playing
OwnerCharacteranyCached reference to the character performing the posture change
PostureAnimIdstringAnimation id resolved for the target posture animation
PostureAnimNamestringMontage row name resolved for the target posture animation
PostureIdstringTarget posture id to transition into, read from the action params
SafeExitLocationFVectorPrecomputed safe location to teleport the character to when exiting a vehicle
TargetEntityanyCached reference to the interaction target actor for the posture change
TransitionAnimIdstringAnimation id for transitioning between the current and target posture, if any
TransitionAnimNamestringMontage row name resolved for the transition animation
bIsCancelConditionbooleanWhether this action currently allows cancellation (set when a blocking vehicle-exit condition occurs)
bIsDriverExitbooleanWhether this posture change corresponds to the vehicle driver exiting
bIsOverrideAnimbooleanWhether a one-time posture override animation is being used instead of the normally resolved one
bIsPassengerExitbooleanWhether this posture change corresponds to a vehicle passenger exiting
bUseSafeExitLocationbooleanWhether to teleport the character to SafeExitLocation on finish

Functions (5)

FunctionParametersReturnsDescription
GetPostureId-stringReturns Posture Id.
OnCanceled--Callback invoked on Canceled.
OnFinish--Callback invoked on Finish.
OnPlay--Callback invoked on Play.
OnTickDeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number-Callback invoked on Tick.

Override points (4)

Implement these in Lua as FB2Action_ChangePosture.Override_Name = function(...) end.

FunctionParametersReturnsDescription
Override_OnCanceled--Timing hook called when the action is canceled.
Override_OnFinish--Timing hook called when the action finishes.
Override_OnPlay--Timing hook called when the action starts (play). Override in Lua to replace the start behavior.
Override_OnTickDeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number-Timing hook called every tick while the action runs. (performance-sensitive)