Data/Effects/Apply Force

### Hints

* These are used to push or pull units. Examples are the motherships vortex (Not the disappearing part, just the part that units get drawn in) and Ma'ars Psionic Shockwave (campaign, zeratul mission 2, ability that throws away units around him).
* Fun things can be done with these, like creating a passive ability that can make missiles fly away from their targets, but they can also be a pain.
* *Kraith - Crashing Charge* ability uses this effect to make its caster charge at target location. The apply force used in this very case simulates the caster running at location (because of the actor animating a "Run" animation while the ability is channeling), but it's simply dragged at the target point. As tempting as this can be, especially because it allows to keep a "channeled" flag running, this can have its downside. For example, if the caster is near a cliff, but on the sides of it and aims the ability up the higher ground level, the Apply Force effect may not be smart enough to take a turn and go up the ramp, which will result in grinding on the wall until the end of the ability. Nonetheless, if the caster is well aligned with the ramp's path, this will not be a bother. Abilities that use Issue Order effects to walk the caster to a location may counter this problem, but then again, the "Moving" command will break the channel. Suited set ups must be adapted.
* In order to be movable by force, a unit needs 5 things:
	+ Acceleration > 0. Unfortunatly, a Buff behavior **cannot** grant flat acceleration, as there seem to be a bug causing a unit with 0 acceleration (structures for example) to not gain the acceleration given by the buff behavior.
	+ Speed > 0 (either on unit or from a Buff Behavior).
	+ Movable flag enabled on the unit.
	+ Not have Supress Movement state flag from Buff Behavior.
	+ Oddly for units with acceleration but no speed, should a buff behavior sets its speed to force it to move, it will also needs to be lifted up in height. Just 0.01 can do. This is very unusual, as some units may require it, others not (perhaps a bug). This was true when tested on a Siege Tank Sieged, a supply depot.

## Usage Example

### Tutorial by ProzaicMuze

https://www.sc2mapster.com/forums/resources/tutorials/9021-data-force-effects-intermediate-difficulty/

## Fields Description

### Effect: AI Notify Flags

* Responses sent to the AI to determine what to do. Don't know how much these affect gameplay.

### Effect: Alert

* The alert played from the **Alerts** data type if the effect fails due to validators returning false

### Effect: Amount

* Amount of force applied. Larger absolute values of force aren't more effective than -1 or 1. -1 Pulls the targets toward the origin of the force, 1 pushes it away.

### Effect: Chance

* The chance of applying the effect
* For example, if you have this effect in a set with a standard damage effect for lets say the ultralisk attack, and a chance of 0.33, 33% of all attacks would push back units (Not by much since using forces for considerable pusbacks is more complicated)

### Effect: Mass Fraction

* A units mass can be set in the unit tab, but i don't think this field has any effect just like values over 1 or under -1 in the field above.

### Effect: Response Flags

* Responses a Units AI will consider after being affected by this effect. No response flags mean that the affected unit won't react at all. How a unit can respond is determined by the **Behavior: Response** field of the **Units** data type.
	+ Aquire: Causes hostile units to attack the user of this effect
	+ Flee: Causes hostile units to run from the user of this effect

### Effect: Time Scale Source - 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 Effect: Time Scale Source - Value field

### Effect: Time Scale Source - Value

* This field determines the unit whose time scale is used for the duration over which the force is applied. (If you use a behavior that reduces the time scale of a unit, for any behaviors/actions that take time to perform and the time scale is based on the slowed unit, the target of the force will be pushed back slower and for longer.)
* Caster: Uses the timescale of the caster to determine the timescale over which the force is applied
* Global: Uses the timescale of the gamespeed to determine the timescale over which the force is applied
* None: Applied the force over the same timescale regardless of situation
* Target: Uses the timescale of the target unit to determine the timescale over which the force is applied

### Effect: Unit - 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 Effect: Unit - Value field

### Effect: Unit - Value

* The unit affected by the effect.
* Target: The target of the ability or effect that caused this effect to be executed.
* Caster: The unit that started the chain of effects that included this effect.
* Source: The unit this effect originates from, for example if a behavior is applied to some unit, and that behavior then somehow applies this effect, Source target the unit that has the behavior, and not the caster.
* Outer: (Unknown)
* Unit Origin: (Unknown)

### Validators

* The validators from the **Validators** data type that needs to return true for the effect to fire

### Target - 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 - Location - Value field

### Target - Location - Value

* Unlike other effects, this doesn't determine what point/unit is affected, but from what unit/point the force is calculated from. If you have a negative force, the target unit (Check below) will be pulled towards the point set in this field, and positive forces will push the target away.
### Target: Marker - Count

* The number of markers added by this effect

### Target: Marker - Link

* The ID string allowing several effects to share the same pool of markers