Lobby options¶
GetCurrentGameOptions() returns the lobby settings as a GameOptions value,
or nil when there are none. Call its methods with :.
local options = GetCurrentGameOptions()
if options ~= nil then
LogInfo("map size", options:GetMapSize())
options:SetPopulation(200)
end
Getters return the setting, or nil when it can't be read.
Setters return true when the local lobby settings were written, and
false otherwise. They only work before a match starts: during a match,
in the editor or on the end screen they return false. true doesn't mean
other players or the host accepted the change. Boolean setters treat nil and
false as false and anything else as true. Integer setters write the value
without checking that the game supports it.
Get a fresh GameOptions after the lobby changes, check every setter result,
and call setters once per user action, not every Update.
Match settings¶
SetRandomMapPoolLocations(locations)
sets the random map pool to one map: pass an array with exactly one location
ID, such as { 42 }. Any other length returns false.
Player slots¶
Slots are numbered 0 to 7. A slot is a lobby position, not a player ID.
SetAssignedPlayerCivilization(civilization)
sets the civilization of your own slot, and returns false when that slot
can't be found.
Match setup¶
These read-only methods describe the loaded match.
GetGameSetup() returns the settings the game reads to
define AI script symbols at the start of a match, or nil and a reason
(game-setup-unresolved, no-game-options, no-world or
game-setup-unreadable):
| Field | Meaning |
|---|---|
victoryType, victoryCondition |
Victory settings. |
subGameModes |
Sub-game-mode bits. |
sessionKind |
The kind of session. |
framesPerSecond |
Frame rate setting. |
nomadResources, groupedByTeam, nomadStyle, michiStyle, extraStyle, teamTogether, pocketDisabled |
Map setup flags (booleans). |
teams |
Team of players 1 to 8, an array of 8. |
startPositions |
Start positions as { x, y } tiles, up to 8. |
GetGameDataKind() returns the game data kind the
game tests to define UP-GAME-WK, or nil.
The integers in both are the game's internal values; log them in a match whose settings you know before relying on one.
GetVictory, SetVictory, GetAIDifficulty and others exist but are
not implemented.