Plot.SetTerrainType (Civ5 API)

From Civilization Modding Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Plot.

This is an instance method, invoke it with a colon.


Usage

void Plot:SetTerrainType(TerrainType terrain, bool recalculateAreas, bool rebuildGraphics))


Parameters

terrain: No description available.
recalculateAreas: No description available.
rebuildGraphics): No description available.


Source code samples

Redundant occurences have been removed.

Amazon_XP.lua (G&K)

DLC/Expansion/Maps/Amazon_XP.lua
0399
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
0400
end
0404
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
0405
elseif plot:IsFlatlands() then
0412
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
0413
if plot:IsFlatlands() then
0420
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
0421
else
0424
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
0425
plot:SetFeatureType(featureMarsh, -1);


AssignStartingPlots.lua

Gameplay/Lua/AssignStartingPlots.lua
5598
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
5599
for loop, direction in ipairs(self.direction_types) do
5831
plot:SetTerrainType(TerrainTypes.TERRAIN_PLAINS, false, false)
5832
plot:SetFeatureType(wonder_list[8])
5844
plot:SetTerrainType(TerrainTypes.TERRAIN_PLAINS, false, false)
5845
plot:SetFeatureType(wonder_list[10])


AssignStartingPlots.lua (G&K)

DLC/Expansion/Gameplay/Lua/AssignStartingPlots.lua
2857
forcePlot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, true);
4296
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
4297
self:PlaceResourceImpact(conv_x, conv_y, 1, 0) -- Disallow strategic resources at this plot, to keep it a farm plot.
5955
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false);
5959
plot:SetTerrainType(TerrainTypes.TERRAIN_PLAINS, false, false);
5966
adjPlot:SetTerrainType(TerrainTypes.TERRAIN_COAST, false, false)
5967
end
9537
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, true)
9539
--print("-"); print("Fixed a Sugar/Jungle at plot", x, y);
9540
end


Boreal.lua (G&K)

DLC/Expansion/Maps/Boreal.lua
0197
plot:SetTerrainType(TerrainTypes.TERRAIN_SNOW, false, false);
0199
plot:SetTerrainType(TerrainTypes.TERRAIN_TUNDRA, false, false);


Europe.lua (G&K)

DLC/Expansion/Maps/Europe.lua
1168
plot:SetTerrainType(TerrainTypes.TERRAIN_DESERT, false, false)
1169
end


FeatureGenerator.lua (G&K)

DLC/Expansion/Gameplay/Lua/FeatureGenerator.lua
0295
plot:SetTerrainType(self.terrainPlains, false, true)  -- These flags are for recalc of areas and rebuild of graphics. No need to recalc from any of these changes.
0296
elseif (plot:IsRiver()) then
0299
plot:SetTerrainType(self.terrainPlains, false, true)
0300
elseif (terrainType == self.terrainIce) then
0301
plot:SetTerrainType(self.terrainTundra, false, true)
0302
end


MapGenerator.lua (G&K)

DLC/Expansion/Gameplay/Lua/MapGenerator.lua
0189
plot:SetTerrainType(shallowWater, false, false);
0191
plot:SetTerrainType(deepWater, false, false);
0222
plot:SetTerrainType(terrainTypes[i], false, false);


NaturalWondersCustomMethods.lua (G&K)

DLC/Expansion/Gameplay/Lua/NaturalWondersCustomMethods.lua
0147
plot:SetTerrainType(TerrainTypes.TERRAIN_COAST, false, false)
0148
end
0159
SEPlot:SetTerrainType(TerrainTypes.TERRAIN_COAST, false, false)
0160
end
0203
plot:SetTerrainType(TerrainTypes.TERRAIN_GRASS, false, false)
0204
local direction_types = {


Ring.lua

Maps/Ring.lua
0545
plot:SetTerrainType(self.terrainPlains, false, true)  -- These flags are for recalc of areas and rebuild of graphics. No need to recalc from any of these changes.
0546
end



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.