# Expand

Grammar — Instruct the AI for player player to expand starting the search at point point and building building at the new expansion
FlagsNative | Function

Instructs the AI for a player to expand starting the search at the specified point, and builds the specified building at the new expansion. Returns the town index for the new town.

# Arguments

  • int — Player
  • point — Point
  • string [ gamelink::Unit ] — Building

Returns — int

native int AIExpand(
	int player,
	point searchStart,
	string firstBuilding,
);

Category: AI Advanced / Towns / Functions

# Examples

# mods/core.sc2mod

MeleeHighAI.galaxy

// L345
AIExpand(player, AIGetTownLocation(player, c_townMain), c_ZB_Hatchery)
// L382
AIExpand(player, AIGetTownLocation(player, c_townMain), c_PB_Nexus)
// L419
AIExpand(player, AIGetTownLocation(player, c_townMain), c_TB_CommandCenter)

# mods/core.sc2mod

MeleeLowAI.galaxy

// L451
AIExpand(player, AIGetTownLocation(player, c_townMain), c_TB_CommandCenter)
// L593
AIExpand(player, AIGetTownLocation(player, c_townMain), c_ZB_Hatchery)
// L735
AIExpand(player, AIGetTownLocation(player, c_townMain), c_PB_Nexus)

# mods/void.sc2mod

MeleeHighAI.galaxy

// L345
AIExpand(player, AIGetTownLocation(player, c_townMain), c_ZB_Hatchery)
// L382
AIExpand(player, AIGetTownLocation(player, c_townMain), c_PB_Nexus)
// L419
AIExpand(player, AIGetTownLocation(player, c_townMain), c_TB_CommandCenter)