Home › Lua API › Territory

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

Territory

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

Community reference for this object: Territory (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
GetBoundaries Territory:GetBoundaries() → number, number, number ⚠ gameplay yes ↗ 0x238f0 0x23de0
GetCentroid Territory:GetCentroid() → number, number gameplay yes ↗ 0x23990 0x23e80
GetFeatureCount Territory:GetFeatureCount(eFeature: number/string[FeatureTypes]) → number
args: eFeature — Index of a row of the Features table (the value of GameInfo.Features[...].Index).
gameplay yes ↗ 0x239f0 0x23ee0
GetID Territory:GetID() → number gameplay yes ↗ 0x23a60 0x23f50
GetName Territory:GetName() gameplay yes ↗ 0x23aa0 0x23f90
GetPlotCount Territory:GetPlotCount() → number gameplay yes ↗ 0x23b40 0x24030
GetRiverEdgeCount Territory:GetRiverEdgeCount() → number gameplay yes ↗ 0x23b90 0x24080
GetTerrainClass Territory:GetTerrainClass() → number gameplay yes ↗ 0x23be0 0x240d0
GetTotalFeatures Territory:GetTotalFeatures() → number gameplay yes ↗ 0x23c30 0x24120
GetTotalNaturalWonders Territory:GetTotalNaturalWonders() → number gameplay yes ↗ 0x23c80 0x24170
IsLake Territory:IsLake() → boolean gameplay yes ↗ 0x23cd0 0x241c0
IsNone Territory:IsNone() → boolean gameplay yes ↗ 0x23d10 0x24200
IsSea Territory:IsSea() → boolean gameplay yes ↗ 0x23d50 0x24240
SetName Territory:SetName(szName?: string) (or nothing) gameplay yes ↗ 0x23d90 0x24280