Data/Effects/Create Persistent

## Create Persistent

### Description

Probably the most used and most useful effect type in the editor when doing anything harder than the simplest of abilities. These effects can have a duration, fire multiple effects, create all kinds of offsets, move, reveal areas, and more.

### Hint

* Create Persistent can have a **Target: Location** on units which will make the origin update from where the unit is.
* Orphan Parameters from \*\*Effect:Flags+\*\* can be used to determine a relative coordinate system based on a unit's facing direction or other frame of reference by overriding the game's coordinate system. \*\*Target: Location\*\* determines the origin for all offsets of that system while \*\*Target:Location Offset- Start\*\* and \*\*Target:Location Offset- End\*\* determine the vector for the y-axis and the fallback can be used when those values are not given or cannot be used to determine a direction.
* As far as I can tell, relative coordinate systems defined with Orphan Parameters flag enabled will only work for periodic offsets.

## Example Usage

### Mothership Vortex

The Mothership's Vortex ability creates several persistent effects to pull the units to the epicenter.

### URL

* Starcraft 2 Liberty Multi Dependency in the world editor.

### WASD movement

Many data based wasd systems use Create Persistents to issue orders to offsets and then bind the hotkeys to the respective WASD keys for movement that doesn't add as much performance hit as using triggers to listen for keystrokes.

#### URL

* [WASD Tutorial]
* [Relative WASD Post]

## Fields Description

### (None) - Periodic Effect Rate Multiplier

Just as the Weapon Rate Multiplier does, this field speeds or slows down the execution of period durations. Ex: (As a multiplier) putting a value of 2 will make a Period Duration of 1 second run in 0.5 second, since it's being performed twice as fast. Putting a value of 0,5 in the rate multiplier will instead increase the Period Duratiion to 2 seconds. A good use of this field could be for upgrades. Ex: If there's an upgrade that should increase the rate at which the Lurker launches its spines, modifying each field is bothersome and spams the upgrade field array. For mathematical reasons also, if that upgrade can be upgraded 2 times (2 levels) and the user wants to use the multiplication of each period duration by let's say, 0,85 (to increase the speed by 15%), the second upgrade will not calculate 15% from the first Period Duration, but from the last modification. So instead of speeding it up by 15% twice as intented, the second value will give but a smaller speed increase.

* Since patch 5.0, upgrades can now upgrade from basic values, making this field a duplicated method. It may still be used for the same purpose.

### Effect - Effect Expire

The effect that is executed after the expire delay. Note that destroying or stopping the persistent will prevent the effect from expiring. Example, the ghost's nuclear strike can be canceled by killing the ghost or moving him out of range before he finishes channeling.

### Effect - Effect Final

The effect that is executed when the persistent ends (this includes expiration, destruction vis Destroy Persistent or ending due to Success/Failure flags or failing a periodic validator)

### Effect - Effect Initial

The effect that is executed after the initial delay.

* If no delay is set (so 0 second), the initial effect is executed before the Persistent itself. This is useful to keep in mind in cases where setting a "Chaneling effect" in the initial effect would fail, knowing that this effect couldn't be supported by this Persistent's channeled flag.

### Effect - Effect Random Mode

Selects the randomization mode of periodic effects if the the flag **Random Effect** is enabled.

### Effect - Expire Delay

The time the persistent takes to expire after the last period.

### Effect - Flags

Flags/Options for the persistent effect.

* **Channeled:** Provides Channel, binding the Caster to this ability/weapon while the channel is going. If the channel stage can be interrupted, taking any other action will interrupt this channel.
* **Channeling:** Sets up this effect to exist only/to be dependant of an active channel in the parent effects (Create Persistent/Create Healer or parent buff behavior with "Channeled" flag on) . In the absence of any Channeled parent, this flag being enabled will instantly destroy the effect. Using this flag in pair with the "Channeled" flag above is pointless, as an interrupted Channeled effect still gets to be destroyed anyway, ending with the same result. This flag is usually best used to clear up left overs of a channel effect without relying on Remove Behavior effects, or to avoid them from extending the channel (a chain of "Channeled" effects always stands as long as one channel effect keeps going on).
* **Failure (Conditional)**: If checked, the persistent effect will be destroyed if the initial effect or the periodic effect fails (due to validator not passing)
	+ Useful for making chained effects
* **Success (Conditional):** If checked, the persistent effect will be destroyed if the initial effect or the periodic effect succeeds (executes)
	+ Useful for making chained effects
	+ Viper's Abduct (Delay Persistent) uses this
	+ Can replace a periodic validator at some point
	+ Does not work if all periodic effects are run at 0 Period Duration. A reliable value would be 0.0625 minimum although a deeper test prooved a value of 0,0314 to work, while 0.0312 failed, unaffected by game speed). The reason behind this is because an effect that will be successful will not cancel other effects that were already produced at the same moment and that, EVEN if they are listed in a specific Index order (yes they get to follow the indexed priority, but this is meaningless at 0 sec.). It only prevents what has not yet came to pass.
	+ An effect that launches, validators passed, but failed by the "Chance" field, is still considered as Success and will end the Persistent Effect.
* **Orphan Parameters:**
	+ Has a special relationship with User Data effects, and can allow you to have multiple of the same Key being used in seperate scopes from within the same ability cast.
	+ Orphans the effects created by the persistent. Those effects are created off an orphan scope, meaning no caster, or target to start with. Be advised that this can break channels reference to the caster, voiding further effects that are "channeled".
	+ Does not suppress combat timers such as damage dealt time. Ex: Burndown Damage from Structure Burnout buff behavior. Any Terran structure that should act if validated damage dealt will consider this as dealing damage to self.
* **Random Effect:** Makes the persistent choose a random effect each period from \*\*Effect: Period Effects+\*\* (Persistent default is to run in ordered sequence).
* **Random Offset:** Makes the persistent choose a random offset each period from \*\*Effect: Periodic Offsets+\*\* (Persistent default is to run in ordered sequence).
* **Random Period:** Makes the persistent choose a random period duration each period from \*\*Effect: Period Durations+\*\* (Persistent default is to run in ordered sequence).
* **Persist Until Destroyed:** When checked, this will keep the persistent from destroying itself after the expire delay. When checked, one must use either the Success, Failure flags in conjuction with periodic effects or a periodic validator or a "Destroy Persistent" Effect to end the persistent and trigger it's final effect. If the effect is channeled, the it can be broken by stopping.

### Effect - Height Map

If the Reveal Radius is non-zero, then this field configures what height map the reveal occurs on. If the reveal happens on the air height map then line of sight is ignored.

### Effect - Initial Delay

The delay before the initial effect is run.

### Effect - Offset Random Mode

Selects the randomization mode of periodic offsets if the the flag **Random Offset** is enabled.

### Effect - Period Count

Number of periods this persistent will run.

* Now interacts with accumulators

### Effect - Period Durations

Duration of each period. If multiple durations are put in, the effect will cycle through them. If random period is on, a random period will be selected

### Effect - Period Effects

The effect that will run each period. If multiple effects are put in, the persistent will cycle through them. if random effect is on, a random effect will be picked each period.

* Limit of 32 effects (Index will show 31 because the first one is 0).

### Effect - Period Random Mode

Selects the randomization mode of periodic durations if the the flag **Random Period** is enabled.

### Periodic Offsets

The offset the periodic effect will have from it's original location at each period (max 32). Once all the offsets have been cycled through it will default to the first offset if there are more periods than offsets.

### Periodic Validator

The validator that is checked before the Initial effect (including the delay duration) up until the expire effect momentum. If it returns false, the effect is destroyed.

* If the flag **Persist until destroyed** is used, this periodic validator still runs a check for the whole endless duration all the same.

* The **Effect Final** may still run unless a validator in its effect returns false.
* Only 1 entry per effect. However, one can use a "Combine" validator to solve this.
* **Validator** field only checks once compared to this field. For example, if the validator set in "Validator" field requires a ground unit filter, and the unit dies, the effect may still run its course, (unless flagged Channeled, to a target unit location). If the same ground unit filter validator was to be used in this field instead, at the moment the unit dies/becomes invalid, the periodic validator will end the effect, channeled or not.
* Like the **Validator** field, the target location checked by this field is the final target of the parent effect. Even if the Persistent effect aims to another location, this field still obeys to the parent effect location. A proper validator with a specified location can care for fixing such an issue.
* Is active at the initial delay and may prevent the initial effect, but will not prevent it if the if the initial delay = 0. Only a "Validator" field can prevent the initial effect.

### Effect - Response Flags

This deterines how the AI should respond to this effect.

### Effect - Time Scale Source

Usually, time scale is affected by Buff Behaviors. The Nexus Chrono Boost ability does so on structures.

#### Effect

This determine the parent effect to be used in the effect chain to determine a relative location to indicate which caster/target/source/etc is value indicated below

#### Value

Which location is representative of the time scale that governs this persistent effect.

Ex: You wouldn't want a unit time slowed to shoot its machinegun at full time rate. You would set the Time Scale source to caster for its weapon's Persistent effect.

* Caster: The caster's time scale equals the time scale of this effect.
* Global: Uses the global game speed time.
* None: The time scale of this persistent will never be affected.
* Target: The target location indicated in this persistent equals the time scale of this effect.

### Search

#### Detect Filters

Unit filters for what units can be detected by this persistent. Only applicable if the "detect" flag is selected.

#### Radar Filters

Filters for the "radar" of the effect should the flag be checked below. Only applicable if the "radar" flag is selected.

* For some reason all ingame units prefer to use the application of a radar behavior.

#### Reveal Arc

Angle of the reveal (probably a default angle at all). Default at 360°.

#### Reveal Facing

If the reveal arc is below 360°, determines the rotation point of the Arc.

#### Reveal Flags

* **Unfog:** The area will have the fog of war removed.
* **Detect:** The area will detect any units that pass the Detect Filters
* **Radar:** The area will show any units that pass the radar filters with the radar graphics and on the minimap.
* **Use Line of Sight:** The reveal, if set to use the ground height map, will respect line of sight from the target unit or point.
* **Permanent:** The revealed area will stay revealed after the persistent is destroyed.

#### Reveal Radius

Radius which will be revealed for the casting player. A very common example of this is the Orbital Command's Scanner Sweep ability

* Now interacts with accumulators. The reference is however, only effective once. For example, if the Persistent creates a radius based on behavior stacks which increase over time, the radius will not increase on that very effect; A new one must be created. In other words, the accumulator is only checked once upon creation.

#### Reveal Rectangle Height

If set, transform the reveal into a rectangular shape. This represents the length back to front.

#### Reveal Rectangle Width

If set, transform the reveal into a rectangular shape. This represents the largeness side to side

### Target - Location

#### Value

* Location at which the persistent will take effect. Not to be mistaken with ability target!
* Effect is the effect in the chain which created this effect to override this effect's unit/point value parameter.
* Value is the unit or point which will define the location of this effect.
* All offsets will use this point as the origin.

#### Effect

Relative effect from which the value is looked upon.

### Target - Location: Offset - End

Coordonates the angle of any offset at the arrival point that should be executed by this persistent.

* This can take an absolute value: ex: Lurkers Offset end is at target point, which means that the spines (weapon), while "offset'ing" from source (caster) toward the target, they end up looking only for the closest point location of where the target was when created at the offset location, and may fail to hit it if the target should move out of range. If you should change this field to "Target Unit" instead, this would mean that despite where the target unit is, the spines will always end up hitting the target unit at the end.

### Target - Location Offset - Start

Coordonates the angle of any offset from the launch point that should be executed by this persistent.

### Target - Offset

#### Expire

* Location offset where the expire effect will be executed.

#### Final

* Location offset where the final effect will be executed.

#### Initial

* Location offset where the initial effect will be executed.

#### Facing Fallback +

* If Target Offset Start and End are not defined as to create a direction this will be used to determine a vector for the y-axis.

## Related

* Search Area
* Issue Order
* Create Unit
* Teleport

## Related

* [Area Effect]
* [Order Effect]
* [Unit Effect]
* [Unit Effect]