SC2Mapster.com Wiki

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

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.

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Mar 12, 2010
Last updated
Mar 12, 2010