# Tactical AI Filter Life Per Marker
Grammar — Tactical AI Filter - use marker to remove units from filter when targets have less than each vitality per marker
Flags —Native
|Action
Sets the specified AI Filter to only include units whose current life is greater than the number of specified markers currently on them times the value specified in the Each parameter. In this context, markers are an AI system construct used to mark targets of abilities before the ability’s effects execute. 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
aifilter
— Filterfixed
— Eachmarker
— Marker
Returns — void
native void AISetFilterLifePerMarker(
aifilter filter,
fixed each,
marker m,
);
# 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
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:244
filter = AIFilter(player);
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterLifePerMarker(filter, damage*0.5, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:440
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterBits(filter, UnitFilterStr("-;Missile,Self,Stasis,Dead,Hidden,Invulnerable"));
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/ttosh03a.sc2map/MapScript.galaxy:468
AISetFilterBits(lv_snipeFilter, libNtve_gf_ConvertTargetFilterStringToUnitFilter(CatalogFieldValueGet(c_gameCatalogAbil, "Snipe", "TargetFilters[" + IntToString(0) + "]", lp_owner)));
AISetFilterRange(lv_snipeFilter, lp_ghost, (StringToFixed(CatalogFieldValueGet(c_gameCatalogAbil, "Snipe", "Range[" + IntToString(0) + "]", lp_owner)) + 1.0));
AISetFilterLifePerMarker(lv_snipeFilter, StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "SnipeDamage", "Amount", lp_owner)), lv_snipeMarker);
lp_candidates = AIGetFilterGroup(lv_snipeFilter, lp_candidates);
lv_snipeOrder = OrderTargetingUnit(AbilityCommand("Snipe", 0), UnitGroupUnit(lp_candidates, 1));
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttosh03a.sc2map — MapScript.galaxy:468
AISetFilterBits(lv_snipeFilter, libNtve_gf_ConvertTargetFilterStringToUnitFilter(CatalogFieldValueGet(c_gameCatalogAbil, "Snipe", "TargetFilters[" + IntToString(0) + "]", lp_owner)));
AISetFilterRange(lv_snipeFilter, lp_ghost, (StringToFixed(CatalogFieldValueGet(c_gameCatalogAbil, "Snipe", "Range[" + IntToString(0) + "]", lp_owner)) + 1.0));
AISetFilterLifePerMarker(lv_snipeFilter, StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "SnipeDamage", "Amount", lp_owner)), lv_snipeMarker);
lp_candidates = AIGetFilterGroup(lv_snipeFilter, lp_candidates);
lv_snipeOrder = OrderTargetingUnit(AbilityCommand("Snipe", 0), UnitGroupUnit(lp_candidates, 1));
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:244
filter = AIFilter(player);
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterLifePerMarker(filter, damage*0.5, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:440
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterBits(filter, UnitFilterStr("-;Missile,Self,Stasis,Dead,Hidden,Invulnerable"));
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:217
AISetFilterBits(filterAI, UnitFilterStr(AIAbilityStr(player, c_AB_Snipe, c_fieldTargetFiltersAB)));
AISetFilterRange(filterAI, aiUnit, AIAbilityFixed(player, c_AB_Snipe, c_fieldRange0) + 1);
AISetFilterLifePerMarker(filterAI, damage, mark);
AISetFilterLifeSortReference(filterAI, damage, damage*c_distanceFromDamage);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:277
AISetFilterBits(filterAI, UnitFilterStr(AIAbilityStr(player, c_AB_SteadyTargeting, c_fieldTargetFiltersAB)));
AISetFilterRange(filterAI, aiUnit, AIAbilityFixed(player, c_AB_SteadyTargeting, c_fieldRange0) + 1);
AISetFilterLifePerMarker(filterAI, damage, mark);
AISetFilterLifeSortReference(filterAI, damage, damage*c_distanceFromDamage);
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:461
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterBits(filter, UnitFilterStr("-;Missile,Self,Stasis,Dead,Hidden,Invulnerable"));
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:600
filter = AIFilter(player);
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterLifePerMarker(filter, damage*0.5, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:796
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterBits(filter, UnitFilterStr("-;Missile,Self,Stasis,Dead,Hidden,Invulnerable"));
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:219
AISetFilterBits(filterAI, UnitFilterStr("Biological,Visible;Heroic,Self,Structure,Destructible,Stasis,Dead,Hidden,Invulnerable"));
AISetFilterRange(filterAI, aiUnit, AIAbilityFixed(player, c_AB_Snipe, c_fieldRange0) + 1);
AISetFilterLifePerMarker(filterAI, damage, mark);
AISetFilterLifeSortReference(filterAI, damage, damage*c_distanceFromDamage);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:269
AISetFilterBits(filterAI, UnitFilterStr(AIAbilityStr(player, c_AB_SteadyTargeting, c_fieldTargetFiltersAB)));
AISetFilterRange(filterAI, aiUnit, AIAbilityFixed(player, c_AB_SteadyTargeting, c_fieldRange0) + 1);
AISetFilterLifePerMarker(filterAI, damage, mark);
AISetFilterLifeSortReference(filterAI, damage, damage*c_distanceFromDamage);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:441
AISetFilterAlliance(filter, c_playerGroupEnemy);
AISetFilterBits(filter, UnitFilterStr("-;Heroic,Missile,Stasis,Item,Dead,Hidden,Invulnerable"));
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
targetGroup = AIGetFilterGroup(filter, scanGroup);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:195
AISetFilterMarker(filterKillableBonus, c_noMarkersMin, c_noMarkersMax, mark);
//UnKillable Filters Marker;
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
AISetFilterLifePerMarker(filterBonus, damage, mark);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:197
AISetFilterLifePerMarker(filter, damage, mark);
AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);
AISetFilterLifePerMarker(filterBonus, damage, mark);
AISetFilterLifeSortReference(filterBonus, damage, damage*c_distanceFromDamage);
//Killable Hero