Generated Maps:Global Variables and Functions

From Age of Empires 4 Modding
Revision as of 02:06, 23 July 2022 by Drumsin (talk | contribs) (Created page with "Return to Generated Maps - Home {| class="wikitable" |+ Variables |- ! Variable !! Type !! Description |- | <code>worldPlayerCount</code> || int || Returns number of players |- | <code>randomPositions</code> || 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Return to Generated Maps - Home

Variables
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
Functions
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)