Data/Abilities/Build

## Build

### Description

Allows the creation of units at the target location. The constructed units require the **Buildable** ability in their **Ability - Abilities - Ability** field for this ability to work correctly.

### Hint

* Defaults to protoss like auto-construction unless told otherwise
* Each unit able to be built by the ability needs a separate button in the command card
* If a unit it placed out of the **Stats - Range** then the builder tries to move towards the unit to be built until it is within range if possible.
* If the construction is cancelled in the placement stage, then there is a full refund of construction costs

## Example Usage

### Barracks - AddOns

Ability used by the barracks to construct the Reactor, Tech Lab and Tech Reactor addons. It automatically places them at their offsets relative to the barracks unless there is no room in which case the barracks is morphed to the lifted off form to allow placement in a valid location. Once construction completed the addons prevent the constructions of further addons at the barracks though a hard coded interaction with the ability

### SCV - Build (SCV)

The build ability of the SCV that enables construction of all the terran structures. As it has the **Worker Maintained** flag enabled, the **Construction** mover and the **Worker Disable Collision** flag enabled, the worker moves around the unit being constructed and requires the presence of a worker to be constructed. The **Interruptable** flag allows individual SCVs to stop building for a period of time to be used elsewhere

## Fields Description

### 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), it will be coloured by the alignment. Neutral is nothing, positive is green, negative is red.
* This also applies for buttons and buffs.

### Ability: Build Morph Ability

* Used for when the **Instant Placement** flag is enabled, **Ability: Build Type** is set to Add On and the desired unit to be built cannot be placed at the location according to it's **Movement: Pathing Footprint - Placement**, the unit using the ability is ordered to use the morph ability if it has the specified morph ability and the placement becomes targetable eg. Terran building addons

### Ability: Build Type

* **Addon:** Used for constructing addons
	+ Makes the ability automatically place the unit if the **Instant Placement** flag is enabled and there is no collision with the **Movement: Pathing Footprint - Placement** footprint
	+ Requires a valid **Movement: Pathing Footprint - Placement** (or the lack of one)
	+ Automatically disables the construction of any further units that share the constructing unit in the **Behavior: Added On Units - Unit** if the constructing unit has a **Behavior: Added On Units - Behavior** from one of the addons
	+ Units to be built are created at their **Behavior - Add On Offset** coordinates relative to the global map grid from the building unit
* Normal
	+ Default used by builder units
	+ Not affected by the **Instant Placement** flag

### Ability: Construction Mover

* The **Builder** type mover from the Movers data type used by the constructing unit when the **Worker Maintained** flag is enabled.

### Ability: Effects

* Effects applied to the unit under construction when construction starts, is finished or is cancelled
* Used by Oracle's stasis ward, for creating dummy effects that coordonates the contructing laser beam.
* There are 2 mininal conditions in order for effects to trigger properly, including when using an item of type ability:
	1. There must a minimal Time for building the Structure.
	2. The structure needs a Buildable ability.

### **Ability: Info**

This field uses the cost field, detailed on abilities.

There are additional field unique to the build ability:

#### Alert

Alert that is displayed on UI when the unit is built.

#### Unit

* Which unit from the Units data type is built by the ability
* Note that each **Build** ability can create up to 30 different units and will need each one to be placed in a different build command slot

#### Validators

* Validators that must be met to enable construction of the unit
* The Index allow several validators for each build command slot
* Any validator that check the "target location" pairs well to dertermine if the build location is valid.

### Ability: Smart Priority

* The priority for using the ability if the **Smart Command** flag is enabled
* As this ability type lacks the flag, this field is obsolete

### **Cost: Refund Fraction**

#### Charge

* If construction of the unit canceled what % of the **Ability: Info - Charge - Count (Use)** are restored
* 1 = 100%

#### Cooldown

* If construction of the unit canceled what % of the **Ability: Info - Cooldown - Time Use** are restored
* 1 = 100%

#### Resource

* If construction of the unit canceled what % of the **Ability: Info - Technology Resource Cost** are restored
* 1 = 100%

#### Vital Fraction

* If construction of the unit canceled what % of the **Ability: Info - Vital Fraction** are restored
* 1 = 100%

#### Vitals

* If construction of the unit canceled what % of the **Ability: Info - Vitals** are restored
* 1 = 100%

### Stats: Flags

* **Auto Harvest:** (Unknown)

* **Best Unit:** If several units with the same ability are selected then only one unit will use the ability per click
* **Cancelable:** Allows construction of the building to be canceled
* **Homogenous Interrupt:** If disabled the building unit needs to be manually stopped. If enabled any other order will stop the building process. E.g. if you create a building and then order the building unit to move somewhere it will stop building and move - this will not happen if this flag is disabled.
* **Ignore Food:** Ignores the food costs of units built
* **Ignore Unit Build Time:** If unchecked, a unit’s build time will be added to the ability's build time.
* **Ignore Unit Cost:** Ignores the resource and vital costs of the unit built but not the costs of using the **Build** ability
* **Instant Placement:** Makes the unit be constructed at the location of the builder without being able to select where it will be place
	+ When combined with the Addon **Ability: Build Type** makes the unit being built be placed at the **Behavior: Add On Offset** under the **Units** data type
* **Interruptable:** If the **Worker Maintained** flag is enabled then this flag allows the worker to be removed from constructing the unit eg. SCV when building
* **Neutral Detached Addon:** Makes addons convert to the neutral player (0) when the attached unit is removed
* **Peon Can be Moved:** (Unknown)
* **Range Includes Building:** Used by addons to include the building unit's footprint in it's own footprint
* **Require Facing:** When enabled forces the building unit to face the direction of the unit being built
* **Show Progress:** Shows the progress bar on the constructing unit's UI when building an addon
* **Worker Disable Abilities:** Disables all abilities of the building unit except the build ability being used
* **Worker Disable Collision:** Removes the collision of the building unit so it can move around the unit being built like the SCV
* **Worker Fidget Across:** (Unknown)
* **Worker Hide:** If the **Worker Maintained** flag is enabled then this flag hides the worker while it constructs the building
* **Worker Kill On Cancel:** Kills the building unit if the unit being built cancelled and the **Worker Maintained** flag is enabled
* **Worker Kill On Complete:** Sacrifices the building unit when the unit being built is complete like the zerg buildings
* **Worker Maintained:** Prevents protoss like auto building and forces the builder to stay with the unit being built

When the **HomogenousInterrupt** and **Interrupt** flag are both on in a CAbilBuild that doesn’t cause its workers to disappear into the building during the construction, then in the construction stage, workers will not block the placement of other buildings when you try to place them. Instead, they will walk away and then come back to find a better place to continue construction.

### Stats: Range

* How far from the building unit the unit being built can be before construction begins

### UI: Alert

* The default alert from the Alerts data type played when the unit finishes construction
* Is overridden by the **Ability: Info - Alert** field

### UI: Error Alert

* The alert from the Alerts data type played when something prevents placement or construction of the unit to be built

### UI: Maximum Fidget Delay

* (Unknown) presumed to be related to the **Worker Fidget Across** flag

### UI: Minimum Fidget Delay

* (Unknown) presumed to be related to the **Worker Fidget Across** flag

## Related

Abilities

Buildable

Morph

Effects

Movers

Requirements

Units

Validators