Home › Lua API › CityBuildings

Available out of the box. Usable from Lua in the unmodified game.

CityBuildings

20 methods. Symbol/current columns are function addresses (RVA) of the native wrapper.

Community reference for this object: CityBuildings (Sukrit Tan, external).

Signatures are recovered from the game code. ⚠ = partly understood (arguments may be missing or approximate). ? after a name = optional argument. Types: integer/number are Lua numbers, enum-typed arguments show the C++ type in brackets. Two signatures mean the method is registered separately for the UI and the gameplay state and each wrapper was decoded on its own. "same code as" in the Symbol column means the compiler merged identical functions: those methods share one wrapper and cannot be told apart by address.

Method Signature Where Reference Symbol Current
GetBuildingLocation CityBuildings:GetBuildingLocation(eBuilding: integer[BuildingTypes]) → number
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
gameplay yes ↗ 0x6ca4a0 0x6cab60
GetBuildingMaintenance UI state: CityBuildings:GetBuildingMaintenance(eBuilding?: number) → number
gameplay state: CityBuildings:GetBuildingMaintenance(eBuilding: integer[BuildingTypes]) → number
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68cd80 0x68d360
GetBuildingNameOverride UI state: CityBuildings:GetBuildingNameOverride(arg1?: number) → nil/string (or nothing)
gameplay state: CityBuildings:GetBuildingNameOverride(arg1?: number) → nil/string (or nothing)
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68ce00 0x68d3e0
GetBuildingTourismFromGreatWorks CityBuildings:GetBuildingTourismFromGreatWorks(bReligious: boolean, eBuilding: integer[BuildingTypes]) → number
args: bReligious — A boolean flag (true/false).; eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68cf10 0x68d4f0
GetBuildingYieldFromGreatWorks CityBuildings:GetBuildingYieldFromGreatWorks(eYield: integer[YieldTypes], eBuilding: integer[BuildingTypes]) → number
args: eYield — Index of a row of the Yields table (the value of GameInfo.Yields[...].Index).; eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68cfa0 0x68d580
GetBuildingsAtLocation CityBuildings:GetBuildingsAtLocation(x: integer/Plot, y?: integer) → number[]
args: x — Plot index (named plotIndex / plotID in the scripts). (inferred)
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68d020 0x68d600
GetCity CityBuildings:GetCity() → City
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68d140 0x68d720
GetCreatorNameFromIndex ★ CityBuildings:GetCreatorNameFromIndex(arg1: integer[GreatWorkListIndex]) → nil/string
args: arg1 — Great work list index: the index of a work in the game-wide great work list (not the row in the GreatWorks tab
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68d180 0x68d760
GetGreatWorkInSlot CityBuildings:GetGreatWorkInSlot(eBuilding: integer[BuildingTypes], iSlot: integer) → number (GreatWorkListIndex)
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
returns: Great work list index: the index of a work in the game-wide great work list (not the row in the GreatWorks table).
ui-cache yes ↗ 0x68d210 0x68d7f0
GetGreatWorkSlotType CityBuildings:GetGreatWorkSlotType(eBuilding: integer[BuildingTypes], iSlot: integer) → number (GreatWorkSlotTypes)
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
returns: Index of a row of the GreatWorkSlotTypes table (the value of GameInfo.GreatWorkSlotTypes[...].Index).
ui-cache yes ↗ 0x68d290 0x68d870
GetGreatWorkTypeFromIndex ★ CityBuildings:GetGreatWorkTypeFromIndex(arg1: integer[GreatWorkListIndex]) → number
args: arg1 — Great work list index: the index of a work in the game-wide great work list (not the row in the GreatWorks tab
✓ exists at runtime (not called)
returns: Key of a row of the GreatWorks table: the scripts look it up with GameInfo.GreatWorks[result].
ui-cache yes ↗ 0x68d310 0x68d8f0
GetNumGreatWorkSlots CityBuildings:GetNumGreatWorkSlots(eBuilding: integer[BuildingTypes]) → number
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
returns: A count or amount (the scripts name the result count / num / amount). (inferred)
ui-cache yes ↗ 0x68d380 0x68d960
GetPlayerFromIndex ★ CityBuildings:GetPlayerFromIndex(arg1: integer[GreatWorkListIndex]) → number
args: arg1 — Great work list index: the index of a work in the game-wide great work list (not the row in the GreatWorks tab
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68d3f0 0x68d9d0
GetTurnFromIndex ★ CityBuildings:GetTurnFromIndex(arg1: integer[GreatWorkListIndex]) → number
args: arg1 — Great work list index: the index of a work in the game-wide great work list (not the row in the GreatWorks tab
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68d460 0x68da40
HasBuilding CityBuildings:HasBuilding(eBuilding: integer[BuildingTypes]) → boolean
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68d4d0 0x68dab0
IsBuildingThemedCorrectly CityBuildings:IsBuildingThemedCorrectly(eBuilding: integer[BuildingTypes]) → boolean
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index). The scripts pass its index
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68d530 0x68db10
IsPillaged UI state: CityBuildings:IsPillaged(eBuilding?: number) → boolean
gameplay state: CityBuildings:IsPillaged(eBuilding: integer[BuildingTypes]) → boolean
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68d590 0x68db70
RemoveBuilding CityBuildings:RemoveBuilding(eBuilding: integer[BuildingTypes]) (or nothing)
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).
gameplay yes ↗ 0x6ca780 0x6cae40
SetBuildingLocation CityBuildings:SetBuildingLocation(arg1?: number, x: integer/Plot, y?: integer) (or nothing) gameplay yes ↗ 0x6ca7d0 0x6cae90
SetPillaged CityBuildings:SetPillaged(eBuilding?: integer[BuildingTypes], bNewValue?: boolean, fromCityTransfer?: boolean, ePillagingPlayerForNotification?: integer[PlayerTypes])
args: eBuilding — Index of a row of the Buildings table (the value of GameInfo.Buildings[...].Index).; ePillagingPlayerForNotification — Id of a player (as in Players[id]).
gameplay yes ↗ 0x6ca880 —

Notes (★)

GetCreatorNameFromIndex

Faults natively on an index that is not in the game's great work list.

See also: Game.GetGreatWorkDataFromIndex

GetGreatWorkTypeFromIndex

Faults natively on an index that is not in the game's great work list.

See also: Game.GetGreatWorkDataFromIndex

GetPlayerFromIndex

Faults natively on an index that is not in the game's great work list.

See also: Game.GetGreatWorkDataFromIndex

GetTurnFromIndex

Faults natively on an index that is not in the game's great work list.

See also: Game.GetGreatWorkDataFromIndex