Data/Effects/Launch Missile

## Launch Missile

(Editor Screenshot) needs pic of battlecruiser firing or hybrid consume DNA

### Description

Launches an ammo unit created for the purpose between two points of which launch location needs to be a unit. On impact the ammo unit can be destroyed or ordered to return to the source (eg. tentacles). On launch and impact effects can be performed while the missile unit itself is capable of using weapons, behaviors and abilities like any other unit. The missile launches from and to the origin of the models by default unless specified otherwise by an Action actor. The start height of the missile is determined by the **UI: Height** field of the missile unit.

### Hint

* The Launch Missile effect and the associated Action actors can be quite temperamental so need patience
* Missiles apparently cannot be launched from a point so require an invisible dummy unit to give the impression of doing so.
* Take note that the fields **Periodic Effect**, **Periodic Validator** and **Interrupt Effect** will not display in the effect tree.
* Since launching a unit can fail due to "Supress Movement" from buff behaviors, use "Ignore Movement Suppression" flag on the mover.
* Any launched unit (missile or target unit) becomes a "source" location for any child effect of this effect.
* Used on a weapon, if the caster is the launched unit, its attack animation gets canceled if using the Attack.Stop event.
* A channeled effect (yet only tested on a weapon) that should impact an effect, will not land that effect since the end of the channel negates any further action once the missile impacted. Using an alternate channeling source may preserve that impact effect's success.

### Bug

Cannot launch a unit using a Train ability that is managed by a non-passive Queue ability.

#### Retarget Issue

As it is being investigated, retarget features (flag, range, filters related to it) seems to be working in some cases and others not. So far, the results of testing show that it is limited to certain rules, some being a lack of content:

1. The target filters can only aim for enemies, and will do it anyway: unchecking enemy doesn't do anything (not even prevent the retarget from working), and the retarget feature will only work in the case of a nearby enemy, even if player is allowed.
2. The target filters must match with the using weapon exclusions/requirements. For example, a missile turret's attack cannot retarget a ground target. Since the previous point shown that some filters are ignored (a bug), it is unclear to say which filters are relevant to use. To be sure, one should exclude dead, hidden, invulnerable, missile, stasis.
3. The validator on the Launch Missile effect is checked when attempting to retarget.
4. For unknown reasons, it doesn't work on Effect-Target abilities. They are simply not supported by this feature.
5. At some point of the missile's arrival, it may sometimes fail.

Conclusion, making a second Launch Missile effect on arrival, or a search + redirect missile could be alternatives.

## Example Usage

### Marauder - Punisher Grenades (Launch Missile)

The missile launching effect performed every time the marauder fires the Marauder - Punisher Grenades weapon that on impact applies a Set effect which uses a Damage and Apply Behavior effect. This results in the missile impact doing damage and applying the Marauder - Slow buff to the target

#### URL

As the marauder is already in the editor no URL is needed

### Spine Crawler - Spine Crawler (Launch Missile)

The missile launching effect performed everytime the spine crawler fires the Spine Crawler - Impaler Tentacle weapon that on impact applies the Damage effect directly. Unlike most missiles, the actual missile unit used lacks a Mover which is supplemented by the + Movers - Link fields of the Launch Missile effect. The Return flag is also enbled so that the missile unit is not destroyed on impact and can return to the source when ordered to. The actual tentacle is attached to the missile fired by an interaction between the Unit actor for the spine crawler and the Missile actor of the missile.

#### URL

As the spine crawler is already in the game no URL is needed

## Fields Description

### None - Ammo Owner

Determines who owns the ammo, assuming this will define the alliance of the ammo (perhaps enabling it to be targeted or not).

### None - Bounce

Grants a bounce effect to the ammo. The bounce occurs when the missile impacts at location.

* This field is very tricky to configure, as setting a big bounces gives silly results while a small once is merely noticeable.
* Setting up this field unfortunatly does not show the effect tree that follows up in the editor.
* If setting a sound actor for each bounce, it is recommanded to set the actor that the next effect, since no events can use a "bounce" event.

**Distance Multiplier**

Defines the additional distance to bounce at. This field can even make the missile bounce back.

**Impact Effect**

Effect that occures each time a BOUNCE occurs. This means that if the missile bounce twice, you get repeated 2 effects total.

**Offset**

Configures the bounce location, offsetting it. This might help the distance multiplier to set a pertinent bounce spot, but playing with these numbers requires patience.

### None - Interrupt Effect

Effect cast on the target of the missile if the missile should not impact. By default, the target of the missile is the target location.

* Useful when using a launch effect that must be cancelled in the missile does not impact.

### None - Periodic Validator

As missiles can have a periodic effect, this validates each period effect.

### None - Placement Around

(Unsure) If the impact location of the missile results into a placement (death excluded), this gives a relative point to place from.

### None - Placement Min Distance

Minimum distance away from location where the placement should occur.

### None - Search Effect

The missile will run this effect every game loop, overriding the Height parameter in the search area based on the missile's current speed. Essentially, it will not leave gaps between each search. The Search Area effects anywhere in this effect chain will be adjusted.

* The TVE cheat will display an incorrect default height instead of the correct height of the override search effect.

### None - Search Flags

Important Note: Search Area effects used for skill shots is suggested with Rectangle search. Only use Rectangle Width and leave Rectangle Height at 0.

* Dynamic Search Area: Enables skillshot search. Without it, you get a normal missile.
* Arrive On Search Hit: Configures whether the missile is a “denote if it hits target skillshot” or a “piercing through” skillshot.

### None - Search Hit Arrive Effect

Only work when ArriveOnSearchHit is on. This effect executes when the missile detonates by hitting a target.

* This effect will be run at the final search point before the missile dies, not at the targeting point of the missile. This functionality is similar to that of a finish effect.
* It is not entirely necessary to use it. One can use the **Search Effect** that runs a search area effect, leading to a damage for example. This field is rather more like a Finish Effect type of add.

### None - Search Max Count

Denotes the max search count during the entirety of the missile’s travel time, not the max search count of each individual search.

* The missile will stop searching after it found SearchMaxCount targets.
* When SearchMaxCount is reached and ArriveOnSearchHit is not set, the missile will continue to travel to its destination, but will no longer execute skillshot searches.
* When SearchMaxCount is reached and ArriveOnSearchHit is set, the missile will detonate and run SearchHitArriveEffect at its last search point. Note that this is not the missile target, as it will not have reached the target point.
* If SearchMaxCount is 0 and ArriveOnSearchHit is set, the missile will not limit the max count of the search. As long as one of its search effects finds a target, the missile will detonate and run SearchHitArriveEffect at its last search point.

### AI - AI Notify Flags

* Flags determining what the effect is known as for AI use
* Help Friend makes this effect known as positive and beneficial to friendly units when used by the AI
* Hurt Enemy makes the effect known as negative and harmful to enemies when used by the AI
* Hurt Friend makes the effect known as negative and harmful to friendly units when used by the AI
* Workers Only makes this effect only be used by units with the Worker flag enabled under the Units data type

### Effect - Alert

* The altert from the Alerts dats type given when this effect is used

### Effect - Death Type

* The death type caused for the missile actor on impact determining what Combat - Death Effects + values are played from the Missile actor
* Note - This is true for all types except **none**. Setting Death Type to none will prevent the effect from killing the missile after impact, useful for jumping abilities.

### Effect - Finish Effect

* The effect performed after the missile has finished traveling

### Effect - Placeholder Unit

* The unit used as a placeholder when the Placement Ignores Cliff Test flag is checked

### Effect - Placement Range

* The maximum distance a placeholder unit will be created from the Impact Location

### Effect - Flags

* **2D:** (Unsure) When the unit is launched by the effect, should its animation be limited to 2D ?

* **Channeled:** means this effect is canceled if the source unit is not actively channeling the ability or weapon. Also use this when the impact leads to a channeled effect (exemple channeled Behavior) to avoid this effect to break the upcoming Channeled child effect. An Effect-Target ability for exemple, can ruin its own Channeling if the channeled effect is located after the this Launch Missile effect without this flag checked.
* **Ignore Blockers:** Unknown
* **Placement:** means the missile will check first if it can occupy the target point, if not it will not be launched
* **Placement Ignores Cliff Test:** makes the effect use the Placeholder Unit and Placement Range fields to validate the missile's placement
* **Point Fallback:** (Unsure) if there is no action actor for this effect determining the launch sites it falls back to the 2D point of the source unit
* **Retarget:** means that if the original target of the effect is destroyed while the missile is still in transit, it can then select a new target within a range if it passes the filter
* **Return:** makes the missile return to the source like a boomerang after the impact effect unless tethered to the target as is the case with some tentacles
* **Transfer:** Enables the **Transfer Behavior** fields of this effect.
* **Travel Validation:** Allows the effect to interrupt the missile, according to validation in 2 ways: in the eventuality that this effect is channeled and with any validators placed on the effect. When interrupted, the impact effect will never occur and the launched unit is instantly subject to **Death Type** from this effect. Putting "None" will leave the Missile Unit where it stands. **Intterupt field** also runs its effect in this case.
* **Validate Ability:** Forces the Impact Effect to succeed its impact ONLY if the impact location respects the target filters of the parent ability. For example, if an ability cannot target ground unit, and that within the child effect a Search Area is effectuated leading to a Launch Missile effect, the result being a ground target would let the missile launch, but will not apply the **Impact Effect**. The **finish effect** will still work, however.
* **Validate Benign:** (Unknown)
* **Validate Impact Deflection:** Determines whether the effect can be deflected. By default, set to off.
	+ Deflection is almost identical to Block Chance except the effect that would have occurred will be duplicated and shot back to the caster.
	+ The deflected effect will have caster and target properties reversed and will count as a shot from the original target unit to the original caster unit. The damage bonus setting in the reflected effect tree will still be set to use the original caster’s damage bonuses.
	+ Another difference between deflection and blocking is that effect trees will only evaluate deflection once each. If an effect has passed the Deflection check once, the rest of the effect tree will not check deflection chance again, even if there are following effects in the effect tree that have the ValidateImpactDeflection flag checked.
* **Validate Teleport:** If a unit instantly moves from one position to another (no matter how small the distance) while the missile is targeting that unit, the missile will not impact the target (this is how Blink is able to "dodge" most projectiles). Defaults to true.
* **Weapon:** Forces the Impact Effect to succeed its impact ONLY if the impact location respects the target filters of the parent weapon. For example, if weapon requires Air, and that within the child effect a Search Area is effectuated leading to a Launch Missile effect, the result being a ground target would let the missile launch, but will not apply the **Impact Effect**. The **finish effect** will still work, however.

### Effect - Impact Effect

* The effect cast when the missile impacts

### Effect - Launch Effect

* The effect casted when the missile is launched. If the child effects aims at "Target" location, it will take the Launch Missile **launch location** entry by default. Since most of the time it is source, it may return to caster. It specifying the launch missile effect with "Target", it will take the Launch missile's target. If taking Source, it will target the launch location of the Launch Missile effect (when the Launch Missile launches a unit or ammo, this one becomes source in the child effects).

### Effect - Periodic Effect Period Count

Number of periods the periodic effect that will occur (from this effect).

### Effect - Periodic Effect Period

The duration before each periodic effect is launched (from this effect).

### Effect - Periodic Effect Period

Periodic Effect that runs (Unsure) on the missile itself. This field does not give as many options as a real Create Persistent Effect, but can still work at some extent.

### Effect - Placeholder Unit

Specifies the type of placeholder image that will be created at the missile's target location. It will be destroyed when the missile is done traveling (whether it impacts or not).

### Effect - Placement range

Only used if the Placement flag is set on this effect. Specifies a radius to searrch around the Impact location for a valid spot for the ammo unit to be placed. Typically, you would also want to set the Death Type to None to Disable the Ammo unit from dying when the missile is done traveling.

### Effect - Response Flags

* Determines how units respond when hit by this effect if they can (set by the Behavior - Response field under the Units data type)
* Aquire makes the unit aquire the caster
* Flee makes the unit run from the caster

### Effect - Retarget Filters

* Determines the attributes the new target units must have for the missile to retarget to them
* Testing have poorly succeeding in making the missile retarget, even with the retargeted field enabled. This seems like a broken feature.

### Effect - Retarget Range

* Determines how far away from the original target the new target can be when retargeting
* Testing have poorly succeeding in making the missile retarget, even with the retargeted field enabled. This seems like a broken feature.

### Effect - Return Delay

* Determines how long after the impact effect the missile waits before returning to the source unit
* Tentacles can visually override this using actors by changing the hosting of the tentacle actor to the target
* If the missile targets a point it will return immediately irrespective of the value in this field

### Effect - Transferred Behavior

* Allows the Missile to become the vector of a transfered behavior, to be pair up with a transfer behavior effect on impact. Reminder: it is ESSENTIAL that the impact contains a transfer behavior effect, because the missile on its own cannot transfer a behavior. Why use it then? For 2 good situations:

1. It is useful when a dying unit that has a behavior to be transfered to a nearby unit works (in case of a launch missile situation only). If a death response from a buff behavior leads directly to the transfer behavior, then it is not necessary, because the death response triggers just before the behavior is gone from its source. Otherwise, if using a launch missile effect for the look of it, the source of the behavior is long gone before the missile can impact. This is where this function comes at hand.
2. Aside from using directly the transfer behavior effect, you can control the rate at which the behavior is transfered. Instead of transfering every stack at the exact instant, you can deceide to have them transfrer 1 by 1, per missile impact. It is however not totally reliable, as in some situations, not all stacks transfer properly, for unknown reasons.

* This field is still unpratical to use, and has some undesired flaws. In some trials, the transfering behavior never could be transfered as many 1 stack per missiles, in others the amount of stacks override the current amount on the receiving unit. It is best using this function at the least of its limitations.

### Effect - Transfer Count

Forces the amount of behavior stacks to be transfered per missile launch impact.

* Since this is a request, the number of stacks received by transfer behavior effect is still limited at its transfer behavior Count amount.

Here are some odd interactions:

**Launch Missile Transfer Behavior Count / Transfer Behavior effect Count = Outcome**

0 / 0 = All stacks will be transfered over 1 missile. Also, if the receiving unit already has a stack, it only adds 1, for no reason. This seems to be misconfigured.

1 / 0 = Each stack is transfered per missile (forcing the launch missile effect to generate extra missiles), ends up with less stack than intended (partially works, broken?)

1 / 1 = Each stack is transfered per missile (forcing the launch missile effect to generate extra missiles), is usually the right formulae.

0 / 1 = Only 1 missile is launched, transfering only 1 stack.

-1 / -1 = Only 1 missile is launched, transfering only 1 stack.

-1 / 0 = Only 1 missile is launched, transfering only 1 stack.

0 / -1 = Only 1 missile is launched, transfering only 1 stack.

* Many other formulaes can be tested, but if time is an issue, one should just get it right and leave it be. Yet, these fields seems only to work without mistakes if using the 1 / 1 ratio. The tests conducted were made from a behavior that refresh stacks. Do we get a different outcome if unchecked? Best luck for testing.
* What we know so far:The count located on the transfer behavior works as a "Maximum" amount to be transfered, but will glitch wrong if the receiving unit already has stacks and limit to 1 the amount received.

### Effect - Validators

* The validators that need to return true for the effect to take place

### Effect - Visibility

* If the Visibility is set to Snapshot and the Impact Unit is hostile to the origin of the effect, then the impact Unit is sent a Unit Attacker actor message which is used to reveal a snapshot of the attacker for a short time that may be targeted by abilities but the player must have vision of to retaliate. If the Visibility is set to Visible then a revealer is attached to the attacker granting full vision of it to the Impact Unit and their allies for a short time.

### Movement - Mover Execute Jump

* Determines how it skips movers in the + Movers - Link fields

### Movement - Mover Execute Pattern

* Determines how it recycles movers in the + Movers - Link fields
* Bounce makes it go in increasing and then decreasing index values back to the start
* Stripe makes it reset to the starting index value when the last index value is reached

### Movement - Mover Rolling Jump

* Tells how many movers to execute equally from the list of movers in this very effect. This field is used by the Broodling Escort Weapon.

### Movement - Mover Rolling Pattern

* When all Movers are used from the movers list, tells in which way to keep using them.
	1. Stripe is the regular patern, from mover index 0 to the last, then, start over at 0.
	2. Bounce means zig-zaging, from mover index 0 to the last, then return the way back to 0.

### Movement - Movers

The index of movers from the Movers data type used for the missile unit.

* Overrides the Missile Unit's mover if the range is valid (see below).
* Can work well on its own, removing the necessity of having an action actor/missile actor linked to the ammo unit. It is however recommanded to use them instead.
* Useful for spells that move targets by pulling of launching them further.
* Can be used by Upgrades to override a launch effect's ammo mover without changing all the data manually.

**Link**

Which mover to use from the Mover data.

**Range Less Than or Equal**

Allows to use a different mover based on the distance of target. If only 1 mover is used, this field can be left at 0 (as default).

### Movement - Movers - Range Less Than Or Equal

* Logic function applied to the range of the target when determining what mover to use

### Movement - Return Movers - Link

* The index of movers from the Movers data type used on the missile return for the missile unit if there is not one specified on the missile unit

### Movement - Return Movers - Range Less Than Or Equal

* Logic function applied to the range of the target when determining what mover to use on the return

### Target - Impact Location - Effect

See the effect section for detailed information.

* The most important to remember concerning Launch Missile effects, is that using Unit/Point locations can cause the missile to end up at the last valid point of the "Unit" if that one should become invalid for targeting.

### Target - Impact Offset

Offsets the Impact of missile.

* Used by the Ravager for offsetting the impact.
* Try to use Point kind of Impact location, as unit impact location may cause this field to be ignored.

### Target - Impact Range

* Determines how close to the target the missile gets before applying the impact effect

### Target - Launch Location

**Effect**

* A previous effect in the same branch of the effect tree as this effect used as a frame of reference for determining the Source, Target, Outer etc. of the **Target - Launch Location - Value**.

**Value**

* Determines where the missile is launched from (appears to require a unit)
* Caster Point makes the missile launch from the point of the caster unit in the 2D grid
* Caster Unit makes the missile launch from the caster unit
* Caster Unit/Point makes the missile launch from either the caster unit or the point of the caster unit if unable to launch from the caster unit
* Origin Point (Unknown)
* Origin Unit (Unknown)
* Origin Unit Or Point (Unknown)
* Outer Point (Unknown)
* Outer Unit (Unknown)
* Outer Unit/Point (Unknown)
* Source Point is the point of the effect directly using this effect
* Source Unit is the unit directly using this effect
* Source Unit/Point is the unit or point that is directly using this effect
* Target Point launches the missile from the target point of the effect
* Target Unit launches the missile from the target unit of the effect
* Target Unit/Point launches the missile from either the target point or unit with a unit being prefered
* Unknown (Unknown)

### Target - Launch Offset

* Offsets the Launch of the missile.
	+ Used by the Ravager for offsetting the impact.
	+ Try to use Point kind of Launch location, as unit impact location may cause this field to be ignored.

### Unit - Ammo Life

* Used to override most ammo (unless launching a live unit) default life that is 10.

### Unit - Ammo Unit

* The unit from the Units data type that is created and launched by this effect
* If left empty then the launch location determines what will be launched.

### Unit - Placeholder Unit

* This unit is created and targeted instead of the original impact location if the **Placement Ignores Cliff Test** is checked
* This is useful for finding valid impact locations based on pathing
* The unit is created as close as possible to the impact location within the **Placement Range** value.

## Related

* Movers
* Units
* Missile
* Action
* Effects
* Validators
* Behaviors