ImprovementType (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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


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


XML: the Improvements table

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

ID Type
0 IMPROVEMENT_CITY_RUINS
0 IMPROVEMENT_HOLY_SITE
1 IMPROVEMENT_BARBARIAN_CAMP
1 IMPROVEMENT_POLDER
2 IMPROVEMENT_GOODY_HUT
3 IMPROVEMENT_FARM
4 IMPROVEMENT_MINE
5 IMPROVEMENT_QUARRY
6 IMPROVEMENT_TRADING_POST
7 IMPROVEMENT_LUMBERMILL
8 IMPROVEMENT_PASTURE
9 IMPROVEMENT_FISHING_BOATS
10 IMPROVEMENT_PLANTATION
11 IMPROVEMENT_CAMP
12 IMPROVEMENT_WELL
13 IMPROVEMENT_OFFSHORE_PLATFORM
14 IMPROVEMENT_FORT
15 IMPROVEMENT_LANDMARK
16 IMPROVEMENT_ACADEMY
17 IMPROVEMENT_CUSTOMS_HOUSE
18 IMPROVEMENT_MANUFACTORY
19 IMPROVEMENT_CITADEL


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.Improvements.IMPROVEMENT_HOLY_SITE.ID
local id = GameInfo["Improvements"].["IMPROVEMENT_HOLY_SITE"].ID
local id = GameInfo.Improvements{Type="IMPROVEMENT_HOLY_SITE"}().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_IMPROVEMENT_HOLY_SITE.

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


Used by

bool CanPlaceGoodyAt(ImprovementType improvement, Plot plot)
string GetHelpTextForImprovement(ImprovementType improvement, bool excludeName, bool excludeHeader, bool noMaintenance)
int Area:GetNumImprovements(ImprovementType improvement)
Events.GoToPediaHomePage(ImprovementType homePage)
Events.SerialEventImprovementCreated(float hexX, int hexY, ArtStyleType continent1, ArtStyleType continent2, PlayerID player, int createImprovementType, ImprovementType createImprovementRRType, int createImprovementEra, int createImprovementState, unknown ImprovementEra = nil)
int Game.GetImprovementUpgradeTime(ImprovementType improvement, Plot plot)
int Player:GetAdvancedStartImprovementCost(ImprovementType improvement, bool add, Plot plot)
int Player:GetImprovementCount(ImprovementType improvement)
int Plot:CalculateImprovementYieldChange(ImprovementType improvement, YieldType yield, PlayerID player, bool optimal, RouteType assumeThisRoute)
bool Plot:CanHaveImprovement(ImprovementType improvement, TeamID team, bool potential)
ImprovementType Plot:GetImprovementType()
ImprovementType Plot:GetRevealedImprovementType(TeamID team, bool debug)
int Plot:GetUpgradeTimeLeft(ImprovementType improvement, PlayerID player)
bool Plot:IsResourceConnectedByImprovement(ImprovementType improvement)
Team:ChangeImprovementYieldChange(ImprovementType index1, YieldType index2, int change)
int Team:GetImprovementYieldChange(ImprovementType index, YieldType index2)



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.