# Get Offense Gather Location
Grammar — Get the default offensive gather location for town town of player player
Flags —Native
|Function
Returns the default offensive gather location for a town of a player.
# Arguments
int
— Playerint
— Town
Returns — point
native point AIGetGatherLocation(int player, int town);
# Related
Category: AI Advanced / Towns / Functions
- Get Town State —
int
— AIGetTownState - Get Town Location —
point
— AIGetTownLocation - Get Closest Town —
int
— AIGetClosestTown - Get Next Unused Town Slot —
int
— AIGetNextUnusedTownSlot - Get Building Count In Town —
int
— AIGetBuildingCountInTown - Is Town Harvesting —
bool
— AIIsTownHarvestRunning - Get Current Harvest Peon Count —
int
— AIGetCurPeonCount - Get Min Desired Harvest Peon Count —
int
— AIGetMinPeonCount - Get Max Desired Harvest Peon Count —
int
— AIGetMaxPeonCount - Get Mineral Amount Left —
int
— AIGetMineralAmountLeft - Get Gas Amount Left —
int
— AIGetGasAmountLeft - Get Num Mineral Spots —
int
— AIGetMineralNumSpots - Get Num RawGas Spots —
int
— AIGetRawGasNumSpots - Get Offense Gather Location —
point
— AIGetGatherLocation - Get Defense Gather Location —
point
— AIGetGatherDefLocation - Expand —
int
— AIExpand - Get Town Threats —
unitgroup
— AIGetTownThreats
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:254
AISetBullyAttackWavePercent(AICampaignDiffSelect(player, 100, 100, 50, 0), player);
AIAttackWaveSetGatherPoint(player, AIGetGatherLocation(player, c_townMain));
AISetDifficulty(player, c_diffPressForward, true);
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeAI.galaxy:256
//--------------------------------------------------------------------------------------------------
void AIMergeUnit (int player, unit u, wave w) {
wave merge = AIWaveCreate(AIWaveInfoCreate(), player, AIGetGatherLocation(player, c_townMain));
AIWaveAddUnit(merge, u);
AIWaveSetType(merge, c_waveStateMerge, AIWaveTargetMerge(w));
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:495
}
if (!AIFindDropAttackTarget(player, AIGetGatherLocation(player, c_townMain))) {
return false;
}
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:624
}
targetPoint = AIGetGatherLocation(player, c_townMain);
if (targetPoint == null) {
return null;
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:298
AISetBullyAttackWavePercent(0, player);
AIAttackWaveSetGatherPoint(player, AIGetGatherLocation(player, c_townMain));
//Unifying all AI Difficulty flags to remove variance
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/MeleeAI.galaxy:256
//--------------------------------------------------------------------------------------------------
void AIMergeUnit (int player, unit u, wave w) {
wave merge = AIWaveCreate(AIWaveInfoCreate(), player, AIGetGatherLocation(player, c_townMain));
AIWaveAddUnit(merge, u);
AIWaveSetType(merge, c_waveStateMerge, AIWaveTargetMerge(w));
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:603
}
targetPoint = AIGetGatherLocation(player, c_townMain);
if (targetPoint == null) {
return null;
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:585
}
if (!AIFindDropAttackTarget(player, AIGetGatherLocation(player, c_townMain))) {
return false;
}