# Units In Unit Group Targetable As

Grammar — Units in group|Unit Group targetable as plane, with at most count
FlagsNative | Function

Returns a unit group that contains units that have passed the specified filters from another unit group.

# Arguments

  • unitgroup — Group
  • int<preset::UnitPlane> — Plane
  • int — Count

Returns — unitgroup

native unitgroup UnitGroupFilterPlane(
	unitgroup g,
	int plane,
	int maxCount,
);

Category: Unit Group / Useful Unit Groups

# Examples

campaigns/liberty.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:168

    
    enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
    enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
        return;

campaigns/swarm.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:168

    
    enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
    enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
        return;

campaigns/void.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:168

    
    enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
    enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
        return;

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:219

    }
    if (AINearbyUnits(player, c_PU_Immortal, here, 10, 1)) {
        targetGroupGround = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
        onGround = UnitGroupCount(targetGroupGround, c_unitCountAll);
        if (onGround > 1) {

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1732

    }

    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1789

    }

    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:406

    }

    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    ord = AIOrderReapKD8Charge(player, aiUnit, targetGroup, mark);
    if (ord == null) {

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:638

    //  Next, find the number of ground and air units within viking range.
    //
    targetGroupGround = UnitGroupFilterPlane(targetGroupAll, c_planeGround, 0);
    onGround = UnitGroupCount(targetGroupGround, c_unitCountAll);
    targetGroupAir = UnitGroupFilterPlane(targetGroupAll, c_planeAir, 0);

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:640

    targetGroupGround = UnitGroupFilterPlane(targetGroupAll, c_planeGround, 0);
    onGround = UnitGroupCount(targetGroupGround, c_unitCountAll);
    targetGroupAir = UnitGroupFilterPlane(targetGroupAll, c_planeAir, 0);
    inAir = UnitGroupCount(targetGroupAir, c_unitCountAll);

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:715

                                     0)
                                     ;
    airGroup = UnitGroupFilterPlane(airGroup, c_planeAir, 0);
    inAir = UnitGroupCount(airGroup, c_unitCountAlive);

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1753

    //  Find the number of ground and air units nearby.
    //
    targetGroupAir = UnitGroupFilterPlane(scanGroup, c_planeAir, 0);
    inAirCount = UnitGroupCount(targetGroupAir, c_unitCountAll);
    

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1093

    }
    
    enemyAirGroup = UnitGroupFilterPlane(scanGroup, c_planeAir, 0);
    if (UnitGroupCount(enemyAirGroup, c_unitCountAlive) > 0) {
        // attacking air is better than using caustic spray on ground

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1099

    }

    enemyGroundGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    ord = AIUnitGroupGetValidOrder(enemyGroundGroup, ord, aiUnit, c_forwards);    
    return ord;

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1376

    
    // locusts can only attack ground
    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:518

    
    enemyGroup = UnitGroupFilterThreat(scanGroup, aiUnit, null, 0);
    enemyGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    if (UnitGroupCount(enemyGroup, c_unitCountAlive) <= 0) {
        return;

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1721

    }

    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1778

    }

    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:388

    }

    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    ord = AIOrderReapKD8Charge(player, aiUnit, targetGroup, mark);
    if (ord == null) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:614

    //  Next, find the number of ground and air units within viking range.
    //
    targetGroupGround = UnitGroupFilterPlane(targetGroupAll, c_planeGround, 0);
    onGround = UnitGroupCount(targetGroupGround, c_unitCountAll);
    targetGroupAir = UnitGroupFilterPlane(targetGroupAll, c_planeAir, 0);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:616

    targetGroupGround = UnitGroupFilterPlane(targetGroupAll, c_planeGround, 0);
    onGround = UnitGroupCount(targetGroupGround, c_unitCountAll);
    targetGroupAir = UnitGroupFilterPlane(targetGroupAll, c_planeAir, 0);
    inAir = UnitGroupCount(targetGroupAir, c_unitCountAll);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:691

                                     0)
                                     ;
    airGroup = UnitGroupFilterPlane(airGroup, c_planeAir, 0);
    inAir = UnitGroupCount(airGroup, c_unitCountAlive);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1707

    //  Find the number of ground and air units nearby.
    //
    targetGroupAir = UnitGroupFilterPlane(scanGroup, c_planeAir, 0);
    inAirCount = UnitGroupCount(targetGroupAir, c_unitCountAll);
    

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1816

    }   
    
    validTargets = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    if (UnitGroupCount(validTargets, c_unitCountAlive) > 0) {
        ord = AICreateOrder(player, c_AB_SiegeMode, 0);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1845

    }   
    
    validTargets = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    if (UnitGroupCount(validTargets, c_unitCountAlive) == 0) {
        ord = AICreateOrder(player, c_AB_SiegeUnmode, 0);

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1302

    }
    
    enemyAirGroup = UnitGroupFilterPlane(scanGroup, c_planeAir, 0);
    if (UnitGroupCount(enemyAirGroup, c_unitCountAlive) > 0) {
        // attacking air is better than using caustic spray on ground

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1308

    }

    enemyGroundGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    ord = AIUnitGroupGetValidOrder(enemyGroundGroup, ord, aiUnit, c_forwards);    
    return ord;

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1490

    }
    
    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1534

    
    // locusts can only attack ground
    targetGroup = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
    count = UnitGroupCount(targetGroup, c_unitCountAll);
    if (count == 0) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:1650

    } 
    else {    
        validTargets = UnitGroupFilterPlane(scanGroup, c_planeGround, 0);
        if (UnitGroupCount(validTargets, c_unitCountAlive) == 0) {
            ord = AICreateOrder(player, c_AB_BurrowLurkerUp, 0);

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:39


bool GAw3_UnitGroupHasAirUnit(unitgroup ug){
    return UnitGroupCount(UnitGroupFilterPlane(ug, c_planeAir, 0),c_unitCountAlive)>0;
}
int GAw3_UnitGroupCRLevel(unitgroup ug){