# Combat Diff Flag Sort Buildings Priority

Grammar — Perform action action on the combat diffculty flag for player player - Sort Buildings Priority
FlagsNative | Function

When enabled, allows the combat AI to prioritize the order it will attack buildings in.

# Arguments

Returns — bool

native bool AICombatDiffFlagCatSortBuildingsPrio(
	int player,
	int action,
);

Category: AI Advanced / Tactical / Functions

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/challenges/rushdefense.sc2map/MapScript.galaxy:1210

        lv_bool = AICombatDiffFlagCatWorkersNormalPrio(PlayerGroupLoopCurrent(), c_combatFlagEnable);
        lv_bool = AICombatDiffFlagTieBreakLowHP(PlayerGroupLoopCurrent(), c_combatFlagEnable);
        lv_bool = AICombatDiffFlagCatSortBuildingsPrio(PlayerGroupLoopCurrent(), c_combatFlagDisable);
        PlayerGroupLoopStep();
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/challenges/rushdefense.sc2mapMapScript.galaxy:1210

        lv_bool = AICombatDiffFlagCatWorkersNormalPrio(PlayerGroupLoopCurrent(), c_combatFlagEnable);
        lv_bool = AICombatDiffFlagTieBreakLowHP(PlayerGroupLoopCurrent(), c_combatFlagEnable);
        lv_bool = AICombatDiffFlagCatSortBuildingsPrio(PlayerGroupLoopCurrent(), c_combatFlagDisable);
        PlayerGroupLoopStep();
    }

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:62

        AICombatDiffFlagCatTimedLowPrio        (player, AIDiffThreshold(player, c_combatFlagDisable, c_skirMedium,   c_combatFlagEnable));
        AICombatDiffFlagCatWorkersNormalPrio   (player, AIDiffThreshold(player, c_combatFlagDisable, c_skirEasy  ,   c_combatFlagEnable));
        AICombatDiffFlagCatSortBuildingsPrio   (player, AIDiffThreshold(player, c_combatFlagDisable, c_skirEasy  ,   c_combatFlagEnable));
        AICombatDiffFlagTieBreakHealers        (player, AIDiffThreshold(player, c_combatFlagDisable, c_skirEasy  ,   c_combatFlagEnable));
        AICombatDiffFlagTieBreakBonusDamage    (player, AIDiffThreshold(player, c_combatFlagDisable, c_skirMedium,   c_combatFlagEnable));

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:75

        AICombatDiffFlagCatTimedLowPrio        (player, AIDiffThreshold(player, c_combatFlagDisable, c_campExpert,   c_combatFlagEnable));
        AICombatDiffFlagCatWorkersNormalPrio   (player, AIDiffThreshold(player, c_combatFlagDisable, c_campAdvanced, c_combatFlagEnable));
        AICombatDiffFlagCatSortBuildingsPrio   (player, AIDiffThreshold(player, c_combatFlagDisable, c_campAdvanced, c_combatFlagEnable));
        AICombatDiffFlagTieBreakHealers        (player, AIDiffThreshold(player, c_combatFlagDisable, c_campExpert,   c_combatFlagEnable));
        AICombatDiffFlagTieBreakLowHP          (player, AIDiffThreshold(player, c_combatFlagDisable, c_campExpert,   c_combatFlagEnable));

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:112

	AICombatDiffFlagCatTimedLowPrio        (player, AIDiffThreshold(player, c_combatFlagDisable, c_campVirtuoso,   c_combatFlagEnable));
	AICombatDiffFlagCatWorkersNormalPrio   (player, AIDiffThreshold(player, c_combatFlagDisable, c_campAdvanced, c_combatFlagEnable));
	AICombatDiffFlagCatSortBuildingsPrio   (player, AIDiffThreshold(player, c_combatFlagDisable, c_campAdvanced, c_combatFlagEnable));
	AICombatDiffFlagTieBreakHealers        (player, AIDiffThreshold(player, c_combatFlagDisable, c_campVirtuoso,   c_combatFlagEnable));
	AICombatDiffFlagTieBreakLowHP          (player, AIDiffThreshold(player, c_combatFlagDisable, c_campExpert,   c_combatFlagEnable));