Skip to main content

FB2Action_Buy

Overview

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

Metadata

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

Properties (11)

NameTypeDescription
AnimMontageNamestringResolved pick-up montage row id; empty means the target isn't a carriable object (goes straight to inventory placement)
BuyPolicyTypeEB1BuyPolicyTypePurchase policy.
CarryHandStyleEB1CarryHandStyleOne-hand/two-hand/assist carry style for the target object, resolved from its object template
FakeObjectListFB1EntityId[]Grouped child objects moved to the seller's site inventory and replaced with fake sold-out stand-ins when the buyer's inventory placement fails
GrabIdstringGrab table id of the target carriable object, used to resolve pick-up/loop hand animations and set the held grab id
GrabLoopAnimIdstringResolved hold-loop grab animation id (hand-converted), preloaded here so it's ready when the hold loop is later synced
PickUpAnimIdstringResolved pick-up grab animation id (hand-converted), used to find the pick-up montage and posture info
PostureComponentanyCached PostureComponent of the self character, used to manage pick-up context and grab id through the action's lifecycle
SelectedHandEB1HandTypeHand chosen to hold the purchased/carried object
bIsTargetOnSaleInFleaMarketbooleanWhether the target was on sale via the flea market, used on finish to price it through B2FleaMarketHelper instead of the object's own sale price
bUseFakeObjectbooleanSet true whenever a child object is added to FakeObjectList (the actual data OnFinish uses to spawn fake objects); this flag itself is never read

Functions (5)

FunctionParametersReturnsDescription
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_Buy.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)