Skip to main content

FB2Action_Base

Overview

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

Metadata

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

Properties (25)

NameTypeDescription
AccumAddActionTimenumberElapsed time accumulator compared against AddActionTimeInterval
ActionFB1ActionInfoAction table data (S1/S2/F1/F2, script id lists, etc.) driving this instance
ActionIdstringIdentifier of this action instance (used for interaction tracking and mission time accounting)
ActionKeyFB2ActionKeyKey identifying this action's slot/queue within the interaction system
AddActionTimeIntervalnumberInterval in seconds between OnTickAddActionExecuteTime() calls
AsyncLoadAnimInfoFB1AsyncLoadAnimInfo[]Animations to async-load for this action's start/notify/tick/finish/cancel scripts
AutoInsertTypeEB2ActionAutoInsertTypeType of action that was auto-inserted before this one (e.g. WalkTo, ChangePosture)
CancelReasonEB1InteractionCancelReasonReason this action was canceled, set in TryCancel()
CurrentNotifyIndexintegerIndex into Action.NotifyScriptIds for the next notify script to run
GrabEntityIdFB1EntityIdEntity id grabbed/carried by self entity for this action
IsFirstActionbooleanMarks the first action in an interaction sequence; set on actions[0] by FB2InteractionPlayer::LinkActions(), read by FB2ActionPlayer
IsForceCancelablebooleanWhether this action is force-cancelable, copied from Action.IsForceCancelable
MergeTypeEB2ActionMergeTypeMerge type flags for this action (e.g. interaction merge, checked in Finish())
NonTargetLocationFVectorLocation used for script/condition context when there is no target entity
ResultEB2InteractionResultResult of this action once it stops playing (Finish/Failed/Canceled)
SelfEntityIdFB1EntityIdEntity id performing this action
StartActionTickTimeintegerTick timestamp used to measure elapsed action execution time for mission tracking
StateEB2ActionStateCurrent lifecycle state of this action
TalkInstanceIdFB1TalkInstanceIdId of the talk instance this action is linked to, set externally by FB2InteractionPlayer::LinkActions()
TalkSubjectEntityIdFB1EntityIdEntity id of the talk subject linked to this action, set externally by FB2InteractionPlayer::LinkActions()/OnTalkSpaceParamChanged()
TargetEntityIdFB1EntityIdEntity id targeted by this action
TickCalcValuenumberAccumulated tick delta time since this action started ticking
TimeTaskIdFB1TimeTaskIdId of the scheduled time task used for delayed Determine/Finish
bIsWaitFinishEventbooleanCached copy of Action.IsWaitFinishAction taken at Init(); read directly by FB2ActionPlayer for sequencing (the IsWaitFinishAction() getter instead reads Action.IsWaitFinishAction live)
bMultiFlagbooleanSet by looping actions (PlayAnim, BookRead, Eat, WaitTalkSequence) once a loop iteration completes; read/reset by FB2ActionPlayer to gate multi-interaction selection

Functions (47)

FunctionParametersReturnsDescription
AddMergeTypeFlagInMergeType: EB2ActionMergeType-Adds Merge Type Flag.
CanCancelCondition-booleanReturns whether it can Cancel Condition.
CanCancelImmediately-booleanReturns whether it can Cancel Immediately.
CanMergeAction-booleanReturns whether it can Merge Action.
CanPauseCondition-booleanReturns whether it can Pause Condition.
CanStartCondition-booleanReturns whether it can Start Condition.
CanStartSubAction-booleanReturns whether it can Start Sub Action.
CancelInteractionReason: EB1InteractionCancelReason-Cleans up B2ActionPlayer@StandByActions and cancels the interaction when the Action itself ends up in an Invalid situation.
GetActionInfo-FB1ActionInfoReturns Action Info.
GetActionMergeType-EB2ActionMergeTypeReturns Action Merge Type.
GetActionOneLoopPlayLength-numberReturns how long one start-to-finish run of each action takes. For WalkTo it is until the node ends; for PlayAnim it is the TotalPlayLength.
GetAutoInsertActionType-EB2ActionAutoInsertTypeReturns Auto Insert Action Type.
GetCancelReason-EB1InteractionCancelReasonReturns Cancel Reason.
GetCurrentInteractionPlayReason-EB1InteractionPlayReasonReturns Current Interaction Play Reason.
GetGrabEntityId-FB1EntityIdReturns Grab Entity Id.
GetMultiFlag-booleanReturns Multi Flag.
GetNonTargetLocation-FVectorReturns Non Target Location.
GetPlayingComponentName-stringReturns Playing Component Name.
GetProgressTime-numberReturns Progress Time.
GetResult-EB2InteractionResultReturns Result.
GetSelfEntityId-FB1EntityIdReturns Self Entity Id.
GetState-EB2ActionStateReturns State.
GetTargetEntityId-FB1EntityIdReturns Target Entity Id.
GetType-EB1ActionTypeReturns Type.
HasAnyMergeTypeFlagsInMergeType: EB2ActionMergeTypebooleanReturns whether it has Any Merge Type Flags.
HasCustomProgressTime-booleanReturns whether it has Custom Progress Time.
IsAccumulatingProgressTime-booleanReturns whether Accumulating Progress Time.
IsAutoChangePostureInserted-booleanReturns whether Auto Change Posture Inserted.
IsAutoInsertAction-booleanReturns whether Auto Insert Action.
IsNeedAutoInsertWalkAction-booleanReturns whether Need Auto Insert Walk Action.
IsPaused-booleanReturns whether Paused.
IsSafeMove-booleanReturns whether Safe Move.
IsWaitFinishAction-booleanReturns whether Wait Finish Action.
IsWalkToAction-booleanReturns whether Walk To 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.
RemoveMergeTypeFlagInMergeType: EB2ActionMergeType-Removes Merge Type Flag.
RequestDetermine--Requests Determine.
ResetMultiFlag--Resets Multi Flag.
SetAutoInsertActionTypeInType: EB2ActionAutoInsertType-Sets Auto Insert Action Type.
SetMergeTypeInMergeType: EB2ActionMergeType-Sets Merge Type.
ShouldCancelInteraction-booleanReturns whether it should Cancel Interaction.
TryFinishInFailReason: EB2InteractionFailReason-
TryRunNotifyScriptInSelfEntityId: FB1EntityId, InTargetEntityId: FB1EntityId-

Override points (5)

Implement these in Lua as FB2Action_Base.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)