# Get Town Location
Grammar — Get the location of town town for player player
Flags —Native
|Function
Returns the location of a town for a player.
# Arguments
int
— Playerint
— Town
Returns — point
native point AIGetTownLocation(int player, int town);
# Related
Category: AI Advanced / Towns / Functions
- [F] —
int
— Get Town State — ( AIGetTownState ) - [F] —
point
— Get Town Location — ( AIGetTownLocation ) - [F] —
int
— Get Closest Town — ( AIGetClosestTown ) - [F] —
int
— Get Next Unused Town Slot — ( AIGetNextUnusedTownSlot ) - [F] —
int
— Get Building Count In Town — ( AIGetBuildingCountInTown ) - [F] —
bool
— Is Town Harvesting — ( AIIsTownHarvestRunning ) - [F] —
int
— Get Current Harvest Peon Count — ( AIGetCurPeonCount ) - [F] —
int
— Get Min Desired Harvest Peon Count — ( AIGetMinPeonCount ) - [F] —
int
— Get Max Desired Harvest Peon Count — ( AIGetMaxPeonCount ) - [F] —
int
— Get Mineral Amount Left — ( AIGetMineralAmountLeft ) - [F] —
int
— Get Gas Amount Left — ( AIGetGasAmountLeft ) - [F] —
int
— Get Num Mineral Spots — ( AIGetMineralNumSpots ) - [F] —
int
— Get Num RawGas Spots — ( AIGetRawGasNumSpots ) - [F] —
point
— Get Offense Gather Location — ( AIGetGatherLocation ) - [F] —
point
— Get Defense Gather Location — ( AIGetGatherDefLocation ) - [F] —
int
— Expand — ( AIExpand ) - [F] —
unitgroup
— Get Town Threats — ( AIGetTownThreats )
# Examples
# mods/core.sc2mod
// L345
AIGetTownLocation(player, c_townMain)
// L382
AIGetTownLocation(player, c_townMain)
// L419
AIGetTownLocation(player, c_townMain)
# mods/core.sc2mod
// L451
AIGetTownLocation(player, c_townMain)
// L593
AIGetTownLocation(player, c_townMain)
// L735
AIGetTownLocation(player, c_townMain)
# mods/void.sc2mod
// L345
AIGetTownLocation(player, c_townMain)
// L382
AIGetTownLocation(player, c_townMain)
// L419
AIGetTownLocation(player, c_townMain)
# mods/warcoop/warmeleeai.sc2mod
// L67
AIGetTownLocation(player,town)
// L87
AIGetTownLocation(player,town)
// L104
AIGetTownLocation(player,town)
# mods/warcoop/warmeleeai.sc2mod
// L81
AIGetTownLocation(player,AIGetMainTown(player))
# mods/warcoop/warmeleeai.sc2mod
// L82
AIGetTownLocation(player, AIGetMainTown(player))