Skip to main content

FB2Action_PlayAnim

Overview

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

Metadata

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

Properties (16)

NameTypeDescription
AddOnAnimDataFB2AddOnAnimDataAddOnAnim Data
AnimMontageNamestringResolved montage asset name used to play/track the animation, set by SetAnim()
AnimationIdstringAnimation id to play, resolved via the overridable GetAnimationId() hook
EntityanyEntity that plays the animation (self or target, per Action.BaseObject); used to access its anim instance
LoopCountintegerRequested number of times to play the montage's Loop section (0 normalized to 1, -1 means infinite)
LoopPlayLengthnumberPlay length of a single loop of the resolved montage, used in progress-time calculation
PausedbooleanWhether the montage is currently held in a paused blend state
PhaseEB2PlayAnimPhasePhase of PlayAnim Action
PlayingComponentNamestringAnim component the montage is played on (e.g. Root vs. other), resolved by SetAnim(). SetAnim() clears this on entry, so it stays None whenever the resolve fails; a non-None value means the latest resolve succeeded.
RateScalenumberPlayback rate scale of the resolved montage, used in progress-time calculation
RemainLoopCountintegerRemaining loop iterations, decremented each time the Loop section finishes; drives when looping stops
RequiredPostureIdstringFor SafeMove. Need Not to Save
SectionNamestringCurrent montage section of MAIN ANIMATION (Default/Loop/End), tracked via montage delegates and used to drive finish/cancel decisions
StartLocationFVectorReferenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-vector default
StartRotationFRotatorReferenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-rotator default
TotalPlayLengthnumberTotal play length of the resolved montage, used in progress-time and one-loop-length calculations

Functions (8)

FunctionParametersReturnsDescription
GetActionOneLoopPlayLength-numberReturns Action One Loop Play Length.
GetPlayingComponentName-stringReturns Playing Component Name.
IsNeedAutoInsertWalkAction-booleanReturns whether Need Auto Insert Walk Action.
OnCanceled--Callback invoked on Canceled.
OnFinish--Callback invoked on Finish.
OnPaused--Callback invoked on Paused.
OnPlay--Callback invoked on Play.
OnTickDeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number-Callback invoked on Tick.

Override points (5)

Implement these in Lua as FB2Action_PlayAnim.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_OnPaused--Timing hook called when the action is paused.
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)