FB2Action_Base
Overview
- Base action. Override the OnPlay/OnFinish/OnPaused/OnCanceled/OnTick timing hooks in Lua.
Metadata
| Field | Value |
|---|---|
| Kind | action |
| Environment | B2 - Simulation |
| Category | actions |
| Require | require('Actions.B2Action_Base') |
Properties (25)
| Name | Type | Description |
|---|---|---|
AccumAddActionTime | number | Elapsed time accumulator compared against AddActionTimeInterval |
Action | FB1ActionInfo | Action table data (S1/S2/F1/F2, script id lists, etc.) driving this instance |
ActionId | string | Identifier of this action instance (used for interaction tracking and mission time accounting) |
ActionKey | FB2ActionKey | Key identifying this action's slot/queue within the interaction system |
AddActionTimeInterval | number | Interval in seconds between OnTickAddActionExecuteTime() calls |
AsyncLoadAnimInfo | FB1AsyncLoadAnimInfo[] | Animations to async-load for this action's start/notify/tick/finish/cancel scripts |
AutoInsertType | EB2ActionAutoInsertType | Type of action that was auto-inserted before this one (e.g. WalkTo, ChangePosture) |
CancelReason | EB1InteractionCancelReason | Reason this action was canceled, set in TryCancel() |
CurrentNotifyIndex | integer | Index into Action.NotifyScriptIds for the next notify script to run |
GrabEntityId | FB1EntityId | Entity id grabbed/carried by self entity for this action |
IsFirstAction | boolean | Marks the first action in an interaction sequence; set on actions[0] by FB2InteractionPlayer::LinkActions(), read by FB2ActionPlayer |
IsForceCancelable | boolean | Whether this action is force-cancelable, copied from Action.IsForceCancelable |
MergeType | EB2ActionMergeType | Merge type flags for this action (e.g. interaction merge, checked in Finish()) |
NonTargetLocation | FVector | Location used for script/condition context when there is no target entity |
Result | EB2InteractionResult | Result of this action once it stops playing (Finish/Failed/Canceled) |
SelfEntityId | FB1EntityId | Entity id performing this action |
StartActionTickTime | integer | Tick timestamp used to measure elapsed action execution time for mission tracking |
State | EB2ActionState | Current lifecycle state of this action |
TalkInstanceId | FB1TalkInstanceId | Id of the talk instance this action is linked to, set externally by FB2InteractionPlayer::LinkActions() |
TalkSubjectEntityId | FB1EntityId | Entity id of the talk subject linked to this action, set externally by FB2InteractionPlayer::LinkActions()/OnTalkSpaceParamChanged() |
TargetEntityId | FB1EntityId | Entity id targeted by this action |
TickCalcValue | number | Accumulated tick delta time since this action started ticking |
TimeTaskId | FB1TimeTaskId | Id of the scheduled time task used for delayed Determine/Finish |
bIsWaitFinishEvent | boolean | Cached copy of Action.IsWaitFinishAction taken at Init(); read directly by FB2ActionPlayer for sequencing (the IsWaitFinishAction() getter instead reads Action.IsWaitFinishAction live) |
bMultiFlag | boolean | Set by looping actions (PlayAnim, BookRead, Eat, WaitTalkSequence) once a loop iteration completes; read/reset by FB2ActionPlayer to gate multi-interaction selection |
Functions (47)
| Function | Parameters | Returns | Description |
|---|---|---|---|
AddMergeTypeFlag | InMergeType: EB2ActionMergeType | - | Adds Merge Type Flag. |
CanCancelCondition | - | boolean | Returns whether it can Cancel Condition. |
CanCancelImmediately | - | boolean | Returns whether it can Cancel Immediately. |
CanMergeAction | - | boolean | Returns whether it can Merge Action. |
CanPauseCondition | - | boolean | Returns whether it can Pause Condition. |
CanStartCondition | - | boolean | Returns whether it can Start Condition. |
CanStartSubAction | - | boolean | Returns whether it can Start Sub Action. |
CancelInteraction | Reason: EB1InteractionCancelReason | - | Cleans up B2ActionPlayer@StandByActions and cancels the interaction when the Action itself ends up in an Invalid situation. |
GetActionInfo | - | FB1ActionInfo | Returns Action Info. |
GetActionMergeType | - | EB2ActionMergeType | Returns Action Merge Type. |
GetActionOneLoopPlayLength | - | number | Returns 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 | - | EB2ActionAutoInsertType | Returns Auto Insert Action Type. |
GetCancelReason | - | EB1InteractionCancelReason | Returns Cancel Reason. |
GetCurrentInteractionPlayReason | - | EB1InteractionPlayReason | Returns Current Interaction Play Reason. |
GetGrabEntityId | - | FB1EntityId | Returns Grab Entity Id. |
GetMultiFlag | - | boolean | Returns Multi Flag. |
GetNonTargetLocation | - | FVector | Returns Non Target Location. |
GetPlayingComponentName | - | string | Returns Playing Component Name. |
GetProgressTime | - | number | Returns Progress Time. |
GetResult | - | EB2InteractionResult | Returns Result. |
GetSelfEntityId | - | FB1EntityId | Returns Self Entity Id. |
GetState | - | EB2ActionState | Returns State. |
GetTargetEntityId | - | FB1EntityId | Returns Target Entity Id. |
GetType | - | EB1ActionType | Returns Type. |
HasAnyMergeTypeFlags | InMergeType: EB2ActionMergeType | boolean | Returns whether it has Any Merge Type Flags. |
HasCustomProgressTime | - | boolean | Returns whether it has Custom Progress Time. |
IsAccumulatingProgressTime | - | boolean | Returns whether Accumulating Progress Time. |
IsAutoChangePostureInserted | - | boolean | Returns whether Auto Change Posture Inserted. |
IsAutoInsertAction | - | boolean | Returns whether Auto Insert Action. |
IsNeedAutoInsertWalkAction | - | boolean | Returns whether Need Auto Insert Walk Action. |
IsPaused | - | boolean | Returns whether Paused. |
IsSafeMove | - | boolean | Returns whether Safe Move. |
IsWaitFinishAction | - | boolean | Returns whether Wait Finish Action. |
IsWalkToAction | - | boolean | Returns whether Walk To Action. |
OnCanceled | - | - | Callback invoked on Canceled. |
OnFinish | - | - | Callback invoked on Finish. |
OnPaused | - | - | Callback invoked on Paused. |
OnPlay | - | - | Callback invoked on Play. |
OnTick | DeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number | - | Callback invoked on Tick. |
RemoveMergeTypeFlag | InMergeType: EB2ActionMergeType | - | Removes Merge Type Flag. |
RequestDetermine | - | - | Requests Determine. |
ResetMultiFlag | - | - | Resets Multi Flag. |
SetAutoInsertActionType | InType: EB2ActionAutoInsertType | - | Sets Auto Insert Action Type. |
SetMergeType | InMergeType: EB2ActionMergeType | - | Sets Merge Type. |
ShouldCancelInteraction | - | boolean | Returns whether it should Cancel Interaction. |
TryFinish | InFailReason: EB2InteractionFailReason | - | |
TryRunNotifyScript | InSelfEntityId: FB1EntityId, InTargetEntityId: FB1EntityId | - |
Override points (5)
Implement these in Lua as FB2Action_Base.Override_Name = function(...) end.
| Function | Parameters | Returns | Description |
|---|---|---|---|
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_OnTick | DeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number | - | Timing hook called every tick while the action runs. (performance-sensitive) |