# Tactical AI Filter Movement Plane

Grammar — Tactical AI Filter - include in filter only units that move via plane
FlagsNative | Action

Sets the specified AI Filter to only include either air or ground units. Use this and the other “Tactical AI Filter” actions to set up an AI Filter, which can then be used in a “Tactical AI Filter - Run” function to filter a unit group.

# Arguments

Returns — void

native void AISetFilterPlane(aifilter filter, int plane);

Category: AI Advanced / Filters / Actions

# Examples

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

    // Filter out air units
    filterAI = AIFilter(player);
    AISetFilterPlane(filterAI, c_planeGround);
    AISetFilterCanAttackAlly(filterAI, c_groundAlliesNearby, false);
    groundEnemies = AIGetFilterGroup(filterAI, scanGroup);

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

    filterAI = AIFilter(player);
    AISetFilterMelee(filterAI, c_onlyMelee);
    AISetFilterPlane(filterAI, c_planeGround);
    AISetFilterCanAttackAlly(filterAI, c_groundAlliesNearby, false);
    AISetFilterBehaviorCount(filterAI, c_noBehaviorMin, c_noBehaviorMax, c_BF_TemporalField);

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

    // Filter out air units
    filterAI = AIFilter(player);
    AISetFilterPlane(filterAI, c_planeGround);
    groundEnemies = AIGetFilterGroup(filterAI, scanGroup);
    groundCount = UnitGroupCount(groundEnemies, c_unitCountAlive);

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

    // Filter out air units
    filterAI = AIFilter(player);
    AISetFilterPlane(filterAI, c_planeGround);
    groundEnemies = AIGetFilterGroup(filterAI, scanGroup);

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

    AISetFilterRange(filter, aiUnit, AIAbilityFixed(player, c_AB_LockOn, c_fieldRange0));
    if (airOnly == true) {
        AISetFilterPlane(filter, c_planeAir);
        // no min damage for air units since lock on is the only way to target them
    }

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

    filter = AIFilter(player);
    AISetFilterMelee(filter, c_onlyRanged);
    AISetFilterPlane(filter, c_planeGround);
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperCloudBuff);
    rangedGroup = AIGetFilterGroup(filter, scanGroup);

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

    
    filter = AIFilter(player);
    AISetFilterPlane(filter, c_planeAir);
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperParasiticBomb);
    AISetFilterMarker(filter, c_noMarkersMin, c_noMarkersMax, mark);

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

    groundAirFilter = AIFilter(player);
    AISetFilterAlliance(groundAirFilter, c_playerGroupEnemy);
    AISetFilterPlane(groundAirFilter, c_planeGround);
    enemyGroundCount = UnitGroupCount(AIGetFilterGroup(groundAirFilter, scanGroup), c_unitCountAlive);

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

    enemyGroundCount = UnitGroupCount(AIGetFilterGroup(groundAirFilter, scanGroup), c_unitCountAlive);

    AISetFilterPlane(groundAirFilter, c_planeAir);
    enemyAirCount = UnitGroupCount(AIGetFilterGroup(groundAirFilter, scanGroup), c_unitCountAlive);

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

    filter = AIFilter(player);
    AISetFilterAlliance(filter, c_playerGroupEnemy);
    AISetFilterPlane(filter, c_planeGround);
    AISetFilterCanAttackAlly(filter, c_groundAlliesNearby, false);
    enemyGroundCount = UnitGroupCount(AIGetFilterGroup(filter, scanGroup), c_unitCountAlive);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:2185

    if ((PlayerGetCooldown(UnitGetOwner(lp_aIUnit), "MutatorAmonZagaraBanelingBarrage") <= 0.0)) {
        AISetFilterAlliance(lv_targetFilter2, c_playerGroupEnemy);
        AISetFilterPlane(lv_targetFilter2, c_planeGround);
        AISetFilterBits(lv_targetFilter2, UnitFilter((1 << c_targetFilterVisible), 0, (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile) | (1 << c_targetFilterBuried), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32)) | (1 << (c_targetFilterHallucination - 32)) | (1 << (c_targetFilterInvulnerable - 32))));
        AISetFilterRange(lv_targetFilter2, lp_aIUnit, 10.0);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:2210

    }

    AISetFilterPlane(lv_targetFilter3, c_planeGround);
    lv_roachCandidates = AIGetFilterGroup(lv_targetFilter3, lp_nearByUnits);
    if ((UnitAbilityGetCooldown(lp_aIUnit, "MutatorAmonZagaraMassRoachDrop", "MutatorAmonZagaraInfestedPods") <= 0.0) && (UnitGroupCount(lv_roachCandidates, c_unitCountAlive) > 0)) {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:2329

    lv_slashDamage = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonShadowBladeDamage", "Amount", lp_owner));
    lv_blinkDistance = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonZeratulBlink", "Range", lp_owner));
    AISetFilterPlane(lv_canidatesFilter, c_planeGround);
    AISetFilterLifeSortReference(lv_canidatesFilter, lv_slashDamage, (lv_slashDamage * 0.2));
    if ((UnitAbilityGetCooldown(lp_aIUnit, "MutatorAmonZeratulBlink", "Abil/MutatorAmonZeratulBlink") <= 0.0)) {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:2427

        lv_abilityDamage = CatalogFieldValueGetAsInt(c_gameCatalogEffect, "MutatorAmonKerriganPrimalSlash", "Amount", lp_owner);
        AISetFilterLife(lv_primalSlashTargetFilter, lv_abilityDamage, 524287.0);
        AISetFilterPlane(lv_primalSlashTargetFilter, c_planeGround);
        AISetFilterRange(lv_primalSlashTargetFilter, lp_aIUnit, lv_abilityRadius);
        lv_canidates = AIGetFilterGroup(lv_primalSlashTargetFilter, lv_enemiesNearby);

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

	
	filter = AIFilter(player);
	AISetFilterPlane(filter, c_planeGround);
	AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_DefilerDarkSwarm);
    AISetFilterMarker(filter, c_noMarkersMin, c_noMarkersMax, mark);

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

    // Filter out air units
    filterAI = AIFilter(player);
    AISetFilterPlane(filterAI, c_planeGround);
    AISetFilterCanAttackAlly(filterAI, c_groundAlliesNearby, false);
    groundEnemies = AIGetFilterGroup(filterAI, scanGroup);

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

    filterAI = AIFilter(player);
    AISetFilterMelee(filterAI, c_onlyMelee);
    AISetFilterPlane(filterAI, c_planeGround);
    AISetFilterCanAttackAlly(filterAI, c_groundAlliesNearby, false);
    AISetFilterBehaviorCount(filterAI, c_noBehaviorMin, c_noBehaviorMax, c_BF_TemporalField);

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

    // Filter out air units
    filterAI = AIFilter(player);
    AISetFilterPlane(filterAI, c_planeGround);
    groundEnemies = AIGetFilterGroup(filterAI, scanGroup);
    groundCount = UnitGroupCount(groundEnemies, c_unitCountAlive);

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

    // Filter out air units
    filterAI = AIFilter(player);
    AISetFilterPlane(filterAI, c_planeGround);
    groundEnemies = AIGetFilterGroup(filterAI, scanGroup);

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

    AISetFilterRange(filter, aiUnit, AIAbilityFixed(player, c_AB_LockOn, c_fieldRange0));
    if (airOnly == true) {
        AISetFilterPlane(filter, c_planeAir);
        // no min damage for air units since lock on is the only way to target them
    }

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

    filter = AIFilter(player);
    //AISetFilterMelee(filter, c_onlyRanged);
    AISetFilterPlane(filter, c_planeGround);
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperDisablingCloud);
    rangedGroup = AIGetFilterGroup(filter, scanGroup);

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

    filter = AIFilter(player);
    AISetFilterMelee(filter, c_onlyRanged);
    AISetFilterPlane(filter, c_planeGround);
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperCloudBuff);
    rangedGroup = AIGetFilterGroup(filter, scanGroup);

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

    
    filter = AIFilter(player);
    AISetFilterPlane(filter, c_planeAir);
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperParasiticBomb);
    AISetFilterMarker(filter, c_noMarkersMin, c_noMarkersMax, mark);

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

    groundAirFilter = AIFilter(player);
    AISetFilterAlliance(groundAirFilter, c_playerGroupEnemy);
    AISetFilterPlane(groundAirFilter, c_planeGround);
    enemyGroundCount = UnitGroupCount(AIGetFilterGroup(groundAirFilter, scanGroup), c_unitCountAlive);

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

    enemyGroundCount = UnitGroupCount(AIGetFilterGroup(groundAirFilter, scanGroup), c_unitCountAlive);

    AISetFilterPlane(groundAirFilter, c_planeAir);
    enemyAirCount = UnitGroupCount(AIGetFilterGroup(groundAirFilter, scanGroup), c_unitCountAlive);

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

    filter = AIFilter(player);
    AISetFilterAlliance(filter, c_playerGroupEnemy);
    AISetFilterPlane(filter, c_planeGround);
    AISetFilterCanAttackAlly(filter, c_groundAlliesNearby, false);
    enemyGroundCount = UnitGroupCount(AIGetFilterGroup(filter, scanGroup), c_unitCountAlive);

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


    filter = AIFilter(player);
    AISetFilterPlane(filter, c_planeGround);
    AISetFilterAlliance(filter, c_playerGroupEnemy);
    AISetFilterRange(filter, aiUnit, AIWeaponFixed(player, c_WE_LurkerMP, c_fieldRange0) - 1);