# Tactical AI Filter In Combat
Grammar — Tactical AI Filter - inCombat only in combat in filter
Flags —Native
|Action
# Arguments
aifilter
— Filterbool
<preset::IncludeIgnoreOption> — In Combat
Returns — void
native void AISetFilterInCombat(
aifilter filter,
bool inCombat,
);
# 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:512
filter = AIFilter(player);
AISetFilterInCombat(filter, c_onlyInCombat);
AISetFilterRange(filter, unitToCheck, nearbyRange);
nearbyEnemies = AIGetFilterGroup(filter, scanGroup);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:512
}
filter = AIFilter(player);
AISetFilterInCombat(filter, c_onlyInCombat);
inCombatEnemies = AIGetFilterGroup(filter, scanGroup);
if (UnitGroupCount(inCombatEnemies, c_unitCountAll) < minEnemies) {
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicTactical.galaxy:588
lv_rangeUnitFilter = AIFilter(lp_owner);
lv_damage = libGAwT_gf_AIAbilAccumlatedAmount(lp_owner, lp_aIUnit, lp_abil, lv_level, "Damage");
AISetFilterInCombat(lv_rangeUnitFilter, true);
AISetFilterAlliance(lv_rangeUnitFilter, c_playerGroupEnemy);
lv_unitsInRangeEnemyHeroes = AIGetFilterGroup(lv_rangeUnitFilter, UnitGroupFilter(null, c_playerAny, lv_unitsInRange, UnitFilter(0, (1 << (c_targetFilterHeroUnit - 32)), (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));