# Tactical AI Filter Life Modifier

Grammar — Tactical AI Filter - define an altered damage value of amount against attribute in filter
FlagsNative | Action

Sets the specified AI Filter to modify the way it calculates life values for units with the specified attribute. For example, if the attribute was set to Armored, and the Amount set to 100, then the filter would consider Armored units to have 100 more life than they actually have. This can only be set once per AI Filter, so calling this action multiple times with the same AI Filter will simply override previous calls. 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 — Filter
  • int<preset::AttributeType> — Attribute
  • fixed — Amount

Returns — void

native void AISetFilterLifeMod(
	aifilter filter,
	int type,
	fixed mod,
);

Category: AI Advanced / Filters / Actions

# Examples

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:158

    AISetFilterRange(filter, aiUnit, range+3);
    AISetFilterLife(filter, 0, maxlife);
    AISetFilterLifeMod(filter, c_unitAttributeHeroic,damage*C_spellScaleHeroic-damage);
    //AISetFilterLifePerMarker(filter, damage, mark);
    //AISetFilterLifeSortReference(filter, damage, damage*c_distanceFromDamage);

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:442

		AISetFilterRange(filter, aiUnit, range);
		AISetFilterLife(filter, c_noMin, c_noMax);
		AISetFilterLifeMod(filter, c_unitAttributeHeroic,-100);
	}else{
		AISetFilterBits(filter, UnitFilterStr("Summoned;Player,Ally,Neutral"));