Home › Lua API › CityDistricts

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

CityDistricts

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

Community reference for this object: CityDistricts (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
FindID CityDistricts:FindID(arg1?: number) → District
touches (inferred from the code): reads Cache::City::Instance::m_kValues+0x20
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68e560 0x68eb40
GetCount CityDistricts:GetCount() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68e5d0 0x68ebb0
GetDistrict UI state: CityDistricts:GetDistrict(arg1: string/number) → District
gameplay state: CityDistricts.GetDistrict() ⚠
args: arg1 — A database row hash (named …Hash in the scripts). (inferred)
touches (inferred from the code): reads Cache::City::Instance::m_kValues+0x20
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68e620 0x68ec00
GetDistrictAtLocation CityDistricts:GetDistrictAtLocation(x: integer/Plot, y?: integer) → District
touches (inferred from the code): reads City::Instance::m_eOwner
gameplay yes ↗ 0x6cb260 0x6cb920
GetDistrictByID CityDistricts:GetDistrictByID(arg1?: number) → District
touches (inferred from the code): reads City::Instance::m_eOwner
gameplay yes ↗ 0x6cb2e0 0x6cb9a0
GetDistrictByIndex CityDistricts:GetDistrictByIndex(uiIndex?: number) → District
touches (inferred from the code): reads City::Districts::m_kDistricts, City::Instance::m_eOwner
gameplay yes ↗ 0x6cb350 0x6cba10
GetDistrictByType CityDistricts:GetDistrictByType(kFunc: number/string[DistrictTypes], uiWantIndex?: number) → District (or nothing)
args: kFunc — Index of a row of the Districts table (the value of GameInfo.Districts[...].Index).
touches (inferred from the code): reads City::Instance::m_eOwner
gameplay yes ↗ 0x6cb3c0 0x6cba80
GetDistrictLocation CityDistricts:GetDistrictLocation(kFunc: number/string[DistrictTypes], uiWantIndex?: number) → number, number (or nothing)
args: kFunc — Index of a row of the Districts table (the value of GameInfo.Districts[...].Index). The scripts pass its index
touches (inferred from the code): reads City::Instance::m_eOwner
gameplay yes ↗ 0x6cb480 0x6cbb40
GetNumAllowedDistrictsRequiringPopulation CityDistricts:GetNumAllowedDistrictsRequiringPopulation() → number
✓ called in the game: 1 value(s) as documented
ui-cache yes ↗ 0x68e6b0 0x68ec90
GetNumDistricts UI state: CityDistricts:GetNumDistricts(bIgnoreInternal?: integer, bMustBeComplete?: boolean, bMustHavePopulationRequirement?: boolean, bMustBeSpecialty?: boolean, bNotPillaged?: boolean)
gameplay state: CityDistricts:GetNumDistricts(bIgnoreInternal?: boolean, bMustBeComplete?: boolean, bMustHavePopulationRequirement?: boolean, bMustBeSpecialty?: boolean, bNotPillaged?: boolean) → integer
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68e700 —
GetNumDistrictsOfType CityDistricts:GetNumDistrictsOfType(eDistrictType?: integer[DistrictTypes], bMustBeComplete?: boolean, bAllowReplacements?: boolean) → integer
args: eDistrictType — Index of a row of the Districts table (the value of GameInfo.Districts[...].Index).
gameplay yes ↗ 0x6cb590 —
GetNumZonedDistrictsRequiringPopulation CityDistricts:GetNumZonedDistrictsRequiringPopulation() → number
✓ called in the game: 1 value(s) as documented
returns: A count or amount (the scripts name the result count / num / amount). (inferred)
ui-cache yes ↗ 0x68e710 0x68ecf0
GetPrereqDistrictPlotID CityDistricts:GetPrereqDistrictPlotID(eDistrictType: integer[DistrictTypes]) → number
args: eDistrictType — Index of a row of the Districts table (the value of GameInfo.Districts[...].Index).
touches (inferred from the code): reads City::Instance::m_eOwner
gameplay yes ↗ 0x6cb5a0 0x6cbc60
HasDistrict CityDistricts:HasDistrict(eDistrictType?: integer[DistrictTypes], bMustBeComplete?: boolean, bAllowReplacements?: boolean) → boolean
args: eDistrictType — Index of a row of the Districts table (the value of GameInfo.Districts[...].Index).; bMustBeComplete — A boolean flag (true/false).; bAllowReplacements — A boolean flag (true/false).
✓ exists at runtime (not called)
ui-cache, gameplay yes ↗ 0x68e760 —
IsComplete CityDistricts:IsComplete(eDistrictType?: number, iPlotIndex?: number) → boolean
args: iPlotIndex — Plot index (named plotIndex / plotID in the scripts). (inferred)
touches (inferred from the code): reads Cache::City::Instance::m_kValues+0x20
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68e770 0x68ed50
IsContaminated CityDistricts:IsContaminated(eDistrictType: integer[DistrictTypes]) → boolean
args: eDistrictType — Index of a row of the Districts table (the value of GameInfo.Districts[...].Index).
touches (inferred from the code): reads Cache::City::Instance::m_kValues+0x8, Cache::City::Instance::m_kValues+0x20
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68e860 0x68ee40
IsPillaged CityDistricts:IsPillaged(eDistrictType?: number, iPlotIndex?: number) → boolean
args: iPlotIndex — Plot index (named plotIndex / plotID in the scripts). (inferred)
touches (inferred from the code): reads Cache::City::Instance::m_kValues+0x20
✓ exists at runtime (not called)
ui-cache yes ↗ 0x68e8c0 0x68eea0
RemoveDistrict CityDistricts:RemoveDistrict(eDistrictType: District) (or nothing)
touches (inferred from the code): reads City::Instance::m_eOwner
gameplay yes ↗ 0x6cb620 0x6cbce0
SetDistrictPillaged CityDistricts:SetDistrictPillaged(eDistrictType: District, arg2?: boolean) (or nothing)
touches (inferred from the code): reads City::BuildQueue::m_kNodes, City::Instance::m_eOwner
gameplay yes ↗ 0x6cb6f0 0x6cbdb0