Skip to content

Abilities

An ability is a Blueprint class, a child of Sein Ability, that gives an entity one verb. Move, attack, build, train, mine, a player’s income tick and a match’s victory rule are all abilities.

Because every verb is the same kind of object, an order from a right-click, a HUD button, a computer opponent or another ability passes through the same gates. The framework never needs to know what “attack” means. Your ability does.

An ability is simulation data. Its variables are saved with the match and checked between players, so use Fixed Point for numbers, and never use Delay, timers or Event Tick for gameplay. See Deterministic Simulation.

Right-click in the Content Browser and choose SeinARTS > SeinARTS Ability, pick Generic Ability, and name it with the SA_ prefix. SA_Grenade gets the Ability Tag SeinARTS.Ability.Grenade automatically (see Gameplay Tags).

An entity holds an ability once it is granted. Open the unit’s Sein Abilities component and add the class to Granted Abilities. A tech effect can grant abilities later, and the Grant Ability node grants one from a graph.

The same component holds Default Commands (which ability a right-click picks), Fallback Ability Tag, and Move Ability, the ability that rally points and Auto Move Then use to walk the unit.

Event Runs Use it for
Can Activate As the last gate before the cost check, and every frame for the HUD to enable or grey a button A final yes or no. It only reads; it cannot change variables.
On Activate Once, after the gates pass and the cost is paid Set variables, start work, or finish the job in one step
On Tick (Delta Time) Every simulation tick while the ability is active Timed work: a firing loop, a channel, mining
On End (Was Cancelled) Once, when the ability stops Cleanup

On Activate does not finish the ability. An ability stays active until it calls End Ability (normal completion) or Cancel Ability (forced), or until another order cancels it. An ability that does all its work in On Activate calls End Ability at the end of it.

On Activate runs while the tick’s commands are processed. On Tick runs later in the same tick and then every tick. Delta Time is fixed-point seconds: one thirtieth of a second at the default Simulation Tick Rate of 30.

When an ability ends, either way, its Granted Tags are released and the latent actions it started, such as a Move To, are cancelled. The two endings differ in what they give back:

  • Cancel Ability refunds the activation cost while Refund Cost On Cancel is on, which is the default. It returns a started cooldown only if Refund Cooldown On Cancel is on.
  • End Ability keeps both. A cooldown with Cooldown Start Timing set to On End starts only on End Ability, never on a cancel.

Read-only runtime variables give the running ability its context: Owner Entity, Target Entity, Target Location, Targeter Points and Cooldown Remaining.

Primary Passive
Setting Is Passive off Is Passive on
Starts When a command activates it: a right-click mapping, a button, an AI order, another ability By itself, when it is granted
Gates and cost All of them run None run; a grant is not a command
How many at once One per entity Any number
Ends End Ability, Cancel Ability, or an order that cancels it End Ability, Cancel Ability, being revoked, or an order whose Cancel Abilities With Tag matches its Granted Tags
Typical use Move, Attack, Build, Train Auto-Attack, income, a victory rule

A unit’s one primary slot is its current order. Passives run beside it. A passive on the Player State runs for the player, and one on the Game State runs for the match; Match Flow covers both.

An activation command runs these gates in order. The first failure rejects the command: nothing is paid and the ability does not start.

# Gate Fails when Reject tag
1 Cooldown Cooldown Remaining is above zero SeinARTS.Command.Reject.OnCooldown
2 Blocked Tags The entity has any of them BlockedByTag
3 Required Entity Tags The entity lacks any of them BlockedByTag
4 Required Player Tags The paying player lacks any of them BlockedByTag
5 Max Range The target is farther than the range, and Out Of Range Behavior is Reject OutOfRange
6 Valid Target Tags The target entity fails the tag query InvalidTarget
7 Requires Line Of Sight The player cannot see the target NoLineOfSight
8 Requires Pathable Target No route reaches the target PathUnreachable
9 Requires Free Footprint The footprint overlaps something FootprintBlocked
10 Can Activate With Inputs, Can Activate Either returns false CanActivateFailed
11 Resource Cost The player cannot afford it Unaffordable

Every tag above sits under SeinARTS.Command.Reject. After gate 11 the cost is paid, abilities that Cancel Abilities With Tag names are cancelled, and the ability starts.

Three more rejections come from the entity or the issuer: MissingComponent (the entity has no Sein Abilities), InvalidTarget (it does not hold an ability with that tag) and Unauthorized (the issuing player may not command it). The full list is in the Gameplay Tags reference.

A command runs a few ticks after the click, so a button that looked enabled can still be rejected. The gates decide, not the button.

To find out why an order does nothing:

  • Type Log LogSeinSim Verbose in the console. Each rejected activation logs the gate that stopped it.
  • Bind On Visual Event on the unit’s SeinARTS Entity Bridge. A rejection arrives as a Command Rejected event, and Break Sein Visual Event gives its Reason Tag.
  • For a HUD button, call Get Ability Availability. It reports the first failing reason from gates 1 to 4, Can Activate and the cost, plus the cooldown remaining and whether the ability is active and affordable. Gates 5 to 7 run only when you pass a target entity or a non-zero location.

Target Type says what the ability captures when it is ordered.

Target Type Captures Typical use
None Nothing Train, Stop, passives
Self The owner A self buff
Entity Another entity, in Target Entity Attack, Build, Mine
Point A ground position, in Target Location Move, Place Building
Area A position, with the ability’s Area Radius Grenade, artillery

Max Range is the distance from the owner to the target, 0 for unlimited. For an entity that has Sein Extents, range is measured to the nearest point of its footprint, not its centre, so a large building is in range from its wall.

Valid Target Tags is a tag query on the target entity. It is checked only when the order supplies an entity.

Requires Line Of Sight uses fog of war: the order fails unless the owner’s player sees the target now, shared vision included. With no fog of war in the match it always passes.

Requires Pathable Target rejects an order the unit has no route to.

Out Of Range Behavior chooses between two outcomes for gate 5:

  • Reject fails the order.
  • Auto Move Then queues the unit’s Move Ability, then runs the order again from the start. The unit walks to a point about 50 units outside the target’s footprint, to the target’s center if it has no Sein Extents, or to the target point if there is no entity, and every gate runs again when the move ends. The walk does not stop when the unit comes into range: a unit with Max Range 900 still walks to the target’s edge. The destination is fixed when the order runs, so a target that has moved out of range by then starts another walk. The click-time check only confirms the player can afford it; the cost is paid when the ability finally activates. Without a usable Move Ability, the order is rejected as out of range. An order from within range activates where the unit stands, without moving.

Auto Move Then fixes range only. Gates 1 to 4 run before the walk. Gates 6 to 11 run only after it, so a unit can walk all the way to a target and then be rejected.

Resource Cost is a map of resource tag to amount, paid when the ability activates. See Economy for resources.

Setting Meaning
Cost Timing Immediate pays the whole cost on activation. Production Queue splits it by each resource’s Production Deduction Timing; use it only for abilities that call Enqueue Production.
Refund Cost On Cancel A cancelled ability returns exactly what it paid. On by default.
Cooldown Seconds before the ability can activate again.
Cooldown Start Timing On Activate starts it at once. On End starts it when the ability ends normally.
Cooldown Scope Owner Only cools down this entity. Shared Group also cools down the same ability on members of a group that shares cooldowns; a plain selection does not, so it behaves as Owner Only.
Refund Cooldown On Cancel A cancel clears the cooldown this activation started. Off by default.

Cooldowns count down in simulation seconds. Get Cooldown Remaining and Is Ability On Cooldown read them for the UI. An effect can change an ability’s Max Range, Cooldown or Resource Cost without editing the Blueprint; see Effects and Attributes.

Five tag lists decide which abilities may run together. Tags match by hierarchy: a list entry matches the same tag or any child of it on the other side, so SeinARTS.Ability matches SeinARTS.Ability.Attack.

Setting Use
Granted Tags Tags the entity carries while the ability is active, released when it ends. Other abilities and the HUD read them to know what the unit is doing.
Required Entity Tags The entity must have all of these, such as a Damaged state tag you define for a heal ability.
Required Player Tags The paying player must have all of these. This is where a tech requirement goes.
Blocked Tags The ability refuses to start while the entity has any of these.
Cancel Abilities With Tag On activation, cancel the entity’s running ability whose Granted Tags match.

An entity can have only one running primary ability. Activating a second one directly, for example with Activate Ability, fails while the first is still active unless Cancel Abilities With Tag cancels the first. An unqueued right-click or button order also cancels the ability its unit’s previous order started, whatever the tags. The convention is the same for every order: Granted Tags SeinARTS.Ability.Attack, Cancel Abilities With Tag SeinARTS.Ability. Each order then cancels whichever other order is running.

Two combinations are worth knowing:

  • Put a tag from an ability’s own Granted Tags in its Cancel Abilities With Tag and it cancels and restarts itself when reissued.
  • Put the same tag in Granted Tags and Blocked Tags and it cannot start while it is running.

When several selected units hold an ability, Dispatch Mode decides which of them perform it.

Mode Who performs it
All Every unit that holds the ability. The default; Move and Attack want this.
Single One unit, picked by Dispatch Selector.
By Tag Every unit whose tags include Dispatch Preferred Tag. An empty result does nothing.

For Single, the selector is Leader (the group’s leader, if it has one), By Tag (the first unit with the preferred tag) or First Available. Dispatch Fallback applies when the selector finds nobody: Leader First, First Available, or Fail, which makes the ability unavailable. A plain selection has no leader, so Leader falls through to the fallback.

Place Building uses Single: one Soldier places the Barracks, not all six.

A right-click already has its target, so it needs no targeter. The Default Commands table on Sein Abilities maps the click’s context to an ability. Each row has Required Context tags, an Ability Tag and a Priority. The highest-priority row whose tags are all present wins. The context is SeinARTS.Command.Context.RightClick, one of Target.Ground, Target.Friendly, Target.Neutral or Target.Enemy, and the clicked entity’s own tags. See Gameplay Tags.

A button has no target yet. When a button fires a Point, Area or Entity ability, the Targeter Spec on the ability opens a targeter that captures the points first:

Spec Captures Typical use
Point Targeter Spec One click per point Grenades, area spells
Point + Facing Targeter Spec A press for the point, a drag for the facing Building placement
Line Targeter Spec A segment: a drag, or chained clicks Barrage lines, walls

Every spec has Target Count (how many points to capture, 1 to 16), Preview Class (the actor that draws the feedback) and Reject Click When Blocked. A Point, Area or Entity ability triggered from a button needs a spec; without one the button does nothing and logs a warning.

The captured points arrive in the Targeter Points array. Index 0 also fills Target Location. A point has a Location, an Aux Location (the end of a segment), a Yaw Degrees and a Rotation Step. Get Targeter Point Transform turns one into a transform for Spawn Entity.

The preview is presentation only. The built-in point preview draws nothing until a Blueprint subclass assigns it a decal material. It tints from what the client can check: the spec’s Validate Client rule and, with Requires Free Footprint, the footprint. It does not check range or cost. The simulation checks everything again when the order runs, so a green preview can still be rejected. Custom Targeters builds a ghost and a line targeter.

An order can carry values for an ability’s variables. Select a variable in the ability and tick Expose on Activate. The Activate Ability node then shows a pin for it, and each order captures its own value, assigned before On Activate runs. An order that does not set a pin uses the variable’s default. Can Activate With Inputs can check the proposed values and reject them.

A Soldier throws a grenade that deals 40 damage to every enemy within 300 units of the target point. It reaches 1,200 units, costs 25 Minerals, and recharges for 20 seconds. The damage uses the SC_Health component from Add Combat.

Create SA_Grenade:

Setting Value
Ability Name Throw Grenade
Target Type Area
Area Radius 300
Max Range 1200
Out Of Range Behavior Reject
Resource Cost 25 Minerals
Cooldown 20
Cooldown Start Timing On Activate
Granted Tags SeinARTS.Ability.Grenade
Cancel Abilities With Tag SeinARTS.Ability
Targeter Spec Point Targeter Spec

To gate it behind research, add the tech’s tag to Required Player Tags.

Reject is deliberate. Auto Move Then would walk the Soldier to the target point itself, which is the wrong behavior for a thrown weapon.

In the Event Graph, On Activate:

  1. Make Sein Target Query: Instigator Owner Entity, Origin Target Location, Range Area Radius, Required Component SC_HealthData, Require Line Of Sight off, Max Results 64. The default scorer skips the thrower’s own units, so none of them is hit. A teammate’s units are not skipped.
  2. Find Targets with that query. For each candidate, Apply Field Delta on the candidate’s Target, SC_HealthData field Health, Delta -40, Clamp Min on with Min Value 0.
  3. If At Min, Notify Death and Destroy Entity on the target, as in the combat chapter.
  4. On Completed, End Ability.

Grant SA_Grenade on SU_Soldier. Play, select a Soldier, click Throw Grenade, and click 1,500 units away. The order is rejected as out of range, and Log LogSeinSim Verbose shows the reason. Click 1,000 units away: Minerals drop by 25, enemies near the point lose 40 health, and the button stays disabled for 20 seconds.

  • Never calling End Ability. The ability stays active, holds its Granted Tags and blocks the unit’s next order. Every path through On Activate and On Tick must end or cancel.
  • Missing Cancel Abilities With Tag. A second direct activation is rejected with CanActivateFailed because the first is still running. Give every order its own Granted Tag under SeinARTS.Ability and SeinARTS.Ability as its Cancel Abilities With Tag.
  • Expecting a passive to pay costs or check gates. It does neither. A passive that should run once must call End Ability.
  • Writing state in Can Activate. It is called every frame by the HUD. Read only.
  • Auto Move Then without a Move Ability. Set Move Ability on the Sein Abilities component, and make it a non-passive Point ability with a unique tag. Otherwise the order is rejected as out of range.
  • Using a float. A float variable in an ability stops the match from starting, and a Blueprint compile warns about it first.
  • Trusting the preview. The preview colors from the client’s view; the gates run in the simulation.