Abilities are CoreObjects that can be added to Players and guide the Player’s animation in sync with the Ability’s state machine. Abilities can be activated by association with an Action Binding. On the scripting part, their internal state machine flows through the phases: Ready, Cast, Execute, Recovery, and Cooldown. An Ability begins in the Ready state and transitions to Cast when its Binding (e.g. Left mouse click) is activated by the owning player. It then automatically flows from Cast to Execute, then Recovery and finally Cooldown. Advanced Abilities are going to be covered in the scripting module.
In this lesson, we are going to look at how you can equip abilities and what are the different properties of an Ability.
As seen in the previous lesson, an Equipment is an object that is attached to a player. You can also add Abilities in your Equipment to play animations when a player presses a key. Let’s add an Ability in the Equipment you made in the previous Hands-on.
Before diving deeper into the Ability properties, let’s show the Ability status on the interface. The object Ability Display adds a UI element showing the cooldown, the binding and an icon. To add the Ability Display:
Open the Properties to customize the Ability Display. The Binding is the name of the ability defined in the Properties of the Ability you just added. BindingHint and ShowAbilityName are two texts under the icon showing the binding and the name of the Ability. The last option HideWhenDisabled will hide the icon if the Ability is disabled from a script.
In the Client Context of the Ability Display, you will find the different UI elements that are fully customizable. To move the emplacement of the Ability Display on the screen, move the Panel Control. The Icon can also be changed by double-clicking on the Image.
An Ability has various properties to customize the binding, the animation, and the duration of each state. The list of all animations can be found here.
Under the Ability Properties, there are the 4 states of an Ability: Cast, Execute, Recovery, and Cooldown. This will be covered in more details in the scripting module but you can still change each duration in the properties. The Cooldown Duration might be something you want to update if you want the player to be able to play the animation more often.
In the next lesson, we are going to look at existing weapons that are using those abilities.