B2Action_Eat
- Description
* ===============
* Plays the root and head anim montages for eating a food object through Start/Loop/End sections,
* accumulating progress based on the food's remaining time-to-eat and calories, and running the food table's start/tick/finish scripts.
* ===============
* Param:
* S1: -
* S2: Head animation id to play while eating
* F1: -
* F2: -
* Note:
* OnInit(): Resolves the food object and its table row, computes ProgressTime from remaining calories/time-to-eat, resolves root/head anim ids, and queues their async load.
* OnPlay(): Re-resolves the food object and anim ids, resets section/time state, starts the Start-section montage, and runs the food table's start scripts.
* OnFinish(): Resets montage delegates, syncs grab-loop animation, and on success runs finish scripts, reports the eaten food to the mission system, and adds calories.
* OnCanceled(): Adds accumulated calories and, if the interaction should be canceled, plays the End-section montage.
* OnTick(): Finishes early if the food object became invalid; while in the Loop section, accumulates eat time on the food, ends early if the food is emptied, and runs tick scripts.
| Property | Type | Description | Metadata |
|---|---|---|---|
| HeadAnimId | FName | Animation id for the head/facial eating montage, provided via the action's S2 param | |
| HeadAnimMontageName | FName | Resolved montage name for the head anim, used to play the facial eating montage | |
| ProgressTime | float | Total duration required to eat the food, computed from remaining calories and time-to-eat | |
| PrevRemainCalorie | float | Food's remaining calorie value captured at action start, used to compute consumed calories on finish | |
| SelectedHand | EB1HandType | Hand holding the food object, used to select the one-hand eating animation variant | |
| AnimationId | FName | Animation id to play, resolved via the overridable GetAnimationId() hook | |
| LoopCount | int32 | Requested number of times to play the montage's Loop section (0 normalized to 1, -1 means infinite) | |
| RemainLoopCount | int32 | Remaining loop iterations, decremented each time the Loop section finishes; drives when looping stops | |
| StartLocation | FVector | Referenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-vector default | |
| StartRotation | FRotator | Referenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-rotator default | |
| AnimMontageName | FName | Resolved montage asset name used to play/track the animation, set by SetAnim() | |
| SectionName | FName | Current montage section of MAIN ANIMATION (Default/Loop/End), tracked via montage delegates and used to drive finish/cancel decisions | |
| PlayingComponentName | FName | Anim 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. | |
| TotalPlayLength | float | Total play length of the resolved montage, used in progress-time and one-loop-length calculations | |
| LoopPlayLength | float | Play length of a single loop of the resolved montage, used in progress-time calculation | |
| RateScale | float | Playback rate scale of the resolved montage, used in progress-time calculation | |
| Paused | bool | Whether the montage is currently held in a paused blend state | |
| Phase | EB2PlayAnimPhase | Phase of PlayAnim Action | |
| AddOnAnimData | FB2AddOnAnimData | AddOnAnim Data | |
| ActionId | FName | Identifier of this action instance (used for interaction tracking and mission time accounting) | |
| State | EB2ActionState | Current lifecycle state of this action | |
| MergeType | EB2ActionMergeType | Merge type flags for this action (e.g. interaction merge, checked in Finish()) | |
| Result | EB2InteractionResult | Result of this action once it stops playing (Finish/Failed/Canceled) | |
| SelfEntityId | FB1EntityId | Entity id performing this action | |
| TargetEntityId | FB1EntityId | Entity id targeted by this action | |
| GrabEntityId | FB1EntityId | Entity id grabbed/carried by self entity for this action | |
| NonTargetLocation | FVector | Location used for script/condition context when there is no target entity | |
| Action | FB1ActionInfo | Action table data (S1/S2/F1/F2, script id lists, etc.) driving this instance | |
| TickCalcValue | float | Accumulated tick delta time since this action started ticking | |
| CurrentNotifyIndex | int32 | Index into Action.NotifyScriptIds for the next notify script to run | |
| AsyncLoadAnimInfo | TArray | Animations to async-load for this action's start/notify/tick/finish/cancel scripts | |
| AddActionTimeInterval | float | Interval in seconds between OnTickAddActionExecuteTime() calls | |
| AccumAddActionTime | float | Elapsed time accumulator compared against AddActionTimeInterval | |
| StartActionTickTime | int64 | Tick timestamp used to measure elapsed action execution time for mission tracking | |
| ActionKey | FB2ActionKey | Key identifying this action's slot/queue within the interaction system | |
| TimeTaskId | FB1TimeTaskId | Id of the scheduled time task used for delayed Determine/Finish | |
| IsForceCancelable | bool | Whether this action is force-cancelable, copied from Action.IsForceCancelable | |
| IsFirstAction | bool | Marks the first action in an interaction sequence; set on actions[0] by FB2InteractionPlayer::LinkActions(), read by FB2ActionPlayer | |
| bMultiFlag | bool | Set by looping actions (PlayAnim, BookRead, Eat, WaitTalkSequence) once a loop iteration completes; read/reset by FB2ActionPlayer to gate multi-interaction selection | |
| 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() | |
| bIsWaitFinishEvent | bool | Cached copy of Action.IsWaitFinishAction taken at Init(); read directly by FB2ActionPlayer for sequencing (the IsWaitFinishAction() getter instead reads Action.IsWaitFinishAction live) | |
| AutoInsertType | EB2ActionAutoInsertType | Type of action that was auto-inserted before this one (e.g. WalkTo, ChangePosture) |