Skip to main content

B2Action_Buy

  • Description
    * ===============
    * Handles acquiring a purchased/saleable game object: plays a pick-up grab animation for carriable objects (or otherwise places it directly into inventory/site storage), then on finish settles currency payment between buyer and seller, applying HouseholdBiz pricing/ledger rules when bought from a business.
    * ===============
    * Param:
    * S1: BuyPolicyType - purchase policy (e.g. Default vs HouseholdBiz), parsed via NAME2ENUM
    * S2: -
    * F1: -
    * F2: -
    * Note:
    * OnInit(): parses BuyPolicyType, caches the self character's PostureComponent, and for carriable targets determines hand/grab style and resolves the pick-up montage.
    * OnPlay(): plays the pick-up montage for carriable objects, or otherwise places the object directly into the buyer's inventory/home site inventory (spawning fake sold-out replacements for grouped children when needed).
    * OnFinish(): syncs the grab-hold loop animation and posture state, then charges the buyer and pays the seller (or runs the HouseholdBiz currency-transfer/ledger/desire-gauge/quality-evaluation flow when BuyPolicyType is HouseholdBiz), removing the object from sale and spawning fake sold-out replacements.
    * OnCanceled(): restores posture pick-up context and, if the grab notify had already fired, records the grabbed entity as the last-grabbed object.
PropertyTypeDescriptionMetadata
GrabIdFNameGrab table id of the target carriable object, used to resolve pick-up/loop hand animations and set the held grab id
PickUpAnimIdFNameResolved pick-up grab animation id (hand-converted), used to find the pick-up montage and posture info
GrabLoopAnimIdFNameResolved hold-loop grab animation id (hand-converted), preloaded here so it's ready when the hold loop is later synced
AnimMontageNameFNameResolved pick-up montage row id; empty means the target isn't a carriable object (goes straight to inventory placement)
bUseFakeObjectboolSet true whenever a child object is added to FakeObjectList (the actual data OnFinish uses to spawn fake objects); this flag itself is never read
bIsTargetOnSaleInFleaMarketboolWhether 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
SelectedHandEB1HandTypeHand chosen to hold the purchased/carried object
CarryHandStyleEB1CarryHandStyleOne-hand/two-hand/assist carry style for the target object, resolved from its object template
FakeObjectListTArrayGrouped child objects moved to the seller's site inventory and replaced with fake sold-out stand-ins when the buyer's inventory placement fails
BuyPolicyTypeEB1BuyPolicyTypePurchase policy (Default vs HouseholdBiz) parsed from Action.S1, selecting the payment/pricing flow used in OnFinish
ActionIdFNameIdentifier of this action instance (used for interaction tracking and mission time accounting)
StateEB2ActionStateCurrent lifecycle state of this action
MergeTypeEB2ActionMergeTypeMerge type flags for this action (e.g. interaction merge, checked in Finish())
ResultEB2InteractionResultResult of this action once it stops playing (Finish/Failed/Canceled)
SelfEntityIdFB1EntityIdEntity id performing this action
TargetEntityIdFB1EntityIdEntity id targeted by this action
GrabEntityIdFB1EntityIdEntity id grabbed/carried by self entity for this action
NonTargetLocationFVectorLocation used for script/condition context when there is no target entity
ActionFB1ActionInfoAction table data (S1/S2/F1/F2, script id lists, etc.) driving this instance
TickCalcValuefloatAccumulated tick delta time since this action started ticking
CurrentNotifyIndexint32Index into Action.NotifyScriptIds for the next notify script to run
AsyncLoadAnimInfoTArrayAnimations to async-load for this action's start/notify/tick/finish/cancel scripts
AddActionTimeIntervalfloatInterval in seconds between OnTickAddActionExecuteTime() calls
AccumAddActionTimefloatElapsed time accumulator compared against AddActionTimeInterval
StartActionTickTimeint64Tick timestamp used to measure elapsed action execution time for mission tracking
ActionKeyFB2ActionKeyKey identifying this action's slot/queue within the interaction system
TimeTaskIdFB1TimeTaskIdId of the scheduled time task used for delayed Determine/Finish
IsForceCancelableboolWhether this action is force-cancelable, copied from Action.IsForceCancelable
IsFirstActionboolMarks the first action in an interaction sequence; set on actions[0] by FB2InteractionPlayer::LinkActions(), read by FB2ActionPlayer
bMultiFlagboolSet by looping actions (PlayAnim, BookRead, Eat, WaitTalkSequence) once a loop iteration completes; read/reset by FB2ActionPlayer to gate multi-interaction selection
TalkInstanceIdFB1TalkInstanceIdId of the talk instance this action is linked to, set externally by FB2InteractionPlayer::LinkActions()
TalkSubjectEntityIdFB1EntityIdEntity id of the talk subject linked to this action, set externally by FB2InteractionPlayer::LinkActions()/OnTalkSpaceParamChanged()
bIsWaitFinishEventboolCached copy of Action.IsWaitFinishAction taken at Init(); read directly by FB2ActionPlayer for sequencing (the IsWaitFinishAction() getter instead reads Action.IsWaitFinishAction live)
AutoInsertTypeEB2ActionAutoInsertTypeType of action that was auto-inserted before this one (e.g. WalkTo, ChangePosture)