BuildActionType (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 BuildActionType 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 BuildActionType corresponds to the ID column of the Builds XML table.


XML: the Builds table

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

ID Type
0 BUILD_ROAD
0 BUILD_HOLY_SITE
1 BUILD_RAILROAD
1 BUILD_POLDER
2 BUILD_FARM
3 BUILD_MINE
4 BUILD_TRADING_POST
5 BUILD_LUMBERMILL
6 BUILD_PASTURE
7 BUILD_CAMP
8 BUILD_PLANTATION
9 BUILD_QUARRY
10 BUILD_WELL
11 BUILD_OFFSHORE_PLATFORM
12 BUILD_FISHING_BOATS
13 BUILD_FORT
14 BUILD_REMOVE_JUNGLE
15 BUILD_REMOVE_FOREST
16 BUILD_REMOVE_MARSH
17 BUILD_SCRUB_FALLOUT
18 BUILD_REPAIR
19 BUILD_REMOVE_ROUTE
20 BUILD_LANDMARK
21 BUILD_ACADEMY
22 BUILD_CUSTOMS_HOUSE
23 BUILD_MANUFACTORY
24 BUILD_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.Builds.BUILD_HOLY_SITE.ID
local id = GameInfo["Builds"].["BUILD_HOLY_SITE"].ID
local id = GameInfo.Builds{Type="BUILD_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_BUILD_HOLY_SITE.

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


Used by

Game.SelectionListGameNetMessage(GameMessageType message, int data2 = -1, BuildActionType data3 = -1, UnitID data4 = -1, int flags = 0, bool alt = false, bool shift = false)
bool Player:CanBuild(Plot plot, BuildActionType build, bool testEra = false, bool testVisible = false, bool testGold = false)
bool Player:IsBuildBlockedByFeature(BuildActionType build, FeatureType feature)
bool Plot:CanBuild(BuildActionType build, PlayerID player, bool testVisible)
bool Plot:ChangeBuildProgress(BuildActionType build, int change, TeamID team)
int Plot:GetBuildProgress(BuildActionType build)
int Plot:GetBuildTime(BuildActionType build)
int Plot:GetBuildTurnsLeft(BuildActionType build, int nowExtra, int thenExtra)
int Plot:GetBuildTurnsTotal(BuildActionType build)
int Plot:GetFeatureProduction(BuildActionType build, TeamID team, City city)
int Plot:GetYieldWithBuild(BuildActionType build, YieldType yield, bool arg2, PlayerID activePlayer)
bool Plot:IsBuildRemovesFeature(BuildActionType build)
bool Unit:CanBuild(Plot plot, BuildActionType build, bool testVisible = false, bool testGold = true)
BuildActionType Unit:GetBuildType()
int Unit:WorkRate(bool max, BuildActionType build = nil)



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.