Data/Abilities/Queueable/Learn

## Learn

### Description

This type of ability is used to assign abilities which a unit or hero can learn. Abilities to be learned by the unit must also be placed in the **Ability: Abilities - Ability** field of the unit and the **Learn** ability placed in the **Learn Ability:** field of the **Submenu** command type of the command card of the unit. This ability also determines how many skill points a unit starts with and gets with each level gained by a Veterancy behaviour. What can be learned and which requirements must be met to learn different abilities are also determined here.

### Hint

* The abilities learned do not need to link to the command card or have usable effects. This means they can be used as dummy abilities to act as a counter that is recognized by Requirements for the activation of other things like behaviours for selectable attributes.
* The Learn ability has a **game breaking bug** that if the unit with the ability is ordered to do something, like move a long distance, the learn ability can be queued with all queued instances being used the moment the previous order finishes allowing it to be used in excess of the number of points available ignoring both requirements and the maximum ability level index. The only way to prevent this bug is to make the ability charge restricted and only adding charges on level up equal to the number of points given by the ability to spend using the **Behavior: Veterancy Levels - Level Gain Effect** field of the Veterancy behaviour and a Modify Unit effect to add charges.

### Patch 5.0 Update

* Fixed an issue where if all points were spent, the learn ability button would show "Required Level:" as red text even if the unit had already met the required level.
* Fixed an issue where players could sometimes use the shift key to bypass level restrictions on Learn Ability.

## Example Usage

### Choosable attribute system

A simple demonstration map where the learn ability is used to learn levels of dummy abilities that are used for two things. The first is to increase one of three generic attributes which has a marker by increasing a max vital by 10 for easy visualization. The second is to create a levelable passive aura which also changes the button in the command card, the aura increases armor by +1 per level for visualization.

#### URL

https://www.sc2mapster.com/forums/resources/data-assets/176945-the-assets-of-evil

## Fields Description

### (None): Categories

* Categories for segregating different abilities

### (None): Orders - Display Type

* How the waypoint lines appear when queueing this ability.
* **Attack:** (Unknown)
* **Confirm:** (Unknown)
* **Legacy:** (Unknown)
* **Move:** (Unknown)
* **Rally:** (Unknown)

### Ability: Alignment

* Determines whether the ability is considered neutral, negative or positive.
* If the ability shows anywhere (usually does not, since it will be buffs or buttons you will see in game, so I guess it does not matter much, but anyway), it will be coloured by the alignment. Neutral is nothing, positive is green, negative is red.
* This also applies for buttons and buffs.

### Ability: Debug Trace

* If enabled logs ability use and execution/errors when testing the map

### Ability: Info - Ability

* What abilities will be able to be learned by units with this ability.

### Ability: Info - Alert

* Alerts from the Alerts data type that are played if certain abilities are unable to be learned because the Requirements have not been met

### Ability: Info - Button - Default Button

* The button from the Buttons data type that will be associated with learning the ability.

### Ability: Info - Button - Flags

* Flags for the button
* **Allow Minimap:** (Unknown)
* **Allow Self Cast:** (Unknown)
* **Continuous:** (Unknown)
* **Hidden:** Sets the button to hidden by default
* **Hide Path:** (Unknown)
* **Ignore User:** (Unknown)
* **Send to Selection:** (Unknown)
* **Show In Glossary:** (Unknown)

### Ability: Info - Button - Requirements

* Requirements for using the learn button
* Often used in combinations of **Count Ability** and **Count Behavior** to enable level skipping and abilities needing the hero to be over a certain level to learn

### Ability: Info - Button - State

* State of the button
* **Available:** means the button is always visible
* **Restricted:** means the button will only appear if the **Show** parts of the requirements are met
* **Supressed:** stops the button from being visible

### Ability: Info - Charge - Count (Max)

* The maximum number of charges able to be had by the ability

### Ability: Info - Charge - Count (Start)

* Amount of charges the ability has at the start

### Ability: Info - Charge - Count (Use)

* Amount of charges is used with each use of the ability.
* Set this to 1 to prevent exploitation of queueing the ability

### Ability: Info - Charge - Enable Charge Time Queueing

* **e\_chargeFlagRestoreAllChargesOnCooldown:** (Unknown)
* **Enable Charge Time Queueing:** (Unknown)

### Ability: Info - Charge - Hide Count

* Hide the amount of charges count in the UI.

### Ability: Info - Charge - Link

* Id string link that allows several abilities and effects to share the same charge pool

### Ability: Info - Charge - Location

* Determines how widely shared charges with the same Ability: Info - Cost - Charge - Link are shared
* **Ability:** means that the charge sharing is only limited to this ability
* **Behavior:** (Unknown)
* **Global:** means that the charges are shared between all players so that an ability could only be used a limited number in total by all players
* **Player:** that the charges are shared between all units of that player
* **Unit:** means each unit has it's own charge pool

### Ability: Info - Charge - Time Start

* Time taken to regenerate a charge
* Since patch 1.4 this is inconsistently used as the time taken to first generate a charge in some cases

### Ability: Info - Charge - Time Use

* Time increment added onto the time taken to regenerate a charge with each use of a charge
* Since patch 1.4 this is inconsistently used as the time taken between charge regeneration in some cases

### Ability: Info - Cooldown - Link

* Id string link that allows several abilities to share the same cooldown

### Ability: Info - Cooldown - Location

* Determines how widely shared cooldowns with the same Info - Cost - Cooldown - Link are shared
* Ability means that the cooldown sharing is only limited to this ability on this unit
* Behavior **(Unknown)**
* Global means that the cooldown is shared between all players so that the ability works on a first come first serve basis
* Player that the cooldown is shared between all units of that player
* Unit means only that individual unit share cooldowns between abilities

### Ability: Info - Cooldown - Operation

* **Add:** (Unknown) Adds the Cost: Cancel Cost - Cooldown - Time Start value onto the current cooldown with each use?
* **Add If Not In Cooldown:** (Unknown) Adds the Cost: Cancel Cost - Cooldown - Time Start value if the ability is not already in cooldown?
* **Max:** (Unknown)
* **Min:** (Unknown)
* **Multiply:** (Unknown) Multiply the current cooldown by the Cost: Cancel Cost - Cooldown - Time Start value?
* **Set:** (Unknown)

### Ability: Info - Cooldown - Time Start

* Time taken before the ability can be first used

### Ability: Info - Cost Display

* If the ability costs resources or vitals to cancel, this field determines which ones are shown

### Ability: Info - Technology Resource Cost

* Cost of using the ability in technology resources (minerals, vespene, terrazine and custom)

### Ability: Info - Time

* The duration taken when learning an ability

### Ability: Info - Cost - Vital Fraction

* Cost of using the ability in percentage of life, shield and/or energy.

### Ability: Info - Cost - Vitals

* Cost of using the ability in life, shield and/or energy.

### Ability: Info - Veterancy Level Min

* Minimum level of a Veterancy behaviour required to learn the ability

### Ability: Points Per Level

* As the title says, how many points you get per level gained with a Veterancy behaviour.

### Ability - Points

* Amount of points to spend in learning abilities that the unit starts with on creation

### Ability - Set ID

* String that groups different abilities of the same type
* This is used to link different abilities together
* Used for getting different units with the same ability to also use the ability
* The Issue Order effect and triggers that order the use of the one ability will also use the other
* Abilities sharing the same string will also be used by selected units when using any one of the abilities

### Ability: Shared Flags

* **Disable While Dead:** Disables the ability if the host unit is dead until the unit is revived or the corpse expires
* **Hide Target Cursor For Invalid Targets:** Hides the mouse cursor when hovering over an invalid target
* **Skip Preload:** (Unknown)
* **Snap Cursor To Unit Radius:** (Unknown)
* **Target Cursor Visible In Black Mask:** (Unknown)

### Ability: Tech Alias

* String used as an alias to group data objects together as equivalent for use by Requirements

### Ability: Tech Player

* **Owner:** Player currently in control of the unit (eg. neural parasite) is used for requirements of the ability
* **Upkeep:** Player paying the supply of the unit is used for requirements of the ability

### Cost: Refund Fraction - Charge

* Fraction of the Ability: Info - Charge - Count (Use) cost refunded by cancelling the ability.

### Cost: Refund Fraction - Cooldown

* Fraction of the cooldown that is refunded by cancelling the ability

### Cost: Refund Fraction - Resource

* How much is refunded in technology resources

### Cost: Refund Fraction - Vital Fraction

* How much is refunded in percentage of vitals

### Editor: Editor Categories

* What categories the ability is in the editor
* This does not affect or show in game.

### Editor: Editor Comment

* Notes about the ability
* Useful for other people trying to understand the map
* This does not affect or show in game.

### Editor: Editor Description

* Description of the ability in the editor
* This does not affect or show in game

### Editor: Editor Prefix

* If you want anything to be placed in front of the name of the ability
* Useful when sorting assets by name or searching
* This does not affect or show in game.

### Editor: Editor Sufix

* If you want anything to be placed at the end of the name of the ability
* Useful when sorting assets by name or searching
* This does not affect or show in game.

### Stats: Flags

Flags for the ability

* **Best Unit:** If multiple units with this ability are selected, only one(seemingly at random?) will activate the ability
* **Clear Submenu On Points Spent:** When set, a unit using this ability will automatically exit its submenu command cards after spending all its skill points.
* **Hide Maximum Level:** Hides the button associated to learning the skill from the command card once the maximum level of the ability has been reached
* **Hide Points Spent:** (Unknown)
* **Hide Submenu On Learned All:** When set, the learn ability submenu button will be hidden after a unit using the ability has learned all the abilities it can learn.
* **Transient:** Allows the ability to be used in parallel to the order currently queued
* **Use Unit Order Queue:** (Unknown)

### UI - Activity

* If learning an ability takes time, this will be message that is shown in the UI above the progress bar.

### UI - Error Alert

* What alert from the Alerts data type pops up if the queue is full when trying to learn another ability.

### UI: Orders - Color

* Determines the tint of the order queue texture and model

### UI: Orders - Line Texture

* The vertical banner texture shown when queuing several casts of the ability using the shift button
* As this ability cannot be queued this field appears to be redundant

### UI: Orders - Model

* The model used to highlight the ground of the location where the ability will be cast if several casts of the ability are queued using the shift button
* As this ability cannot be queued this field appears to be redundant

### UI: Orders - Scale

* Scale of the line texture and model
* As this ability cannot be queued this field appears to be redundant

### UI - Target Message

* Message that is displayed in the command card while you are targeting the ability
* As this ability cannot be targeted this field is redundant

### UI - Tooltip Priority

* Priority of this ability's tooltips.
* Not quite sure how it works, or where in game this has affect.

## Related

* Veterancy
* Abilities