Skip to content

Sein Ability

Class · USeinAbility : UObject

#include "Abilities/SeinAbility.h"

abstract: use a subclass · can be subclassed in Blueprint · deterministic: safe in simulation code

Base class for all abilities in the SeinARTS framework. Designers subclass this in Blueprint to define ability behavior.

Abilities are deterministic and tick on the simulation side. They support cooperative suspension via latent actions (no threads).

Ends this ability normally and calls On End with bWasCancelled false.

void EndAbility();

Forces this ability to terminate and calls On End with bWasCancelled true.

void CancelAbility();

Overridable in Blueprint, with a native default

Checks proposed inputs before costs or cancellation. Read values with Get Activation Input. False rejects the request; the default accepts it. The running activation’s variables remain unchanged during this check.

bool CanActivateWithInputs(const FSeinAbilityActivationInputs& Inputs) const;

Overridable in Blueprint, with a native default

Adds a final deterministic activation rule for the proposed Target and Location (either may be unset). Return false to reject the command; the default returns true.

Runs after cooldown, tag, target, line-of-sight, and pathability checks, but before resource deduction, cancellation arbitration, and On Activate. The UI also asks it every frame whether to enable the ability’s button, so it only reads: it cannot change the ability’s variables.

bool CanActivate(FSeinEntityHandle Target, FFixedVector Location) const;

Overridable in Blueprint, with a native default

Starts the committed ability. Initialize deterministic state and launch admitted actions here; the default does nothing.

This event does not complete the ability. Call End Ability on natural completion or Cancel Ability for forced termination.

void OnActivate();

Overridable in Blueprint, with a native default

Advances the ability once per fixed simulation tick. Delta Time is in simulation seconds; the default does nothing.

void OnTick(FFixedPoint DeltaTime);

Overridable in Blueprint, with a native default

Performs final cleanup after the active index, owned tags, funding policy, and latent actions have been finalized. The default does nothing.

bWasCancelled is true for forced termination and false after End Ability.

void OnEnd(bool bWasCancelled);

FText AbilityName

Editable in class defaults · Blueprint read-only

Player-facing name used by action buttons and other UI.

FGameplayTag AbilityTag

Editable in class defaults · Blueprint read-only

Stable gameplay tag used to grant, resolve, dispatch, and activate this ability. The SeinARTS Ability factory generates a unique tag from the asset name; keep it valid and unique if you take manual ownership.

bool bAutoGeneratedTag · default false

Read-only in Details · Blueprint read-only

True when the framework owns this generated identity. Content Browser renames migrate its tag hierarchy and references automatically. Editing the tag manually surrenders generated ownership; Initialize Tag restores generation from the asset name.

TObjectPtr<UTexture2D> Icon · default nullptr

Editable in class defaults · Blueprint read-only

Icon shown on action-bar buttons / queue slots / radial menus that surface this ability. Optional — UI fallbacks render the AbilityName text when null. Designers ship a 64x64 (or whatever your HUD calls for) Texture2D per ability.

ESeinAbilityTargetType TargetType · default ESeinAbilityTargetType::None

Editable in class defaults · Blueprint read-only

The target input this ability expects. Action buttons use it to decide what to capture. Whether the ability runs by itself is set by Is Passive, not by this value.

bool bIsPassive · default false

Editable in class defaults · Blueprint read-only

Runs this ability automatically when its first grant is committed. Passive abilities occupy the passive set instead of the single primary slot and remain active until revoked or explicitly ended.

FSeinResourceCost ResourceCost

Editable in class defaults · Blueprint read-only

Resources committed when activation succeeds. Cost Timing decides whether production-catalog completion amounts are deferred to the queue item.

ESeinAbilityCostTiming CostTiming · default ESeinAbilityCostTiming::Immediate

Editable in class defaults · Blueprint read-only

Payment timing for ResourceCost. Keep Immediate for ordinary abilities. Use Production Queue only when OnActivate transfers its funding snapshot through EnqueueProduction.

bool bRefundCostOnCancel · default true

Editable in class defaults · Blueprint read-only

Refunds the exact activation-cost snapshot when the ability is cancelled. Leave enabled when cancellation should undo the committed spend; disable it when cancellation intentionally consumes the cost.

FFixedPoint Cooldown

Editable in class defaults · Blueprint read-only

Cooldown duration in sim-seconds.

ESeinCooldownStartTiming CooldownStartTiming · default ESeinCooldownStartTiming::OnActivate

Editable in class defaults · Blueprint read-only

Chooses whether the cooldown begins on successful activation or natural end.

ESeinCooldownScope CooldownScope · default ESeinCooldownScope::OwnerOnly

Editable in class defaults · Blueprint read-only

Owner Only starts this ability’s cooldown. Shared Group also starts the matching ability on current members of a group that enables cooldown sharing. Ordinary temporary selections do not enable sharing.

bool bRefundCooldownOnCancel · default false

Editable in class defaults · Blueprint read-only

Clears cooldowns last started by this activation when it is cancelled, including its captured shared-group recipients even if they leave the group. Cooldowns replaced by a later activation are retained. Earlier overwritten cooldowns are not restored. Leave disabled when cancellation consumes cooldown.

ESeinAbilityDispatchMode DispatchMode · default ESeinAbilityDispatchMode::All

Editable in class defaults · Blueprint read-only

How this ability fans out across broker members when triggered from a multi-member context. Default All: every member that holds an instance fires it. See the ESeinAbilityDispatchMode docblock for the full pattern catalog.

ESeinAbilityDispatchSelector DispatchSelector · default ESeinAbilityDispatchSelector::Leader · shown when DispatchMode == ESeinAbilityDispatchMode::Single

Editable in class defaults · Blueprint read-only

When DispatchMode == Single, picks which member fires. Ignored for All / ByTag.

FGameplayTag DispatchPreferredTag · shown when (DispatchMode == ESeinAbilityDispatchMode::Single && DispatchSelector == ESeinAbilityDispatchSelector::ByTag) || DispatchMode == ESeinAbilityDispatchMode::ByTag

Editable in class defaults · Blueprint read-only

Tag the chosen member’s entity tags must contain. Consulted when DispatchSelector == ByTag (Single) or DispatchMode == ByTag. Tag-container .HasTag match — exact tag, no hierarchy descent.

ESeinAbilityDispatchFallback DispatchFallback · default ESeinAbilityDispatchFallback::LeaderFirst · shown when DispatchMode == ESeinAbilityDispatchMode::Single

Editable in class defaults · Blueprint read-only

What to do when DispatchMode == Single AND the selector produced no candidate. Ignored for All / ByTag (those have natural empty-set semantics: silently no-op).

FFixedPoint MaxRange · default FFixedPoint::Zero

Editable in class defaults · Blueprint read-only

Maximum activation distance from owner to target (location or entity). Zero = unlimited.

FGameplayTagQuery ValidTargetTags

Editable in class defaults · Blueprint read-only

Tag query the target entity must satisfy. Empty query = any target allowed.

bool bRequiresLineOfSight · default false

Editable in class defaults · Blueprint read-only

Requires the owner’s player to currently see the target. With fog of war active, activation fails with No Line Of Sight unless that player sees the target, including through shared vision; a target point needs normal sight. With no fog of war the check always passes.

bool bRequiresPathableTarget · default false

Editable in class defaults · Blueprint read-only

Requires the target to be reachable on the navigation grid. An unreachable target rejects the command with SeinARTS.Command.Reject.PathUnreachable. Without a navigation system the check always passes.

bool bRequiresFreeFootprint · default false

Editable in class defaults · Blueprint read-only

Requires the footprint named by Placement to fit, unobstructed, at the position and rotation the targeter captured. Otherwise the command is rejected with SeinARTS.Command.Reject.FootprintBlocked. The placement preview runs the same check. It also rejects when no point was captured, Placement has no class, or the class has no extents.

FSeinPlacementDefinition Placement · shown when bRequiresFreeFootprint

Editable in class defaults · Blueprint read-only

The footprint checked when Requires Free Footprint is on: the Footprint Actor Class, whose authored extents must fit at the captured position and rotation. Set the class; an empty one rejects placement.

ESeinOutOfRangeBehavior OutOfRangeBehavior · default ESeinOutOfRangeBehavior::Reject

Editable in class defaults · Blueprint read-only

Chooses whether an out-of-range command is rejected or deterministically queues the entity’s move ability before retrying this ability.

FFixedPoint AreaRadius · default FFixedPoint::Zero

Editable in class defaults · Blueprint read-only

AoE radius in world units. Drives the default Point-targeter spec’s preview ring when non-zero, and is read by ability OnActivate logic for AoE casts. Zero = single-target / no ring preview. Kept on the ability (not on the spec) so it stays accessible to non-targeter activation paths and to ability validation that doesn’t care which spec is attached.

TObjectPtr<USeinTargeterSpec> TargeterSpec

Editable in class defaults · Blueprint read-only

Optional targeter that captures this ability’s target points when a player triggers it from an action button. Right-click orders ignore it. Leave empty for an ability that is not targeted from a button. A Point or Area ability triggered from a button needs a Point or Point + Facing targeter; a Line targeter captures segments.

FGameplayTagContainer GrantedTags

Editable in class defaults · Blueprint read-only

Tags this ability grants to the entity while active. Granted on activate, ungranted on deactivate. Tag presence is refcounted — overlapping grants from BaseTags, other abilities, or effects stay present until every source has released the tag. Used with CancelAbilitiesWithTag for cross-ability arbitration.

FGameplayTagContainer RequiredEntityTags

Editable in class defaults · Blueprint read-only

Tags the OWNING ENTITY must have to activate. Empty = no entity-tag gate. Use for entity-state preconditions: a Heal ability that requires SeinARTS.State.Damaged on the caster, a Garrison-exit ability that requires SeinARTS.State.InTransport, etc. Entity tags are the union of the entity’s BaseTags + GrantedTags from active abilities/effects.

FGameplayTagContainer RequiredPlayerTags

Editable in class defaults · Blueprint read-only

Tags the OWNING PLAYER must have to activate. Empty = no player-tag gate. This is where tech prerequisites land for production abilities — a SA_TrainTank ability lists SeinARTS.Tech.VehicleAccess here, and the activation gate rejects with SeinARTS.Command.Reject.BlockedByTag if the owning player hasn’t unlocked it.

Distinct from RequiredEntityTags which gates on entity-level tags. Player tags are source-aware, refcounted canonical player state.

FGameplayTagContainer BlockedTags

Editable in class defaults · Blueprint read-only

If the entity has ANY of these tags, this ability refuses to activate. Combine with GrantedTags on the same ability to self-block (e.g., a grenade that grants Ability.State.Channeling and blocks on the same tag cannot reissue while a throw is in progress).

FGameplayTagContainer CancelAbilitiesWithTag

Editable in class defaults · Blueprint read-only

On activate, cancel any currently-active ability (including this one) whose GrantedTags intersect this set. Including this ability’s own GrantedTag here gives you self-cancelling reissue (e.g., repeat-right-click Move).

FSeinEntityHandle OwnerEntity

Blueprint read-only

Entity that owns and executes this runtime ability instance.

FSeinEntityHandle TargetEntity

Blueprint read-only

Entity supplied by the current activation. Invalid for location-only casts.

FFixedVector TargetLocation

Blueprint read-only

Fixed-point world location supplied by the current activation. For an entity target this is the command’s captured location, not a live pointer.

TArray<FSeinTargeterPoint> TargeterPoints

Blueprint read-only

The points the targeter captured for the current activation, one per Target Count. Empty for an order that did not use a targeter. The first point matches Target Location. Cleared when the ability ends.

FFixedPoint CooldownRemaining

Blueprint read-only

Remaining cooldown in simulation seconds. Zero means ready.

bool bIsActive · default false

Blueprint read-only

True while this instance owns an active primary or passive lifecycle.

int64 AbilityActivationID · default 0

Blueprint read-only

World-global deterministic identity of this instance’s current/most recent activation. Zero means it has never activated in this timeline.

FSeinResourceCost DeductedCost

Blueprint read-only

Snapshot of the cost actually deducted on activation. Used for cancellation refunds without re-resolving authored policy. For Production Queue abilities, this contains only the catalog’s AtEnqueue bucket.

FSeinPlayerID ResourcePayer

Blueprint read-only

Principal whose resources funded this activation. Snapshotted so later cancellation and production completion never re-resolve a changed policy.

FSeinResourceCost PendingCompletionCost

Blueprint read-only

Deferred catalog bucket for a Production Queue activation. EnqueueProduction transfers it to the queue entry; Immediate abilities always leave it empty.

bool bCooldownStarted · default false

Blueprint read-only

Whether the cooldown has been started for the current activation. Drives the bRefundCooldownOnCancel + CooldownStartTiming == OnEnd interaction.

C++ members (17)
  • void FindAuthoringProblems(bool bLoadClasses, TArray<FString>& OutProblems) const; Problems with what this ability places, one sentence each: its Placement footprint class must carry an entity bridge. A Blueprint compile warns when the class is already loaded; the match build loads it and fails.
  • int64 GetActivationID() const;
  • TArray<FName> GetActivationInputNames() const; Names admitted as inputs. Native constructors call ExposeActivationInput; Blueprint authors use Expose on Activate.
  • void ExposeActivationInput(FName PropertyName);
  • void InitializeAbility(FSeinEntityHandle Owner, USeinWorldSubsystem* Subsystem);
  • bool ActivateAbility(FSeinEntityHandle Target, FFixedVector Location, const FSeinAbilityActivationInputs& Inputs = FSeinAbilityActivationInputs()); Activate with target entity + location. TargetLocation runtime field is populated; TargeterPoints is left empty (right-click / direct-activation path).
  • bool ActivateAbilityWithTargeterPoints(FSeinEntityHandle Target, FFixedVector Location, const TArray<FSeinTargeterPoint>& Points, const FSeinAbilityActivationInputs& Inputs = FSeinAbilityActivationInputs()); Activate with targeter-captured points. TargetLocation is set to Points[0].Location for single-target convenience; TargeterPoints is populated with the full array. When Points is empty this degrades to the basic ActivateAbility(Target, Location).
  • bool CanCommitGrantedTags() const; Preflight for command processing. Activation still performs a transactional acquisition so direct/native callers receive the same safety guarantee.
  • void TickAbility(FFixedPoint DeltaTime);
  • void DeactivateAbility(bool bCancelled);
  • void TickCooldown(FFixedPoint DeltaTime);
  • bool IsOnCooldown() const;
  • void RecordDeductedCost(const FSeinResourceCost& Cost); Stamp the cost snapshot on activation. Called by ProcessCommands after a successful USeinResourceBPFL::SeinDeduct.
  • void RecordResourcePayer(FSeinPlayerID Payer);
  • void ResolveActivationCosts(const UObject* WorldContextObject, FSeinResourceCost& OutActivationCost, FSeinResourceCost& OutProductionCompletionCost) const; Resolve the exact cost charged by activation and any amount transferred to production completion. Shared by command preflight, commit, and UI reads.
  • void RecordPendingCompletionCost(const FSeinResourceCost& Cost); Stamp the Production Queue completion bucket on activation.
  • int32 GetRuntimePoolID() const; Derived O(1) pool locator; validated against the world’s slot on use.