Data/Effects/Create Unit

## Create Unit

### Description

Create Unit is an effect which creates one or more units at a specified location.

### Hints

* If you want to create a unit at a point that is not the host unit, then use this.

## Example Usage

### Broodling (escort)

When the Brood Lord orders the ammo units from it's **Arm Magazine** ability to attack using the scope of it's dummy weapon, they convert into missiles using a **Launch Missile** effect. On impact a **Create Unit** effect, **BroodlingEscourtCU (Unnamed)**, then produces the Broodlings you all know and loathe.

### Calldown MULE

The ability directly creates a MULE and then applies various other effects using the **Effect: Effect - Spawn** field.

## Fields Description

### Effect: Creation Options

* **Birth:** Is this unit birthed, or created (Can be used to cause actor birth events to fire) (Unsure)
* **Drop Off:** related to resources at placement? (Unknown)
* **Ignore Blockers:** (Unknown)
* **Ignore Cliff Test:** (Unsure) The unit may be produced right into a cliff.
* **Normalize Spawn Offset:** (Unsure) Spawns at a compromise location between the spawn offset and the spawner
* **Offset By Radius:** The Creation point is offset by its unit radius
* **Offset UnitType By Level:** (Unknown)
* **Originide Of Footprints:** (Unknown)
* **Placement:** If checked, the create effect will try to find the nearly valid placement location for the unit. If unchecked, the unit will be created at the target point regardless of collision.

* **Precursor:** Designate the created unit to be a precusor (no draw, no abilities, like the Precursor Behavior). This unit still needs to be destroyed if left behind. Precursor may be used by child effect to indicate a relative location. They can use/provide food, show the idle worker count, show their Military selection count. It is ideal to privilge the right type of precursor to avoid some inconvenients. The precursor unit still allocates slots from the ability limit, so using unit types without abilities are preferable.

* **Provide Complete Tech:** determines if the spawned unit has upgrades for the unit type applied
* **Provides Food:** Determines if the created unit will ever furnish supplies (if its unit supply field allows it). This works a bit like an invisible buff.
* **Select Control Groups:** (Unknown)
* **Set Facing:** When unchecked, the created unit will default to its facing value (set in the units/actors tab). When checked, the unit will spawn facing the direction of the effect as determined by the **Target: Origin** and **Target: Location** fields, with the unit facing away from the Origin. Typically, if the unit is created by a target ability from another unit, the created unit will be facing the same direction as the caster.
* **Uses Food:** Determines if the created unit will ever use supplies (if its unit supply field requires it). This works a bit like an invisible buff.

### Effect: Effect - Spawn

Effect applied to each of the spawned units.

* The only field to ensure a follow up in the child effects

### Effect: Rally Unit

#### Effect

Unit whose rally instructions are copied and issued to the spawned units. (Editor)

* Determines which effect in the effect tree the **Effect: Rally Unit - Value** references from.

#### Value

Unit whose rally instructions are copied and issued to the spawned units. (Editor)

* Caster: Unit which started the effect tree.
* Caster Outer: Container unit for the Caster.
* None: (Unknown)
* Outer: (Unknown)
* Source: Unit which was previously involved in the effect tree (caster or last behavior carrier)
* Source Outer: Container unit for the Source.
* Target: Target Unit of the reference effect.
* Target Outer: Container unit for the Target.
* Unit Origin: (Unknown)

### Effect: Select Unit

#### Effect

* If this resolves to a unit and that unit is selected, then the newly created unit will also be selected. The created unit may also be added to control groups in the Select Groups create flag is set. (Editor)
* Determines which effect in the effect tree the **Effect: Select Unit - Value** references from.

#### Value

* If this resolves to a unit and that unit is selected, then the newly created unit will also be selected. The created unit may also be added to control groups in the Select Groups create flag is set. (Editor)

### Effect: Spawn Count

Number of the **Effect: Spawn Unit** units spawned

* Influenced by accumulators.

### Effect: Spawn Offset

* A set X,Y offsets relative to the **Target: Location**. The effect will use the closest offset where the unit can be spawned to position the new unit.

### Effect: Spawn Owner

#### Effect

Determines which earlier effect in the effect tree the **Effect: Spawn Owner - Value** references from.

#### Value

Location that indicates which player owns the spawn

### Effect: Spawn Range

Maximum distance away from the effect point that a unit can be created at.

* Tries to spawn as close to the effect as possible

### Effect: Spawn Unit

Unit which is spawned.

* Setting multiple unit is indexed and related to caster's level. Only 1 type of unit may be created, still.

### Effect: Type Fallback Unit

If the Spawn Unit is not setup, this field may specify another unit in the effect tree whose type will be used to create the new unit.

* See effects for locations.

### Target: Location

#### Value / Effect

The location at which the created unit will be spawned. Of course, this location can be alerted by offsets and placement.

* See effects for locations.

### Target: Origin

#### Value - Effect

Determines which earlier effect in the effect tree the **Effect: Target: Location - Value** references from.

* As this may seem unnoticed, this field breaks the source link of any previous source, made by behaviors or set effects (or launch effetcs, etc) as it is falling back to caster by default. To fix that matter, simply set this field to "source".
* Where the effect is launched from.
* Useful for controlling the facing with the **Set Facing** flag.
* See effects for locations.

## Related

* Data/Validators
* Data/Units