SC2Mapster.com Wiki

SC2 API / Functions / UnitFilterSetState

UnitFilterSetState

void UnitFilterSetState(unitfilter filter, int attribute, int state);

Add attribute to a filter.

Parameters

unitfilter filter

Filter to modify

int attribute

Attribute can be one of

  • 6 (c_targetFilterGround): Ground
  • 11 (c_targetFilterMechanical): Mechanical
  • 20 (c_targetFilterMissile ): Missile
  • ... full list ...
int state

State of the attribute

  • 0 (c_unitFilterAllowed): Allowed attribute. This is the default value for all the attributes
  • 1 (c_unitFilterRequired): Required attribute
  • 2 (c_unitFilterExcluded): Excluded attribute

Examples

Example: Usage
unitfilter filter;

filter = UnitFilter(0, 0, 0, 0);
UnitFilterSetState(filter, c_targetFilterEnnemy, c_unitFilterRequired);
UnitFilterSetState(filter, c_targetFilterBuried, c_unitFilterRequired);
UnitFilterSetState(filter, c_targetFilterAir, c_unitFilterExcluded);
// This will require enemy buried units and will exclude air-bound

// A shorter way to write it using UnitFilterStr
filter = UnitFilterStr("Enemy,Buried;Air");

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

Author