# Get Best Target Point On Group
Grammar — Returns the best location to place and AOE attack on the group with the specified parameters (group, minHits, damageBase, minScore, radius, from, range, bonusAttribute)
Flags —Native
|Function
Returns the best location to place an AOE attack on a group of units with the specified parameters.
# Arguments
unitgroup
— Groupint
— Min Hitsint
— Damage Basefixed
— Min Scorefixed
— Radiuspoint
— Fromfixed
— Rangeint
— Bonus Attribute
Returns — point
native point AIBestTargetPoint(
unitgroup group,
int minHits,
int damageBase,
fixed minScore,
fixed radius,
point from,
fixed range,
int bonusAttri,
);
# Related
Category: AI Advanced / Tactical / Functions
- Same Command —
bool
— AISameCommand - Last Attacker —
unit
— AILastAttacker - Last Attack —
int
— AILastAttack - Get Wants To Move Status —
bool
— AIControlWantsToMove - Is Ignored By Wave —
bool
— AIIsIgnoredByWave - Is In Combat —
bool
— AIUnitIsInCombat - Get Cloaked Attacker —
point
— AIGetCloakedAttacker - Get Best Target Point On Group —
point
— AIBestTargetPoint - Find Units —
unitgroup
— AIFindUnits - Get Default Combat Priority —
unit
— AIDefaultCombatPriority - Combat Diff Flag Special High Priority —
bool
— AICombatDiffFlagCatSpecialHighPrio - Combat Diff Flag Splash High Priority —
bool
— AICombatDiffFlagCatSplashHighPrio - Combat Diff Flag Timed Low Priority —
bool
— AICombatDiffFlagCatTimedLowPrio - Combat Diff Flag Workers Normal Priority —
bool
— AICombatDiffFlagCatWorkersNormalPrio - Combat Diff Flag Sort Buildings Priority —
bool
— AICombatDiffFlagCatSortBuildingsPrio - Combat Diff Flag Healers —
bool
— AICombatDiffFlagTieBreakHealers - Combat Diff Flag Low Health —
bool
— AICombatDiffFlagTieBreakLowHP - Combat Diff Flag Bonus Damage —
bool
— AICombatDiffFlagTieBreakBonusDamage - Combat Diff Flag Injured —
bool
— AICombatDiffFlagTieBreakInjured - Combat Diff Flag Detector —
bool
— AICombatDiffFlagTieBreakDetector - Combat Diff Flag Siege Range —
bool
— AICombatDiffFlagTieBreakRange - Does Unit Have Tactical Disabled —
bool
— AIIsTacticalDisabled
# Examples
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:69
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OdinBarrageArea, scanGroup),
3, // min hits
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:375
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OmegaStormArea, scanGroup),
3, // min hits
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:467
range = AIAbilityFixed(player, c_AB_BioStasis, c_fieldRange0) + 1;
loc = AIBestTargetPoint(
statisGroup,
5, // min hits
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:69
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OdinBarrageArea, scanGroup),
3, // min hits
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:375
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OmegaStormArea, scanGroup),
3, // min hits
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:467
range = AIAbilityFixed(player, c_AB_BioStasis, c_fieldRange0) + 1;
loc = AIBestTargetPoint(
statisGroup,
5, // min hits
campaigns/void.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:852
}
loc = AIBestTargetPoint(
enemyGroup,
2, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:134
// see if there is a large group nearby to split
forceFieldTarget = AIBestTargetPoint(
rangeEnemyGroup,
6, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:570
// see if there is a large enough group nearby
targetPoint = AIBestTargetPoint(
meleeEnemyGroup,
4, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:687
vortexGroup = AIEffectGroup(player, c_EF_VortexArea, scanGroup);
loc = AIBestTargetPoint(
vortexGroup,
5, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1738
}
loc = AIBestTargetPoint(
targetGroup,
3, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1795
}
loc = AIBestTargetPoint(
targetGroup,
3, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:123
barrageRadius = AIEffectFixed(player, c_EF_BombardmentArea, c_fieldAreaRadius0);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_BombardmentArea, scanGroup),
3, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1355
// Up to an additional 1.0 point can be rewarded if the target has the optional bonus attribute.
//
loc = AIBestTargetPoint(
AIWeaponGroup(player, c_WE_AutoTurret, scanGroup),
2, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1809
// find the best area to attack on the ground
bestPoint = AIBestTargetPoint(
targetGroupGround,
minHits, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:222
rangedGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_ViperCloudSearch, rangedGroup),
5, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:314
airGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
airGroup,
1, // min hits
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:537
enemyGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_FungalGrowthSearch, enemyGroup),
5, // min hits
mods/novastoryassets.sc2mod — base3.sc2maps/maps/campaign/nova/nova09.sc2map/MapScript.galaxy:727
UnitGroupAddUnitGroup(lv_nearbyValidUnits, UnitGroup(null, gv_pLAYER_07_DOMINION, RegionCircle(UnitGetPosition(lp_rocketBarrageUnit), 14.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
if ((UnitGroupCount(lv_nearbyValidUnits, c_unitCountAlive) > 0)) {
lv_targetPoint = AIBestTargetPoint(lv_nearbyValidUnits, 0, 200, 0.0, 5.0, UnitGetPosition(lp_rocketBarrageUnit), 14.0, 0);
UnitIssueOrder(lp_rocketBarrageUnit, OrderTargetingPoint(AbilityCommand("NovaXanthosRocketBarrage", 0), lv_targetPoint), c_orderQueueReplace);
}
mods/novastoryassets.sc2mod — base3.sc2maps/maps/campaign/nova/nova09.sc2map/MapScript.galaxy:1149
else {
if ((UnitGroupCount(lv_nearbyValidUnits, c_unitCountAlive) > 0)) {
libNtve_gf_AICast(lp_xanthos, OrderTargetingPoint(AbilityCommand("NovaXanthosDeathLaser", 0), AIBestTargetPoint(lv_nearbyValidUnits, 0, 250, 0.0, 2.5, UnitGetPosition(lp_xanthos), 10.0, 0)));
}
mods/novastoryassets.sc2mod/base3.sc2maps/maps/campaign/nova/nova09.sc2map — MapScript.galaxy:727
UnitGroupAddUnitGroup(lv_nearbyValidUnits, UnitGroup(null, gv_pLAYER_07_DOMINION, RegionCircle(UnitGetPosition(lp_rocketBarrageUnit), 14.0), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
if ((UnitGroupCount(lv_nearbyValidUnits, c_unitCountAlive) > 0)) {
lv_targetPoint = AIBestTargetPoint(lv_nearbyValidUnits, 0, 200, 0.0, 5.0, UnitGetPosition(lp_rocketBarrageUnit), 14.0, 0);
UnitIssueOrder(lp_rocketBarrageUnit, OrderTargetingPoint(AbilityCommand("NovaXanthosRocketBarrage", 0), lv_targetPoint), c_orderQueueReplace);
}
mods/novastoryassets.sc2mod/base3.sc2maps/maps/campaign/nova/nova09.sc2map — MapScript.galaxy:1149
else {
if ((UnitGroupCount(lv_nearbyValidUnits, c_unitCountAlive) > 0)) {
libNtve_gf_AICast(lp_xanthos, OrderTargetingPoint(AbilityCommand("NovaXanthosDeathLaser", 0), AIBestTargetPoint(lv_nearbyValidUnits, 0, 250, 0.0, 2.5, UnitGetPosition(lp_xanthos), 10.0, 0)));
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:1957
lv_abilityAoE = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonTychusTossGrenadeDamage", "AreaArray[" + IntToString(0) + "].Radius", c_playerAny));
lv_score = 1;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 3, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonTychusTossGrenade", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:1995
lv_score = 1;
lv_abilityAoE = 0.5;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 1, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonRaynorSnipe", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2117
lv_abilityAoE = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonNovaNukeDamage", "AreaArray[" + IntToString(0) + "].Radius", c_playerAny));
lv_score = 2;
lv_target = AIBestTargetPoint(lv_enemiesNearby, 4, FixedToInt(lv_abilityDamage), lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
lv_wave = AIUnitGetWave(lp_aIUnit);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2217
lv_score = 3;
lv_abilityAoE = 5.0;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 2, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonZagaraMassRoachDrop", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2284
lv_abilityAoE = StringToFixed(CatalogFieldValueGet(c_gameCatalogEffect, "MutatorAmonArtanisLightningDashSearch", "AreaArray[" + IntToString(0) + "].Radius", lp_owner));
lv_score = 2;
lv_target = AIBestTargetPoint(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 0), 3, lv_abilityDamage, lv_score, lv_abilityAoE, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonArtanisLightningDash", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2404
lv_abilityRadius = MinI(FixedToInt(lv_abilityRadius), 4);
lv_score = 1;
lv_target = AIBestTargetPoint(lv_enemiesNearby, 4, lv_abilityDamage, lv_score, lv_abilityRadius, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeStructure);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonKerriganApocalypse", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMU.galaxy:2443
lv_score = 2;
lv_canidates = UnitGroupFilter(null, c_playerAny, lv_enemiesNearby, UnitFilter(0, 0, (1 << c_targetFilterAir) | (1 << c_targetFilterStructure) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);
lv_target = AIBestTargetPoint(lv_canidates, 3, lv_abilityDamage, lv_score, lv_abilityRadius, UnitGetPosition(lp_aIUnit), lv_abilityRange, c_unitAttributeNone);
if ((lv_target != null)) {
libNtve_gf_AICast(lp_aIUnit, OrderTargetingPoint(AbilityCommand("MutatorAmonKerriganPsiStrikeWalk", 0), lv_target));
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:36
plagueGroup = AIEffectGroup(player, c_EF_PlagueArea, scanGroup);
loc = AIBestTargetPoint(
plagueGroup,
5, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:83
nearbyAlliedUnits = AIGetFilterGroup(filter, nearbyAlliedUnits);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_DefilerDarkSwarm, nearbyAlliedUnits),
5, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:228
}
loc = AIBestTargetPoint(
enemyGroup,
2, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:419
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OdinBarrageArea, scanGroup),
3, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:731
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OmegaStormArea, scanGroup),
3, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:823
range = AIAbilityFixed(player, c_AB_BioStasis, c_fieldRange0) + 1;
loc = AIBestTargetPoint(
statisGroup,
5, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1205
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_PsiStormArea, scanGroup),
1, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1487
}
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_OdinBarrageArea, scanGroup),
3, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:136
// see if there is a large group nearby to split
forceFieldTarget = AIBestTargetPoint(
rangeEnemyGroup,
6, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:552
// see if there is a large enough group nearby
targetPoint = AIBestTargetPoint(
meleeEnemyGroup,
4, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:665
vortexGroup = AIEffectGroup(player, c_EF_VortexArea, scanGroup);
loc = AIBestTargetPoint(
vortexGroup,
5, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1727
}
loc = AIBestTargetPoint(
targetGroup,
3, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1784
}
loc = AIBestTargetPoint(
targetGroup,
3, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:126
barrageRadius = AIEffectFixed(player, c_EF_BombardmentArea, c_fieldAreaRadius0);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_BombardmentArea, scanGroup),
3, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1327
// Up to an additional 1.0 point can be rewarded if the target has the optional bonus attribute.
//
loc = AIBestTargetPoint(
AIWeaponGroup(player, c_WE_AutoTurret, scanGroup),
2, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1763
// find the best area to attack on the ground
bestPoint = AIBestTargetPoint(
targetGroupGround,
minHits, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:260
rangedGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_ViperDisablingCloudSearch, rangedGroup),
5, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:299
rangedGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_ViperCloudSearch, rangedGroup),
5, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:386
airGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
airGroup,
1, // min hits
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactZergAI.galaxy:748
enemyGroup = AIGetFilterGroup(filter, scanGroup);
loc = AIBestTargetPoint(
AIEffectGroup(player, c_EF_FungalGrowthSearch, enemyGroup),
5, // min hits