Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

Triggers/Functions/Random Spawn Point

From SC2Mapster Wiki
Jump to: navigation, search

AI Function

Random Spawn Point


AI - Random point in region between minDistFromEnemies|Min and maxDistFromEnemies|Max distance from enemy units of player player (prefer points within maxDistFromBuildings|MaxDist of an enemy building)

Galaxy Code

point AIRandomSpawnPoint ( int player, region region, fixed minDistFromEnemies, fixed maxDistFromEnemies, fixed maxDistFromBuildings )


Returns a random point in the given region. Prefers to stay either close or far from enemies units. Also prefers to be within some max distance of enemy buildings. It will also stay away from previously returned random points in the region.


  • int player
    • Name: Player
  • region region
    • Name: Region
  • fixed minDistFromEnemies
    • Name: MinDistFromEnemies
  • fixed maxDistFromEnemies
    • Name: MaxDistFromEnemies
  • fixed maxDistFromBuildings
    • Name: MaxDistFromBuildings

Additional Information