# Tactical AI Filter Melee
Grammar — Tactical AI Filter - inCombat only melee in filter
Flags —Native
|Action
# Arguments
aifilter
— Filterbool
<preset::IncludeIgnoreOption> — In Combat
Returns — void
native void AISetFilterMelee(aifilter filter, bool want);
# Related
Category: AI Advanced / Filters / Actions
- Tactical AI Filter Alliance —
void
— AISetFilterAlliance - Tactical AI Filter Markers —
void
— AISetFilterMarker - Tactical AI Filter Remove Self —
void
— AISetFilterSelf - Tactical AI Filter Range —
void
— AISetFilterRange - Tactical AI Filter In Combat —
void
— AISetFilterInCombat - Tactical AI Filter Melee —
void
— AISetFilterMelee - Tactical AI Filter Life —
void
— AISetFilterLife - Tactical AI Filter Life Lost —
void
— AISetFilterLifeLost - Tactical AI Filter Life Sort Reference —
void
— AISetFilterLifeSortReference - Tactical AI Filter Life Modifier —
void
— AISetFilterLifeMod - Tactical AI Filter Life Per Marker —
void
— AISetFilterLifePerMarker - Tactical AI Filter Movement Plane —
void
— AISetFilterPlane - Tactical AI Filter Unit Filter —
void
— AISetFilterBits - Tactical AI Filter Shields —
void
— AISetFilterShields - Tactical AI Filter Energy —
void
— AISetFilterEnergy
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:62
// Get a list of only melee enemies
filterAI = AIFilter(player);
AISetFilterMelee(filterAI, c_onlyMelee);
meleeEnemyGroup = AIGetFilterGroup(filterAI, groundEnemies);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:130
// filter only ranged units
filterAI = AIFilter(player);
AISetFilterMelee(filterAI, c_onlyRanged);
rangeEnemyGroup = AIGetFilterGroup(filterAI, groundEnemies);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:563
// Filter out air units, non-melee units, and units already in a temporal field
filterAI = AIFilter(player);
AISetFilterMelee(filterAI, c_onlyMelee);
AISetFilterPlane(filterAI, c_planeGround);
AISetFilterCanAttackAlly(filterAI, c_groundAlliesNearby, false);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:875
if (wanted == c_nullString) {
filter = AIFilter(player);
AISetFilterMelee(filter, c_onlyRanged);
AISetFilterValidPassenger(filter, aiUnit);
nearBunkerGroup = AIGetFilterGroup(filter, nearBunkerGroup);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:908
if (wanted == c_nullString) {
filter = AIFilter(player);
AISetFilterMelee(filter, c_onlyRanged);
AISetFilterValidPassenger(filter, aiUnit);
nearBunkerGroup = AIGetFilterGroup(filter, nearBunkerGroup);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:217
filter = AIFilter(player);
AISetFilterMelee(filter, c_onlyRanged);
AISetFilterPlane(filter, c_planeGround);
AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperCloudBuff);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:63
// Get a list of only melee enemies
filterAI = AIFilter(player);
AISetFilterMelee(filterAI, c_onlyMelee);
meleeEnemyGroup = AIGetFilterGroup(filterAI, groundEnemies);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:132
// filter only ranged units
filterAI = AIFilter(player);
AISetFilterMelee(filterAI, c_onlyRanged);
rangeEnemyGroup = AIGetFilterGroup(filterAI, groundEnemies);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:545
// Filter out air units, non-melee units, and units already in a temporal field
filterAI = AIFilter(player);
AISetFilterMelee(filterAI, c_onlyMelee);
AISetFilterPlane(filterAI, c_planeGround);
AISetFilterCanAttackAlly(filterAI, c_groundAlliesNearby, false);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:846
if (wanted == c_nullString) {
filter = AIFilter(player);
AISetFilterMelee(filter, c_onlyRanged);
AISetFilterValidPassenger(filter, aiUnit);
nearBunkerGroup = AIGetFilterGroup(filter, nearBunkerGroup);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:873
if (wanted == c_nullString) {
filter = AIFilter(player);
AISetFilterMelee(filter, c_onlyRanged);
AISetFilterValidPassenger(filter, aiUnit);
nearBunkerGroup = AIGetFilterGroup(filter, nearBunkerGroup);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:294
filter = AIFilter(player);
AISetFilterMelee(filter, c_onlyRanged);
AISetFilterPlane(filter, c_planeGround);
AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, c_BF_ViperCloudBuff);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:226
AISetFilterAlliance(lv_enemyNearbyFilter, c_playerGroupEnemy);
AISetFilterMelee(lv_enemyNearbyFilter, false);
lv_enemiesNearby = AIGetFilterGroup(lv_enemyNearbyFilter, lp_nearByUnits);
auto2822F891_g = lv_enemiesNearby;
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:291
AISetFilterAlliance(lv_enemyNearbyFilter, c_playerGroupEnemy);
AISetFilterMelee(lv_enemyNearbyFilter, false);
lv_enemiesNearby = AIGetFilterGroup(lv_enemyNearbyFilter, lp_nearByUnits);
auto9461D501_g = lv_enemiesNearby;