CivilizationType (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


ID.png The CivilizationType pseudo-type is actually a regular integer. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!
  • DB.png Integers labeled as CivilizationType corresponds to the ID column of the Civilizations XML table.


XML: the Civilizations table

Here are the ID and Type columns found in this table.

ID Type
0 CIVILIZATION_AMERICA
0 CIVILIZATION_AUSTRIA
1 CIVILIZATION_ARABIA
1 CIVILIZATION_BYZANTIUM
2 CIVILIZATION_AZTEC
2 CIVILIZATION_CARTHAGE
3 CIVILIZATION_CHINA
3 CIVILIZATION_CELTS
4 CIVILIZATION_EGYPT
4 CIVILIZATION_ETHIOPIA
5 CIVILIZATION_ENGLAND
5 CIVILIZATION_HUNS
6 CIVILIZATION_FRANCE
6 CIVILIZATION_MAYA
7 CIVILIZATION_GERMANY
7 CIVILIZATION_NETHERLANDS
8 CIVILIZATION_GREECE
8 CIVILIZATION_SWEDEN
9 CIVILIZATION_INDIA
10 CIVILIZATION_IROQUOIS
11 CIVILIZATION_JAPAN
12 CIVILIZATION_OTTOMAN
13 CIVILIZATION_PERSIA
14 CIVILIZATION_ROME
15 CIVILIZATION_RUSSIA
16 CIVILIZATION_SIAM
17 CIVILIZATION_SONGHAI
18 CIVILIZATION_MINOR
19 CIVILIZATION_BARBARIAN


Examples

Here are different ways to query the database to retrieve the ID from the type. Those examples will return and assign the integer value 0. See also GameInfo.

local id = GameInfo.Civilizations.CIVILIZATION_AUSTRIA.ID
local id = GameInfo["Civilizations"].["CIVILIZATION_AUSTRIA"].ID
local id = GameInfo.Civilizations{Type="CIVILIZATION_AUSTRIA"}().ID

Alternatively you could use the ID or the type to retrieve the value of the Description column. Those examples will return and assign the value TXT_KEY_CIV_AUSTRIA_DESC.

local description = GameInfo.Civilizations[0].Description
local description = GameInfo["Civilizations"][0]["Description"]
local description = GameInfo.Civilizations{ID=0}().Description


Used by

CivilizationType City:GetCivilizationType()
Game.AddPlayer(PlayerID newPlayer, LeaderType leader, CivilizationType civ)
CivilizationType Game.GetActiveCivilizationType()
bool Game.IsCivEverActive(CivilizationType civilization)
CivilizationType Player:GetCivilizationType()
CivilizationType PreGame.GetCivilization(PlayerID i = nil)
PreGame.SetCivilization(PlayerID player, CivilizationType civ = nil)
table(unknown => table) UI.GetHallofFameData()
UnitType Unit:GetCaptureUnitType(CivilizationType civilization)
CivilizationType Unit:GetCivilizationType()



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.