Lobby options¶
GetCurrentGameOptions() returns a GameOptions value when lobby settings are
available. It returns nil when no lobby option set is available.
local options = GetCurrentGameOptions()
if options ~= nil then
local map_size = options:GetMapSize()
end
CAUTION: Call setters only before a match starts. A setter returns
falseduring an active match, editor session, or end-game screen.
Call every GameOptions method with :.
Match settings¶
A getter returns nil when it cannot read the setting. A setter returns true
only when it writes the setting.
GetMapSize returns one of these public sizes when it recognizes the value:
120 144 168 200 220 240 480
Use one of those values with SetMapSize. Other integers are written as-is;
the binding does not verify that the game recognizes them.
Random map pool¶
SetRandomMapPoolLocations(locations) accepts an array with exactly one map
location ID.
local options = GetCurrentGameOptions()
if options ~= nil then
options:SetRandomMapPoolLocations({ 42 })
end
The call returns false when the array length is not one.
Player slots¶
Player-slot methods use an index from 0 through 7. A slot index is not
necessarily the same as a game player ID.
SetAssignedPlayerCivilization finds the assigned player slot. It returns
false when that slot is unavailable.
Rules¶
- Get a new
GameOptionsvalue after a lobby or game state change. - Check every setter result.
- Call a setter once for a user action, not in every
Update. - Do not use unavailable compatibility methods from the API name index.
Methods such as GetVictory, SetVictory, and GetAIDifficulty are
not implemented placeholders. See the complete placeholder list
for their fixed return values.