Data/Validators/Unit Compare Field

### Hint

* To find the Validator - Field string required just look at the name of the field of interest under the Units data type with View Raw Data (Ctrl + D) enabled, or copy the data reference of a field and paste it to read the exact field's name.
* Is a very powerful tool if used right
* Using the Editor+ fields allows filtering of units more effectively than the Unit Filter and Unit Type validators

### Bug

* Maybe this is intended: Non-Numeric fields do not work with the "Not Equal to". All units with no Alias at all, or without another Alias are considred as "Not Equal To" as well. They must all be set to equal.
	+ To solve this, use a Combine validator before hand with the **Negate** Field on. Make sure that the Unit Compare Field validator is set to "Equal to".
* Some fields limit the value to only 4 characters, such as "Race". "Protoss" won't work, while "Prot" will; It is unknown why.

## Example Usage

### TargetRadiusLarge

Validator used by the **Siege Tank - Crucio Shock Cannon** weapon to determine if the target unit has an integer in the **Movement: Radius** field that is greater than or equal to 1.25. Based on the result of the validation, a Switch effect used either the blast or directed Damage effect.

#### URL

As the TargetRadiusLarge validator is already in the editor, no URL is needed

### Disguise As Marine

Validator that is part of the **Disguise As Marine Without Shield** Combine validator used by the **Changeling - Disguise (Switch Based On Unit Target Type)** Switch effect. The validator checks the **Stats: Race** field of the target unit to see if it equal to the **Terr** string, which is the raw data value for Terran. If the validator returns true the **Switch** effect uses an Issue Order effect on the caster to morph the changeling into a marine without a shield.

### Other tips for use:

* Use the User Tag field : Set the field name "UserTag" (Putting a space will return it false). Then, in the value, imput the Text Key only (the text key can contain spaces, but respect them when putting it in the value). The written text is never considered, but for modder use, you can fill it to avoid it to look empty when checking the unit data.

#### URL

As the Disguise As Marine validator is already in the editor, no URL is needed

## Fields Description

### Validator - Compare

* Logic function that the value of the Validator - Field on the unit and the Validator - Value are compared with
* Equal To
* Greater Than
* Greater Than Or Equal To
* Less Than
* Less Than Or Equal To:
* Not Equal To

### Validator - Failure Result

* The alert from an unknown source that is played if the validator fails to return true

### Validator - Field

* The **raw data** string of the field name from the Units data type that the validator is to compare
* Leave out the CUnit\_
* Requires a different format for arrays, requires a [index number] directly after the field name and any sub names are conjoined by a . not a \_ symbol.
* Is unable to search whole arrays and can only search individual slots of the array eg. the first weapon in the **Combat: Weapons - Weapon** field is WeaponArray[0].Link
* Seems to be only working with the Operator set at "Equal to".

### Validator - Unit - Effect

* Specific effect, from a previous effect in the effect tree, that the scope of which is to be used in combination with the **Validator - Unit - Value** field to determine the unit validated

### Validator - Unit - Value

* Caster: Validates the casting unit
* Outer: Validates a unit that is not Target, Source, Caster, or Origin
* Source: Validates the most recent unit targeted or created by a previous effect in the effect tree
* Target: Validates the target unit unless specified otherwise by the Validator - Unit - Effect field
* Unit Origin: (Unknown)
* Unknown: (Unknown

### Validator - Value

String or integer against which the value of the **Validator - Field** on the unit is compared with

* Hint: Fields that have text such as "Name" only have their Text Key value checked, not their actual text.

## Related

* Abilities
* Behaviors
* Effects
* Validate Creation Effect
* Validate Player
* Validate Position
* Validate Unit
* Validate Unit Type