Skip to main content

FB2Action_Eat

Overview

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

Metadata

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

Properties (6)

NameTypeDescription
FoodObjectanyFood game object being eaten
HeadAnimIdstringAnimation id for the head/facial eating montage, provided via the action's S2 param
HeadAnimMontageNamestringResolved montage name for the head anim, used to play the facial eating montage
PrevRemainCalorienumberFood's remaining calorie value captured at action start, used to compute consumed calories on finish
ProgressTimenumberTotal duration required to eat the food, computed from remaining calories and time-to-eat
SelectedHandEB1HandTypeHand holding the food object, used to select the one-hand eating animation variant

Functions (6)

FunctionParametersReturnsDescription
GetActionOneLoopPlayLength-numberReturns Action One Loop Play Length.
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_Eat.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)