Generated Maps:Global Variables and Functions

From Age of Empires 4 Modding

Return to Generated Maps - Home

Variable Type Description
worldPlayerCount int Returns number of players
randomPositions bool Returns true or false based on the selected option from the game setup menu option under, Map Setup → Locations → Team Starting Locations. There are two options, "Random Locations", which is true, and "Teams Together" which is false.
worldTerrainWidth int Returns the current map width e.g. 416, 512, 640, 768, 896
worldTerrainHeight int Returns the current map height e.g. 416, 512, 640, 768, 896
Function Parameters Returns Description
worldGetRandom() null float Returns random float between zero and one. If you are getting random numbers, you must use worldGetRandom(), as that ties the map script to the seed for determinism across all players. (you will sync error without it)