BuildingType (Civ5 Type)

From Civilization Modding Wiki
Jump to: navigation, search

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


ID.png The BuildingType 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 BuildingType corresponds to the ID column of the Buildings XML table.


XML: the Buildings table

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

ID Type
0 BUILDING_COURTHOUSE
0 BUILDING_FLOATING_GARDENS
0 BUILDING_AMPHITHEATER
1 BUILDING_MUGHAL_FORT
1 BUILDING_SHRINE
2 BUILDING_KREPOST
2 BUILDING_RECYCLING_CENTER
3 BUILDING_LONGHOUSE
3 BUILDING_BOMB_SHELTER
4 BUILDING_BAZAAR
4 BUILDING_CONSTABLE
5 BUILDING_SATRAPS_COURT
5 BUILDING_POLICE_STATION
6 BUILDING_PAPER_MAKER
6 BUILDING_INTELLIGENCE_AGENCY
7 BUILDING_WAT
7 BUILDING_ALHAMBRA
8 BUILDING_MUD_PYRAMID_MOSQUE
8 BUILDING_CN_TOWER
9 BUILDING_BURIAL_TOMB
9 BUILDING_HUBBLE
10 BUILDING_SEAPORT
10 BUILDING_LEANING_TOWER
11 BUILDING_STABLE
11 BUILDING_MOSQUE_OF_DJENNE
12 BUILDING_WATERMILL
12 BUILDING_NEUSCHWANSTEIN
13 BUILDING_CIRCUS
13 BUILDING_PETRA
14 BUILDING_FORGE
14 BUILDING_TERRACOTTA_ARMY
15 BUILDING_WINDMILL
15 BUILDING_GREAT_FIREWALL
16 BUILDING_HYDRO_PLANT
16 BUILDING_CATHEDRAL
17 BUILDING_SOLAR_PLANT
17 BUILDING_MOSQUE
18 BUILDING_MINT
18 BUILDING_PAGODA
19 BUILDING_OBSERVATORY
19 BUILDING_CEILIDH_HALL
20 BUILDING_MONASTERY
20 BUILDING_COFFEE_HOUSE
21 BUILDING_GARDEN
21 BUILDING_STELE
22 BUILDING_LIGHTHOUSE
22 BUILDING_MAYA_PYRAMID
23 BUILDING_HARBOR
24 BUILDING_COLOSSEUM
25 BUILDING_THEATRE
26 BUILDING_STADIUM
27 BUILDING_MONUMENT
28 BUILDING_TEMPLE
29 BUILDING_OPERA_HOUSE
30 BUILDING_MUSEUM
31 BUILDING_BROADCAST_TOWER
32 BUILDING_BARRACKS
33 BUILDING_ARMORY
34 BUILDING_MILITARY_ACADEMY
35 BUILDING_ARSENAL
36 BUILDING_WALLS
37 BUILDING_CASTLE
38 BUILDING_MILITARY_BASE
39 BUILDING_GRANARY
40 BUILDING_HOSPITAL
41 BUILDING_MEDICAL_LAB
42 BUILDING_WORKSHOP
43 BUILDING_FACTORY
44 BUILDING_NUCLEAR_PLANT
45 BUILDING_SPACESHIP_FACTORY
46 BUILDING_MARKET
47 BUILDING_BANK
48 BUILDING_STOCK_EXCHANGE
49 BUILDING_LIBRARY
50 BUILDING_UNIVERSITY
51 BUILDING_PUBLIC_SCHOOL
52 BUILDING_LABORATORY
53 BUILDING_PALACE
54 BUILDING_HEROIC_EPIC
55 BUILDING_NATIONAL_COLLEGE
56 BUILDING_NATIONAL_EPIC
57 BUILDING_CIRCUS_MAXIMUS
58 BUILDING_NATIONAL_TREASURY
59 BUILDING_IRONWORKS
60 BUILDING_OXFORD_UNIVERSITY
61 BUILDING_HERMITAGE
62 BUILDING_GREAT_LIGHTHOUSE
63 BUILDING_STONEHENGE
64 BUILDING_GREAT_LIBRARY
65 BUILDING_PYRAMID
66 BUILDING_COLOSSUS
67 BUILDING_ORACLE
68 BUILDING_HANGING_GARDEN
69 BUILDING_GREAT_WALL
70 BUILDING_ANGKOR_WAT
71 BUILDING_HAGIA_SOPHIA
72 BUILDING_CHICHEN_ITZA
73 BUILDING_MACHU_PICHU
74 BUILDING_NOTRE_DAME
75 BUILDING_PORCELAIN_TOWER
76 BUILDING_HIMEJI_CASTLE
77 BUILDING_SISTINE_CHAPEL
78 BUILDING_KREMLIN
79 BUILDING_FORBIDDEN_PALACE
80 BUILDING_TAJ_MAHAL
81 BUILDING_BIG_BEN
82 BUILDING_LOUVRE
83 BUILDING_BRANDENBURG_GATE
84 BUILDING_STATUE_OF_LIBERTY
85 BUILDING_CRISTO_REDENTOR
86 BUILDING_EIFFEL_TOWER
87 BUILDING_PENTAGON
88 BUILDING_UNITED_NATIONS
89 BUILDING_SYDNEY_OPERA_HOUSE
90 BUILDING_AQUEDUCT
91 BUILDING_STONE_WORKS


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 -1. See also GameInfo.

local id = GameInfo.Buildings.BUILDING_AMPHITHEATER.ID
local id = GameInfo["Buildings"].["BUILDING_AMPHITHEATER"].ID
local id = GameInfo.Buildings{Type="BUILDING_AMPHITHEATER"}().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_BUILDING_AMPHITHEATER.

local description = GameInfo.Buildings[-1].Description
local description = GameInfo["Buildings"][-1]["Description"]
local description = GameInfo.Buildings{ID=-1}().Description


Used by

string GetHelpTextForBuilding(BuildingType building, bool excludeName, bool excludeHeader, bool noMaintenance)
bool City:CanConstruct(BuildingType building, int continue, int testVisible, bool ignoreCost)
City:ChangeBuildingProduction(BuildingType index, int change)
City:ChangeBuildingProductionTime(BuildingType index, int change)
City:ChooseProduction(UnitType trainUnit, BuildingType constructBuilding, ProjectType createProject, bool finish, bool front)
int City:GetBuildingEspionageModifier(BuildingType building)
int City:GetBuildingFaithPurchaseCost(BuildingType building, bool arg1 = nil)
int City:GetBuildingGlobalEspionageModifier(BuildingType building)
int City:GetBuildingOriginalOwner(BuildingType index)
int City:GetBuildingOriginalTime(BuildingType index)
int City:GetBuildingProduction(BuildingType index)
int City:GetBuildingProductionModifier(BuildingType building)
int City:GetBuildingProductionTime(BuildingType index)
int City:GetBuildingProductionTurnsLeft(BuildingType building, int num)
int City:GetBuildingPurchaseCost(BuildingType building)
int City:GetFirstBuildingOrder(BuildingType building)
int City:GetLocalResourceWonderProductionMod(BuildingType building)
int City:GetNumActiveBuilding(BuildingType buildingType)
int City:GetNumBuilding(BuildingType buildingType)
int City:GetNumFreeBuilding(BuildingType index)
int City:GetNumRealBuilding(BuildingType index)
int City:GetNumSpecialistsAllowedByBuilding(BuildingType building)
int City:GetNumSpecialistsInBuilding(BuildingType index)
BuildingType City:GetProductionBuilding()
int City:GetSellBuildingRefund(BuildingType index)
int City:GetTotalBaseBuildingMaintenance(BuildingType index)
bool City:IsBuildingLocalResourceValid(BuildingType building, bool checkForImprovement)
bool City:IsBuildingSellable(BuildingType index)
bool City:IsCanAddSpecialistToBuilding(BuildingType building)
bool City:IsHasBuilding(BuildingType building)
City:SetBuildingProduction(BuildingType index, int newValue)
City:SetBuildingProductionTime(BuildingType index, int newValue)
City:SetNumRealBuilding(BuildingType index, int newValue)
int Game.GetBuildingYieldChange(BuildingType building, YieldType arg1)
int Game.GetBuildingYieldModifier(BuildingType building, YieldType arg1)
bool Game.IsBuildingEverActive(BuildingType building)
Game.SelectedCitiesGameNetMessage(GameMessageType message, TaskType data2, int data3, BuildingType data4, bool option, bool alt, bool shift, bool ctrl)
GameEvents.CityBuildingsIsBuildingSellable(PlayerID player, BuildingType building)
GameEvents.CityCanConstruct(PlayerID player, CityID city, BuildingType buildingType)
Network.SendSellBuilding(CityID arg0, BuildingType buildingToSell)
bool Player:CanConstruct(BuildingType building, bool continue, bool testVisible, bool ignoreCost)
int Player:CountNumBuildings(BuildingType building)
int Player:GetAdvancedStartBuildingCost(BuildingType building, bool add, City city)
int Player:GetBuildingClassPrereqBuilding(BuildingType building, unknown ePrereqBuildingClass, int extra)
bool Player:IsBuildingFree(BuildingType building)
int Player:IsCanPurchaseAnyCity(bool arg0, bool arg1, UnitType arg2, BuildingType arg3, YieldType arg4)
int Team:GetObsoleteBuildingCount(BuildingType index)
bool Team:IsObsoleteBuilding(BuildingType index)
bool Unit:CanConstruct(Plot plot, BuildingType building)



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.