ThorHammerz
zzz
- Joined
- Jul 31, 2014
- Messages
- 836
With regards to the function FractalWorld:InitFractal in FractalWorld.lua, is anyone familiar with what the argument "continent_grain" represents? I'm vaguely guessing it has something to do with how many continents (or groups of landmasses that are assigned as a "continent") are created? (But then again, the hard-coded numPlates constant controls how many tectonic plates are formed).
----------------------
For the function GenerateCoasts(args), what do the numbers generally represent? I.e. what might increasing the number of elements in the array (i.e. archipelago passes 3 numbers, the default setting is 2 numbers), and increasing the values of the numbers in the arrays do?
For example, archipelago.lua passes
as the local args, which the MapGenerator.lua takes and runs the loop:
Can't seem to wrap my head around what this code block is doing.
----------------------
For the function GenerateCoasts(args), what do the numbers generally represent? I.e. what might increasing the number of elements in the array (i.e. archipelago passes 3 numbers, the default setting is 2 numbers), and increasing the values of the numbers in the arrays do?
For example, archipelago.lua passes
Code:
local args = {expansion_diceroll_table = {10, 4, 4}};
as the local args, which the MapGenerator.lua takes and runs the loop:
Code:
for loop, iExpansionDiceroll in ipairs(expansion_diceroll_table) do
local shallowWaterPlots = {};
for i, plot in Plots() do
if(plot:GetTerrainType() == deepWater) then
-- Chance for each eligible plot to become an expansion is 1 / iExpansionDiceroll.
-- Default is two passes at 1/4 chance per eligible plot on each pass.
if(plot:IsAdjacentToShallowWater() and Map.Rand(iExpansionDiceroll, "add shallows") == 0) then
table.insert(shallowWaterPlots, plot);
end
end
end
for i, plot in ipairs(shallowWaterPlots) do
plot:SetTerrainType(shallowWater, false, false);
end
end
Can't seem to wrap my head around what this code block is doing.