SC2Mapster.com Wiki

SC2 API / Functions / UnitGroupAlliance

UnitGroupAlliance

unitgroup UnitGroupAlliance(int player,
	       	             int alliance,
	       	             region r,
	       	             unitfilter f,
	       	             int max);

Create a unit group based on alliance.

Parameters

int player
  • -1 (c_playerAny): No restriction on the player
  • n: Player n to be compared
int alliance
  • 0 (c_unitAllianceAny): No restriction on the alliance
  • 1 (c_unitAllianceAlly): Units allied to the player
region r
  • null: No restriction on the region. All the map is being taken in account
  • region: Only get units from that region
unitfilter f
  • null: No restriction on the unit filter.
  • filter: Only get units that match the filter
int max
  • 0: No maximum
  • n: Maximum number of units in the group.

Examples

Example: Sample Usage
int player = 2;
int alliance = c_unitAllianceAlly;
unitfilter filter = UnitFilterStr("Ground;Cloaked");
region reg = RegionCircle(Point(50, 50), 30);
int max = 10;

unitgroup g = UnitGroupAlliance(player, alliance, reg, filter, max);
// Select all units matching the following criterias
// * Unit is a Pylon
// * Unit is allied to player 2
// * Unit is Ground and not Cloaked
// * Unit is in the region centered at (50, 50) of radius 30
// * Only the first 10 units

See also

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

Facts

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

Authors