Skip to main content

Add an ability

Most abilities are a Data Asset and nothing else: an Ability Definition on one of the ten cast types, with its numbers. When no cast type does what you want, the ability's behaviour can be a Blueprint, and the Data Asset still holds its numbers. This guide makes one of each.

Abilities describes every field and cast type.

A Data Asset ability​

The example is Frost Lance, a skillshot that pierces and slows: Marlow's new Q.

Step 1: Make the asset​

In your champion's folder, choose Add > Miscellaneous > Data Asset, pick Ability Definition, and name it DA_Marlow_Q_FrostLance. Or duplicate a sample ability of the same cast type and change it; Varra's DA_Varra_Q_PiercingBolt is a piercing, slowing skillshot.

Step 2: Fill in the Ability section​

FieldValue
Display NameFrost Lance
Iconyour icon texture
Ability TagAbility.Marlow.Q (add it in Project Settings > Gameplay Tags)
SlotQ
Ability ClassMobaSkillshotAbility
Max Rank5

Step 3: Casting and targeting​

FieldValue
Cast TypeSkillshot (Line)
Default Cast ModeQuick Cast with Indicator
Cast Time0.25
Range, Width1100, 120
Projectile Speed2000
Pierces Unitson
AffectsEnemies

Step 4: Ranks and damage​

Fill one value per rank, rank 1 first:

FieldValue
Cooldown9, 8.5, 8, 7.5, 7
Mana Cost50, 55, 60, 65, 70
Base Damage60, 95, 130, 165, 200
Scaling Attribute, Scaling RatioBonus Attack Damage, 0.9 for every rank
Damage TypePhysical

Step 5: The slow​

Add an entry to Effects: Effect Class MobaSlowEffect, Applied To Units Hit, Duration 1.5 for every rank, and Magnitude 0.3 (a 30% slow). Give it a Cue, such as the shared GameplayCue.Sample.State.Slow, to show the slow on the unit.

Step 6: The tooltip​

Write the Description with tokens:

Fires a lance {Range} cm ahead that deals {Damage} {DamageType} damage to every enemy it passes and slows them
by {Percent1}% for {Duration1} s.

The HUD fills in the numbers for the champion's rank and stats.

Step 7: Effects, clip and bots​

  • Cues: name your Cast, Travel and Hit cues; see Make an effect.
  • Cast Clip and Clip Effect Time: the clip the champion plays, and the moment in it the lance leaves.
  • Bot: Usage Bot.Usage.Damage, so bots cast it at enemies. Without a Usage, bots never cast it.

Step 8: Put it on the champion​

Open the Champion Definition and set it under Abilities > Q. Save. The message log reports anything the cast type needs and is missing; an ability with an error is not granted. Play, put a point into Q with Ctrl + Q, and cast.

Values are read at each cast, so you can change numbers while the game runs in the editor and try them at once.

A Blueprint ability​

The example is a slam that hits every enemy around the caster. (An AoE ability with Range 0 does this with numbers alone; the Blueprint is where your own behaviour would go.) Targeting, cost, cooldown, the cast time, interrupts and prediction stay in the C++ base class, so a Blueprint ability needs no networking of its own.

Step 1: Make the Blueprint​

  1. Add > Blueprint Class, open All Classes, and pick MobaGameplayAbility as the parent. Name it GA_Marlow_Slam.
  2. In its Event Graph, add the event On Cast Fired. It runs when the cast time is over.
  3. From it, call Hit Units. For its Targets, call Find Units In Radius:
    • Center: Get Caster, then Get Actor Location.
    • Radius: Get Definition, then its Radius.
  4. After Hit Units, call Finish Cast.
  5. Compile and save.

Step 2: Make its Ability Definition​

Make an Ability Definition as above, with Cast Type AoE, Range 0, a Radius such as 300, a Base Damage per rank, and Ability Class set to GA_Marlow_Slam. Put it on a slot of the champion.

The definition still decides who is hit: Find Units and Hit Unit honor its Affects, so a Blueprint cannot hit an ally with an ability whose Affects is Enemies. The cast type decides how the ability is aimed and which indicator shows.

The hooks​

EventWhen it runsWhere
On Cast StartedThe cast has started: cost and cooldown are paid, the cast time beginsServer and the caster's own game
On Cast FiredThe cast time is over: do what the ability does, then call Finish CastServer and the caster's own game
On Targets FoundUnits are about to be hit; remove one from the list to spare itServer
On HitA unit has been hit: its damage, heal and effects are appliedServer
On Cast EndedThe ability has ended. Cancelled: it was interrupted, or the server refused itServer and the caster's own game

What a graph can call​

FunctionWhat it does
Get Definition, Get Rank, Get SlotThe ability's data and rank
Get Caster, Get Aim, Get Aim DirectionWho casts, and at what
Get Damage, Get HealThe rank's numbers with their scaling
Find Units In Radius, Find Units In Line, Find Units In ConeThe units the definition's Affects allows in a shape, nearest first, no more than its Max Targets
Can AffectWhether the definition's Affects lets the ability hit a unit
Hit Unit, Hit UnitsDamage, heal and the definition's effects for units hit. Server only
Apply Caster EffectsThe definition's effects for the caster. Server only
Refund CastGives the mana back and takes the cooldown away. Server only
Play CuePlays a Gameplay Cue of your own
Is Server CastTrue on the server
Is Predicted CastTrue on the caster's own game while it runs ahead of the server
Finish CastEnds the ability on this machine

What you can rely on​

  • The caster's own game runs On Cast Started and On Cast Fired too, at once, to predict. Whatever is only for show belongs there. Whatever changes the game belongs behind the server-only calls, which do nothing on a player's game.
  • An ability that never calls Finish Cast is ended after the definition's Max Duration (10 s by default), so its slot is never blocked for good.
  • A Blueprint ability is granted, cast, refused and interrupted like a C++ one.

The sample's own Blueprint ability is Isolde's Ice Wall, GA_Isolde_IceWall in /PioneerMOBA/Sample/Champions/Isolde: its On Cast Fired calls Raise For Ability, which raises the wall its Ability Definition describes at the aim, and then Finish Cast.

A summoner spell​

A summoner spell is an Ability Definition too: Slot D, Max Rank 1, one value in each rank array. Add it to Project Settings > Pioneer MOBA Framework > Match Flow > Spell Pool, and champion select offers it. See Summoner spells.