Skip to content

SeinARTS Ability Library

Class · USeinAbilityBPFL : UBlueprintFunctionLibrary

#include "Lib/SeinAbilityBPFL.h"

deterministic: safe in simulation code

Nodes for granting, revoking, cancelling and issuing abilities, and for reading an entity’s cooldowns and ability availability.

Cancels the currently active primary ability on an entity.

static void SeinCancelAbility(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Grants an ability class to an entity at runtime and returns the ability’s instance ID, or Index None if the entity is invalid, has no Sein Ability Data, or the class is null or abstract. Grants are counted: granting a class the entity already holds adds a reference to the same instance. A passive ability starts running on its first grant; any other ability waits to be activated by a command.

static int32 SeinGrantAbility(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass);

Removes one grant from every ability on the entity whose Ability Tag matches. An ability is destroyed, and cancelled if active, only when its last grant goes. Returns how many abilities were destroyed, not how many grants were removed; compare with Get Ability Grant Count to tell the difference. Use Force Revoke to remove an ability whatever grants remain.

static int32 SeinRevokeAbilityByTag(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag);

Removes one grant of the given ability class from the entity. The ability is destroyed only when its last grant goes. Returns 1 if it was destroyed, otherwise 0. Use it when you hold the class, such as to undo a grant you made.

static int32 SeinRevokeAbilityByClass(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass);

Force-destroy every ability instance on the entity whose AbilityTag matches, **ignoring the grant refcount**. Cancels active, frees pool slot, removes the class from GrantedAbilities. Use sparingly — the designer is asserting that no remaining holders need this ability. Effect-driven holders that later try to revoke will silently no-op (their refcount was zeroed under them).

Returns the number of instances destroyed.

static int32 SeinForceRevokeAbilityByTag(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag);

Force-destroy the entity’s instance of the given ability class, ignoring the grant refcount. See SeinForceRevokeAbilityByTag for the “use sparingly” caveat.

Returns 1 if the instance was destroyed, 0 if the entity didn’t hold it.

static int32 SeinForceRevokeAbilityByClass(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass);

Check whether an entity holds an instance of the given ability class. Companion to SeinHasAbility (which queries by tag). Cheaper than fetching the full ability component just to test existence.

static bool SeinHasAbilityOfClass(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass);

Read the outstanding grant refcount for an entity’s ability of the given class. Returns 0 if the entity doesn’t hold it, otherwise the number of outstanding grants (1 = single source, 2 = two sources, etc.). Useful for designer scripts that want to know “am I the last holder?” before deciding to revoke.

static int32 SeinGetAbilityGrantCount(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass);

Check whether a specific ability is on cooldown

static bool SeinIsAbilityOnCooldown(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag);

Get the remaining cooldown time for a specific ability

static FFixedPoint SeinGetCooldownRemaining(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag);

Check whether an entity has an ability with the given tag

static bool SeinHasAbility(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag);

Returns an advisory check of whether the entity can activate the ability, for enabling buttons. It checks cooldown and required and blocked tags, then range, target tags and visibility when a target or location is supplied, then Can Activate and affordability, and reports the first failure. The queued command stays authoritative and can still be rejected for authority, pathing, footprint or a change of state. Pass no target entity and a zero location to ask whether the ability is usable in principle; pass either to preview one click.

static FSeinAbilityAvailability SeinGetAbilityAvailability(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag, FSeinEntityHandle OptionalTargetEntity, FFixedVector OptionalTargetLocation);

Issue an ability for the entity’s owner on the next tick, from the simulation (an ability chaining into another, such as a placer issuing Build on its new building). Every gate runs as if the player had clicked: authority, cooldown, tags, target, range, visibility, path, Can Activate, cost and cancellation; a rejection carries the failed gate’s reason. Inputs are optional. False outside the simulation.

static bool IssueAbility(const UObject* WorldContextObject, FSeinEntityHandle Entity, FGameplayTag AbilityTag, FSeinEntityHandle TargetEntity, FFixedVector TargetLocation, const FSeinAbilityActivationInputs& Inputs);

Read a proposed input during Can Activate With Inputs. Connect a variable of the input’s exact type to Value. False leaves Value unchanged.

static bool GetInput(const FSeinAbilityActivationInputs& Inputs, TSubclassOf<USeinAbility> AbilityClass, FName Name, int32& Value);

Cancel ALL of the entity’s active latent actions — its move plus any channels / waits / custom latent primitives. Each action’s OnCancel runs. The broad “halt everything this unit is doing.” For movement only, use Stop Movement instead.

static void SeinCancelAllActions(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Cancel the entity’s active latent actions of a specific class (or subclasses) — the selective cancel. Pass USeinMoveToAction to cancel only movement, or a custom latent-action class to cancel just that primitive. Null class = no-op.

static void SeinCancelActionsOfClass(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<USeinLatentAction> ActionClass);

A point the ability’s targeter captured, as a transform: its location, its yaw and a scale of 1. Pass it straight to Spawn Entity or Spawn Construction Site in On Activate.

static FFixedTransform GetTargeterPointTransform(const FSeinTargeterPoint& Point);

The captured point’s yaw, as a rotation with no pitch or roll.

static FFixedRotator GetTargeterPointRotation(const FSeinTargeterPoint& Point);

The captured point’s world location.

static FFixedVector GetTargeterPointLocation(const FSeinTargeterPoint& Point);
C++ members (3)
  • static void SeinActivateAbility(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag AbilityTag, FSeinEntityHandle TargetEntity, FFixedVector TargetLocation); Activates an ability immediately without entering the command queue. This bypasses command authority, tag/target/path/Can Activate checks, Auto Move Then, cost deduction, cancellation arbitration, footprint placement, and command-rejection reporting. It still obeys cooldown, active-slot, owned-tag acquisition, and exact lifecycle ownership: indexes are coherent during callbacks, and a live primary must be ended through the normal cancellation-tag/broker policy before another primary can start. Returns silently on failure (ability missing, on cooldown, already active, or primary slot occupied). C++ only, for low-level code where the gates are intentionally unwanted (cheats, debug commands). One ability triggering another uses Issue Ability, which runs every gate as if the player had clicked.
  • static int32 SeinGrantAbilityFromEffect(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass, int64 EffectInstanceID); Framework-internal source-aware grant used by active effects. The source ID is committed before passive activation and is the only reference a matching effect teardown may later consume.
  • static int32 SeinRevokeAbilityFromEffect(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, TSubclassOf<class USeinAbility> AbilityClass, int64 EffectInstanceID); Consume one grant owned by EffectInstanceID. A missing source record is a no-op even if the same class has since been granted by someone else.