# Set Main Town

Grammar — Set town mainTown|main town to be the main town for player player|player
FlagsNative | Action

Sets the specified town to be the main town for a player.

# Arguments

  • int — Player
  • int — Main Town

Returns — void

native void AISetMainTown(int player, int maintown);

Category: AI Advanced / Towns / Actions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:162


    AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
    AISetMainTown(player, c_townOne);
    AIHarvest(player, c_townOne);
    AISetAllStates(player, 1);

mods/core.sc2modbase.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.sc2modbase.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.sc2modbase.sc2data/TriggerLibs/BaseAI.galaxy:289

    AIStart(player, true, DifficultyAPM(diff));
	AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
    AISetMainTown(player, c_townOne);
    AIInitCampaignTowns(player);