# Set Main Town
Grammar — Set town mainTown|main town to be the main town for player player|player
Flags —Native
|Action
Sets the specified town to be the main town for a player.
# Arguments
int
— Playerint
— Main Town
Returns — void
native void AISetMainTown(int player, int maintown);
# Related
Category: AI Advanced / Towns / Actions
- Declare Next Town —
void
— libNtve_gf_DeclareNextTown - Declare Town Specific Slot —
void
— AIDeclareTown - Set Main Town —
void
— AISetMainTown - Enable Harvesting —
void
— AIHarvest - Set Harvest Rate —
void
— AIHarvestRate - Set Gas Peon Count Override —
void
— AISetGasPeonCountOverride
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:162
AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
AISetMainTown(player, c_townOne);
AIHarvest(player, c_townOne);
AISetAllStates(player, 1);
mods/core.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:246
AIStart(player, true, DifficultyAPM(diff));
AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
AISetMainTown(player, c_townOne);
AIInitCampaignTowns(player);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:197
AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
AISetMainTown(player, c_townOne);
AIHarvest(player, c_townOne);
AISetAllStates(player, 1);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/BaseAI.galaxy:289
AIStart(player, true, DifficultyAPM(diff));
AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
AISetMainTown(player, c_townOne);
AIInitCampaignTowns(player);