FB2Action_Buy
Overview
- Buy action. Override the OnPlay/OnFinish/OnPaused/OnCanceled/OnTick timing hooks in Lua.
Metadata
| Field | Value |
|---|---|
| Kind | action |
| Environment | B2 - Simulation |
| Category | actions |
| Extends | FB2Action_Base |
| Require | require('Actions.B2Action_Buy') |
Properties (11)
| Name | Type | Description |
|---|---|---|
AnimMontageName | string | Resolved pick-up montage row id; empty means the target isn't a carriable object (goes straight to inventory placement) |
BuyPolicyType | EB1BuyPolicyType | Purchase policy. |
CarryHandStyle | EB1CarryHandStyle | One-hand/two-hand/assist carry style for the target object, resolved from its object template |
FakeObjectList | FB1EntityId[] | 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 |
GrabId | string | Grab table id of the target carriable object, used to resolve pick-up/loop hand animations and set the held grab id |
GrabLoopAnimId | string | Resolved hold-loop grab animation id (hand-converted), preloaded here so it's ready when the hold loop is later synced |
PickUpAnimId | string | Resolved pick-up grab animation id (hand-converted), used to find the pick-up montage and posture info |
PostureComponent | any | Cached PostureComponent of the self character, used to manage pick-up context and grab id through the action's lifecycle |
SelectedHand | EB1HandType | Hand chosen to hold the purchased/carried object |
bIsTargetOnSaleInFleaMarket | boolean | Whether 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 |
bUseFakeObject | boolean | Set 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)
| Function | Parameters | Returns | Description |
|---|---|---|---|
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. |
Override points (5)
Implement these in Lua as FB2Action_Buy.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) |