Skip to main content

B2Action_Arrest

  • Description
    * ===============
    * Closing beat of a police arrest: plays the officer's staging animation and hands down the verdict a single time,
    * F2 seconds into that animation, or at its normal finish when F2 is 0. S2 forces a specific choice card; leaving it empty lets the action decide the outcome and
    * take whatever UB1CrimeDataAsset names for it - a script, a choice card or both. The outcomes, in the order they win:
    * a city travel ends the trip and jails the criminal back home - the only outcome not settled on the spot, so its ScriptId
    * runs on arrival instead of now and no card is opened - an already scheduled trial makes it a repeat offense, then the
    * criminal's crime tags pick between a trial, a fine and a plain release.
    * Keep BaseObject on Self - data validation forbids a Target action from waiting for its animation, and the animation
    * has to play out for F2 to be reached. Cards are always sent from the officer to the criminal.
    * The owning bag is a self interaction with no TargetFilter, so the queued target entity is the criminal and it is
    * pinned at OnPlay time; the officer's aggro chase target is only a fallback for entry points that pass no target.
    * Facing is not handled here - the aggro system rotates the officer toward the target before firing the arrival bag.
    * A staging canceled before the verdict lands produces none and refreshes the chase aggro so it is retried.
    * One already handed down is kept when the action is canceled afterwards, and the interaction's
    * CancelScriptIdList releases the arrest mark.
    * S2, and every card UB1CrimeDataAsset names, is a ChoiceCard row rather than a ChoiceCardGroup - group level card
    * selection and Sender/Receiver are bypassed. Branch severity on the answers (ChoiceCardAnswer.ConditionId) rather
    * than on a card level ConditionId, which is not evaluated the same way on every path.
    * ===============
    * Param:
    * S1: Staging animation id (AnimCharacter_), consumed by FB2Action_PlayAnim
    S2: ChoiceCard id forced when the verdict lands. None lets the crime tags decide the verdict
    * F1: Loop count of the montage's Loop section, consumed by FB2Action_PlayAnim
    * F2: Seconds into the animation at which the verdict lands. 0 waits for the action to finish
    * Note:
    * OnInit(): Reads the forced choice card from Action.S2 and the verdict timing from Action.F2.
    * OnPlay(): Pins the criminal and marks them as under arrest. When B2ArrestHelper::CanArrest denies it (another officer
    * already staging, for example) only the verdict is suppressed - the animation still plays so the officer does
    * not end up frozen while the rest of the sequence keeps going.
    * OnTick(): Applies the verdict once F2 seconds of the animation have played, so the card opens on the beat the officer
    * takes aim rather than after the whole staging has finished. This is the intended timing.
    * OnFinish(): Applies the verdict as a fallback, only when the action finished normally and the timer did not land one -
    * an F2 left at 0, or set past the animation length, would otherwise never produce a verdict. The mark is kept when a verdict
    * was applied so a later branch in the same sequence cannot hand down a second one, and the interaction's
    * Finish/CancelScriptIdList releases it; otherwise it is released here. The chase aggro is dropped
    * here too - the staging played out, so this attempt is spent.
    * OnCanceled(): Releases the arrest mark, unless a verdict already landed - then the interaction's script releases it.
    * With no verdict the chase aggro is refreshed so the aggro tick fires the arrest again, unless the
    * user canceled it themselves. Checked after the release so its own mark does not block it.
PropertyTypeDescriptionMetadata
ChoiceCardIdFNameChoiceCard that overrides the verdict when set, resolved from Action.S2
CriminalEntityIdFB1EntityIdCriminal pinned at OnPlay so a later aggro reorder cannot split the aimed-at target from the card receiver
bArrestMarkedboolWhether the arrest mark was granted, so a restored action skips the CanArrest gate and the release runs at most once
bSuppressVerdictboolSet when the arrest did not qualify - the animation still plays but no verdict is handed down.
Suppresses every verdict path, the fine and release scripts included, not just the card
bVerdictAppliedboolWhether a verdict already landed, so the finish fallback stays quiet and the timer cannot repeat it
VerdictDelaySecondsfloatSeconds into the animation at which the verdict lands, read from Action.F2. 0 leaves it to the action's finish,
and the tick zeroes it once the moment passes so a verdict that failed is not retried every frame
ElapsedSecondsfloatSeconds this action has been playing, compared against VerdictDelaySeconds
AnimationIdFNameAnimation id to play, resolved via the overridable GetAnimationId() hook
LoopCountint32Requested number of times to play the montage's Loop section (0 normalized to 1, -1 means infinite)
RemainLoopCountint32Remaining loop iterations, decremented each time the Loop section finishes; drives when looping stops
StartLocationFVectorReferenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-vector default
StartRotationFRotatorReferenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-rotator default
AnimMontageNameFNameResolved montage asset name used to play/track the animation, set by SetAnim()
SectionNameFNameCurrent montage section of MAIN ANIMATION (Default/Loop/End), tracked via montage delegates and used to drive finish/cancel decisions
PlayingComponentNameFNameAnim 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.
TotalPlayLengthfloatTotal play length of the resolved montage, used in progress-time and one-loop-length calculations
LoopPlayLengthfloatPlay length of a single loop of the resolved montage, used in progress-time calculation
RateScalefloatPlayback rate scale of the resolved montage, used in progress-time calculation
PausedboolWhether the montage is currently held in a paused blend state
PhaseEB2PlayAnimPhasePhase of PlayAnim Action
AddOnAnimDataFB2AddOnAnimDataAddOnAnim Data
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)