# Get Default Combat Priority

Grammar — Pick the best target for attackers attackers who currently have target from enemy list enemies, it also changes the attackers list to only include units who want to switch to that target up to a limit of maxAttackersLimit units
FlagsNative | Function

Returns a unit that is the best target for the specified attackers from the list of possible units in the specified enemy unit group. It then also changes the attackers group to only include the limited number of attackers wanting to switch to that target.

# Arguments

  • unitgroup — Attackers
  • unitgroup — Enemies
  • int — Max Attackers Limit

Returns — unit

native unit AIDefaultCombatPriority(
	unitgroup attackers,
	unitgroup enemies,
	int maxAttackerLimit,
);

Category: AI Advanced / Tactical / Functions

# Examples

# mods/core.sc2mod

MeleeAI.galaxy

// L311
AIDefaultCombatPriority(attackers, enemies, maxAttackerLimit)
// L311
AIDefaultCombatPriority(attackers, enemies, maxAttackerLimit)