Home › Lua API › City

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

City

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

Community reference for this object: City (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
AttachModifierByID City:AttachModifierByID(arg1?: string) → number
args: arg1 — A string.
gameplay yes ↗ 0x6c83c0 0x6c8a80
CanRaze City:CanRaze() → boolean
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a060 0x68a640
ChangeLoyalty City:ChangeLoyalty(arg1: integer) (or nothing) gameplay yes ↗ 0x713590 0x713e00
ChangePopulation City:ChangePopulation(iChange: integer) (or nothing)
args: iChange — A number.
gameplay yes ↗ 0x6c8640 0x6c8d00
GetAllAssignedGovernors City:GetAllAssignedGovernors() → Governor[] (or nothing)
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x7105f0 0x710e60
GetAmenityAdvice City:GetAmenityAdvice() → string
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a0b0 0x68a690
GetAssignedGovernor City:GetAssignedGovernor() → Governor (or nothing)
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x7106f0 0x710f60
GetBuildQueue City:GetBuildQueue() → CityBuildQueue
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a180 0x68a760
GetBuildingFaithPurchaseEnabled City:GetBuildingFaithPurchaseEnabled(arg1?: number) → boolean gameplay yes ↗ 0x6c86d0 0x6c8d90
GetBuildingPotentialYield City:GetBuildingPotentialYield(arg1: string/number, arg2: string/number) → number (or nothing)
args: arg1 — A database row hash (named …Hash in the scripts). (inferred)
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68a1b0 0x68a790
GetBuildingYield City:GetBuildingYield(arg1: string/number, arg2: string/number) → number (or nothing)
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68a2b0 0x68a890
GetBuildings City:GetBuildings() → CityBuildings
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a370 0x68a950
GetCitizens City:GetCitizens() → CityCitizens
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a3a0 0x68a980
GetCityAI City:GetCityAI() → AiCityBuild
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a3d0 0x68a9b0
GetComponentID City:GetComponentID() → 1 values ⚠
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68a400 0x68a9e0
GetCulturalIdentity City:GetCulturalIdentity() → CityCulturalIdentity
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x710760 0x710fd0
GetCulture City:GetCulture() → CityCulture
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a450 0x68aa30
GetDistrictID City:GetDistrictID() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a480 0x68aa60
GetDistricts City:GetDistricts() → CityDistricts
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a4d0 0x68aab0
GetGold City:GetGold() → CityGold
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a500 0x68aae0
GetGrowth City:GetGrowth() → CityGrowth
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a530 0x68ab10
GetHousingAdvice City:GetHousingAdvice() → string
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a560 0x68ab40
GetID UI state: City:GetID() → number
gameplay state: City:GetID() → number (or nothing)
✓ called in the game: 1 value(s) as documented
returns: Id of a player: the scripts use the result as Players[result]. (inferred)
ui-cache, gameplay yes ↗ 0x68a630 0x68ac10
GetJustConqueredFrom City:GetJustConqueredFrom() → number
✓ called in the game: 1 value(s) as documented
returns: Id of a player: the scripts use the result as Players[result]. (inferred)
ui-cache yes ↗ 0x68a670 0x68ac50
GetLastTransferType City:GetLastTransferType() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68a6c0 0x68aca0
GetLocation City:GetLocation() → 1 values ⚠
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68a710 0x68acf0
GetLoyaltyAdvice City:GetLoyaltyAdvice() → string
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x710790 0x711000
GetName UI state: City:GetName() → nil/string
gameplay state: City:GetName() → string (or nothing)
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a750 0x68ad30
GetOriginalOwner UI state: City:GetOriginalOwner() → number
gameplay state: City:GetOriginalOwner() → number (or nothing)
✓ called in the game: 1 value(s) as documented
returns: Id of a player: the scripts use the result as Players[result].
ui-cache, gameplay yes ↗ 0x68a7b0 0x68ad90
GetOwnedPlots City:GetOwnedPlots() → MapPlot gameplay yes ↗ 0x6c8990 0x6c9050
GetOwner UI state: City:GetOwner() → number
gameplay state: City:GetOwner() → number (or nothing)
✓ called in the game: 1 value(s) as documented
returns: Id of a player: the scripts use the result as Players[result].
ui-cache, gameplay yes ↗ 0x68a800 0x68ade0
GetOwnerBeforeOccupation City:GetOwnerBeforeOccupation() → number
✓ called in the game: 1 value(s) as documented
returns: Id of a player: the scripts use the result as Players[result].
ui-cache yes ↗ 0x68a850 0x68ae30
GetPlot City:GetPlot() → MapPlot (or nothing) gameplay yes ↗ 0x6c8ae0 0x6c91a0
GetPopulation City:GetPopulation() → number
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68a8a0 0x68ae80
GetPower City:GetPower() → CityPower
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x73ce00 0x73d740
GetPowerAdvice City:GetPowerAdvice() → string
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x73ce30 0x73d770
GetProperties City:GetProperties() → 1 values ⚠
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68a8f0 0x68aed0
GetProperty UI state: City:GetProperty(arg1?: number) → 1 values (or nothing) ⚠
gameplay state: City:GetProperty()
✓ called in the game: 0 value(s) as documented
ui-cache, gameplay yes ↗ 0x68a930 0x68af10
GetReligion City:GetReligion() → CityReligion
✓ called in the game: 1 value(s) as documented
ui-cache, gameplay yes ↗ 0x68aa60 0x68b040
GetTrade City:GetTrade() → CityTrade
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68aa90 0x68b070
GetUnitFaithPurchaseEnabled City:GetUnitFaithPurchaseEnabled(arg1?: number) → boolean gameplay yes ↗ 0x6c8c30 0x6c92f0
GetX UI state: City:GetX() → number
gameplay state: City:GetX() → number (or nothing)
✓ called in the game: 1 value(s) as documented
returns: The scripts pass the result to PlayerVisibility.IsVisible (parameter x). (inferred)
ui-cache, gameplay yes ↗ 0x68aac0 0x68b0a0
GetY UI state: City:GetY() → number
gameplay state: City:GetY() → number (or nothing)
✓ called in the game: 1 value(s) as documented
returns: The scripts pass the result to PlayerVisibility.IsVisible (parameter y). (inferred)
ui-cache, gameplay yes ↗ 0x68ab10 0x68b0f0
GetYield UI state: City:GetYield(arg1: string/number) → number
gameplay state: City:GetYield(eYield: number/string) → number (FixedPoint)
args: arg1 — A constant from the Lua table YieldTypes.
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68ab60 0x68b140
GetYieldToolTip City:GetYieldToolTip(eYieldType: string/number) → nil (or nothing)
args: eYieldType — A constant from the Lua table YieldTypes.
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68abf0 0x68b1d0
IsCapital City:IsCapital() → boolean
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68acf0 0x68b2d0
IsOccupied City:IsOccupied() → boolean
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68ad30 0x68b310
IsOriginalCapital City:IsOriginalCapital() → boolean
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68ad70 0x68b350
SetBuildingFaithPurchaseEnabled City:SetBuildingFaithPurchaseEnabled(buildingType?: number, bNewValue?: boolean) (or nothing)
args: bNewValue — A boolean flag (true/false).
gameplay yes ↗ 0x6c8df0 0x6c94b0
SetName City:SetName(pszName: string[const char]) (or nothing) gameplay yes ↗ 0x6c8ea0 0x6c9560
SetProperty City:SetProperty() (or nothing) gameplay yes ↗ 0x6c8ef0 0x6c95b0
SetUnitFaithPurchaseEnabled City:SetUnitFaithPurchaseEnabled(unitType?: number, bNewValue?: boolean) (or nothing)
args: bNewValue — A boolean flag (true/false).
gameplay yes ↗ 0x6c8f90 0x6c9650