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.
| Property | Type | Description | Metadata |
|---|---|---|---|
| ChoiceCardId | FName | ChoiceCard that overrides the verdict when set, resolved from Action.S2 | |
| CriminalEntityId | FB1EntityId | Criminal pinned at OnPlay so a later aggro reorder cannot split the aimed-at target from the card receiver | |
| bArrestMarked | bool | Whether the arrest mark was granted, so a restored action skips the CanArrest gate and the release runs at most once | |
| bSuppressVerdict | bool | Set 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 | |
| bVerdictApplied | bool | Whether a verdict already landed, so the finish fallback stays quiet and the timer cannot repeat it | |
| VerdictDelaySeconds | float | Seconds 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 | |
| ElapsedSeconds | float | Seconds this action has been playing, compared against VerdictDelaySeconds | |
| AnimationId | FName | Animation id to play, resolved via the overridable GetAnimationId() hook | |
| LoopCount | int32 | Requested number of times to play the montage's Loop section (0 normalized to 1, -1 means infinite) | |
| RemainLoopCount | int32 | Remaining loop iterations, decremented each time the Loop section finishes; drives when looping stops | |
| StartLocation | FVector | Referenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-vector default | |
| StartRotation | FRotator | Referenced in GetLogString() for debug logging, but never assigned by this class or any subclass - the log always shows the zero-rotator default | |
| AnimMontageName | FName | Resolved montage asset name used to play/track the animation, set by SetAnim() | |
| SectionName | FName | Current montage section of MAIN ANIMATION (Default/Loop/End), tracked via montage delegates and used to drive finish/cancel decisions | |
| PlayingComponentName | FName | Anim 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. | |
| TotalPlayLength | float | Total play length of the resolved montage, used in progress-time and one-loop-length calculations | |
| LoopPlayLength | float | Play length of a single loop of the resolved montage, used in progress-time calculation | |
| RateScale | float | Playback rate scale of the resolved montage, used in progress-time calculation | |
| Paused | bool | Whether the montage is currently held in a paused blend state | |
| Phase | EB2PlayAnimPhase | Phase of PlayAnim Action | |
| AddOnAnimData | FB2AddOnAnimData | AddOnAnim Data | |
| ActionId | FName | Identifier of this action instance (used for interaction tracking and mission time accounting) | |
| State | EB2ActionState | Current lifecycle state of this action | |
| MergeType | EB2ActionMergeType | Merge type flags for this action (e.g. interaction merge, checked in Finish()) | |
| Result | EB2InteractionResult | Result of this action once it stops playing (Finish/Failed/Canceled) | |
| SelfEntityId | FB1EntityId | Entity id performing this action | |
| TargetEntityId | FB1EntityId | Entity id targeted by this action | |
| GrabEntityId | FB1EntityId | Entity id grabbed/carried by self entity for this action | |
| NonTargetLocation | FVector | Location used for script/condition context when there is no target entity | |
| Action | FB1ActionInfo | Action table data (S1/S2/F1/F2, script id lists, etc.) driving this instance | |
| TickCalcValue | float | Accumulated tick delta time since this action started ticking | |
| CurrentNotifyIndex | int32 | Index into Action.NotifyScriptIds for the next notify script to run | |
| AsyncLoadAnimInfo | TArray | Animations to async-load for this action's start/notify/tick/finish/cancel scripts | |
| AddActionTimeInterval | float | Interval in seconds between OnTickAddActionExecuteTime() calls | |
| AccumAddActionTime | float | Elapsed time accumulator compared against AddActionTimeInterval | |
| StartActionTickTime | int64 | Tick timestamp used to measure elapsed action execution time for mission tracking | |
| ActionKey | FB2ActionKey | Key identifying this action's slot/queue within the interaction system | |
| TimeTaskId | FB1TimeTaskId | Id of the scheduled time task used for delayed Determine/Finish | |
| IsForceCancelable | bool | Whether this action is force-cancelable, copied from Action.IsForceCancelable | |
| IsFirstAction | bool | Marks the first action in an interaction sequence; set on actions[0] by FB2InteractionPlayer::LinkActions(), read by FB2ActionPlayer | |
| bMultiFlag | bool | Set by looping actions (PlayAnim, BookRead, Eat, WaitTalkSequence) once a loop iteration completes; read/reset by FB2ActionPlayer to gate multi-interaction selection | |
| TalkInstanceId | FB1TalkInstanceId | Id of the talk instance this action is linked to, set externally by FB2InteractionPlayer::LinkActions() | |
| TalkSubjectEntityId | FB1EntityId | Entity id of the talk subject linked to this action, set externally by FB2InteractionPlayer::LinkActions()/OnTalkSpaceParamChanged() | |
| bIsWaitFinishEvent | bool | Cached copy of Action.IsWaitFinishAction taken at Init(); read directly by FB2ActionPlayer for sequencing (the IsWaitFinishAction() getter instead reads Action.IsWaitFinishAction live) | |
| AutoInsertType | EB2ActionAutoInsertType | Type of action that was auto-inserted before this one (e.g. WalkTo, ChangePosture) |