# Get Best Attack Target Point

Grammar — Get the best target point to attack for player player, optionally considering only enemies enemies, for a wave leaving gather point gatherPoint|GatherPoint, using search flags flags
FlagsNative | Function

Get the best target point to attack for a player, optionally considering only the specified enemies.

# Arguments

  • int — Player
  • playergroup — Enemies
  • point — Gather Point
  • int [ preset::AIBestTargetFlags ] — Flags

Returns — point

native point AIGetBestTarget(
	int player,
	playergroup enemies,
	point gatherPoint,
	int flags,
);

Category: AI Advanced / Waves / Functions

# Examples

# mods/warcoop/warmeleeai.sc2mod

Orc.galaxy

// L457
AIGetBestTarget (player, enemies, UnitGroupCenterOfGroup(ug), c_btDefaultPrefersPath)
// L477
AIGetBestTarget (player, weakEnemies, UnitGroupCenterOfGroup(ug), c_btDefaultPrefersPath)
// L505
AIGetBestTarget (player, enemies, UnitGroupCenterOfGroup(ug), c_btDefaultPrefersPath)