Home › Lua API › TerrainBuilder

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

TerrainBuilder

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

Community reference for this object: TerrainBuilder (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
AddCoastalLowland TerrainBuilder.AddCoastalLowland(iPlotIndex: integer, eLowlandType: integer[CoastalLowlandTypes]) (or nothing)
args: eLowlandType — Value of the CoastalLowlandTypes enum (a type index).
gameplay yes ↗ 0x21e50 0x22340
AddIce TerrainBuilder.AddIce(iPlotIndex: integer, eIceLossEvent: integer[RandomEventTypes]) (or nothing)
args: iPlotIndex — Plot index (plot:GetIndex()).; eIceLossEvent — Value of the RandomEventTypes enum (a type index).
gameplay yes ↗ 0x21ea0 0x22390
AnalyzeChokepoints TerrainBuilder.AnalyzeChokepoints() (or nothing) gameplay yes ↗ 0x21ef0 0x223e0
CanHaveFeature TerrainBuilder:CanHaveFeature(arg1: integer, arg2: table) → boolean gameplay yes ↗ 0x21f10 0x22400
GenerateFloodplains TerrainBuilder.GenerateFloodplains(arg1?: boolean, iMinSize: integer, iMaxSize: integer) (or nothing) gameplay yes ↗ 0x21fd0 0x224c0
GetAdjacentFeatureCount TerrainBuilder:GetAdjacentFeatureCount(arg1: integer) → number
args: arg1 — Plot index (named plotIndex / plotID in the scripts). (inferred)
gameplay yes ↗ 0x22060 —
GetFeaturePlacementPlotList TerrainBuilder:GetFeaturePlacementPlotList(arg1: integer, arg2: table) gameplay yes ↗ 0x22190 0x22680
GetFractalFlags TerrainBuilder.GetFractalFlags() → table{FRAC_WRAP_X: boolean, FRAC_WRAP_Y: boolean} gameplay yes ↗ 0x22330 0x22820
GetInlandCorner TerrainBuilder:GetInlandCorner() → MapPlot gameplay yes ↗ 0x223e0 0x228d0
GetRandomNumber TerrainBuilder.GetRandomNumber(usNum: integer[IntRange], pszLog: string[const char]) → number (IntRange)
args: usNum — A number.; pszLog — A string.
gameplay yes ↗ 0x22430 0x22920
SetContinentType TerrainBuilder:SetContinentType(eType: integer[ContinentTypes]) (or nothing)
args: eType — Index of a row of the Continents table (the value of GameInfo.Continents[...].Index).
gameplay yes ↗ 0x224a0 0x22990
SetFeatureType TerrainBuilder:SetFeatureType(iY: integer[FeatureTypes]) → boolean
args: iY — Index of a row of the Features table (the value of GameInfo.Features[...].Index).
gameplay yes ↗ 0x22500 0x229f0
SetMultiPlotFeatureType TerrainBuilder.SetMultiPlotFeatureType(arg1: table, arg2: integer[TechTypes]) → boolean
args: arg2 — Index of a row of the Technologies table (the value of GameInfo.Technologies[...].Index).
gameplay yes ↗ 0x22590 0x22a80
SetNEOfCliff TerrainBuilder:SetNEOfCliff(arg1?: boolean) (or nothing)
args: arg1 — A Plot object (the scripts pass a variable named pPlot).
gameplay yes ↗ 0x227f0 0x22ce0
SetNEOfRiver TerrainBuilder:SetNEOfRiver(arg1?: any, arg2: integer[FlowDirectionTypes], iRiverID: integer) (or nothing) ⚠
args: arg2 — Value of the FlowDirectionTypes enum (a type index).
gameplay yes ↗ 0x22870 0x22d60
SetNWOfCliff TerrainBuilder:SetNWOfCliff(arg1?: boolean) (or nothing)
args: arg1 — A Plot object (the scripts pass a variable named pPlot).
gameplay yes ↗ 0x229c0 0x22eb0
SetNWOfRiver TerrainBuilder:SetNWOfRiver(arg1?: any, arg2: integer[FlowDirectionTypes], iRiverID: integer) (or nothing) ⚠
args: arg2 — Value of the FlowDirectionTypes enum (a type index).
gameplay yes ↗ 0x22a40 0x22f30
SetTerrainType TerrainBuilder.SetTerrainType(x: integer/Plot, y?: integer, arg3: integer) (or nothing) ⚠
args: x — A Plot object (the scripts pass a variable named pPlot).
gameplay yes ↗ 0x22b90 0x23080
SetWOfCliff TerrainBuilder:SetWOfCliff(arg1?: boolean) (or nothing)
args: arg1 — A Plot object (the scripts pass a variable named pPlot).
gameplay yes ↗ 0x22bf0 0x230e0
SetWOfRiver TerrainBuilder:SetWOfRiver(arg1?: any, arg2: integer[FlowDirectionTypes], iRiverID: integer) (or nothing) ⚠
args: arg2 — Value of the FlowDirectionTypes enum (a type index).
gameplay yes ↗ 0x22c70 0x23160
StampContinents TerrainBuilder.StampContinents() (or nothing) gameplay yes ↗ 0x22dc0 0x232b0