UnitFilterStr
unitfilter UnitFilterStr(string filterRules);
Filter based off a rules pattern.
Parameters
- string filterRules
A pattern of rules.
- The pattern must be of the form: "Required Attributes;Excluded Attributes".
- If there is nothing to put in a category, write
"-". - Multiple attributes are separated by
","
Attributes can be
- Mechanical
- Ground
- Missile
- ... full list ...
Return value
unitfilter - A filter to be applied on a unitgroup.
Examples
- Example: Usage
unitfilter filter; filter = UnitFilterStr("Enemy;Air"); // This will require enemy units and will exclude air-bound ones. filter = UnitFilterStr("-;Ground"); // This will exclude ground units. filter = UnitFilterStr("Cloaked;-"); // This will require cloaked units. filter = UnitFilterStr("-;-"); // This will do nothing. filter = UnitFilterStr("Ally,Buried,Ground;Massive,Hidden"); // The filtered group will contain buried ground-bound allied units // Massive and hidden units will be excluded.