MapGen & mapGenerator: add param2_data
This commit is contained in:
@@ -16,39 +16,4 @@ core.register_mapgen_script(core.get_modpath('smc__core__map_generator')..'/src/
|
||||
-- For now, the generation does not have its own support
|
||||
-- for the generation of ores and decorations, so vanilla ones are used.
|
||||
|
||||
core.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "soils:rocky_soil_baren",
|
||||
wherein = "rocks:sylite",
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_num_ores = 8,
|
||||
clust_size = 3,
|
||||
y_min = -31000,
|
||||
y_max = 64,
|
||||
})
|
||||
|
||||
core.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = "soils:turf_swamp",
|
||||
sidelen = 8,
|
||||
fill_ratio = 0.4,
|
||||
decoration = "plants:plants",
|
||||
})
|
||||
|
||||
core.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = "soils:turf_swamp",
|
||||
sidelen = 8,
|
||||
fill_ratio = 0.05,
|
||||
decoration = "plants:plant0",
|
||||
})
|
||||
|
||||
core.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = "soils:turf_swamp",
|
||||
sidelen = 8,
|
||||
fill_ratio = 0.01,
|
||||
decoration = "plants:plant2",
|
||||
})
|
||||
|
||||
return mapGenerator
|
||||
@@ -91,9 +91,9 @@ local ocean = {
|
||||
|
||||
local common_lands = {
|
||||
['landscape'] = {
|
||||
offset = 0,
|
||||
offset = 10,
|
||||
scale = 5,
|
||||
spread = {x = 10, y = 10, z = 10},
|
||||
spread = {x = 15, y = 15, z = 15},
|
||||
seed = 88005553535,
|
||||
octaves = 2,
|
||||
persistence = 0.4,
|
||||
@@ -705,6 +705,33 @@ mapGenerator:registerBiome('midgard', 'swamp', {
|
||||
generateSoil = generateSoil,
|
||||
postProcessing = postProcessing
|
||||
})--]]
|
||||
---@type NoiseParams
|
||||
local ryeNoiseParams = {
|
||||
offset = 0,
|
||||
scale = 10,
|
||||
spread = {x = 30, y = 30, z = 30},
|
||||
seed = 88005553535,
|
||||
octaves = 2,
|
||||
persistence = 0.4,
|
||||
lacunarity = 2,
|
||||
}
|
||||
local ryeNoise
|
||||
|
||||
---@param nodeType MapGen.nodeType
|
||||
---@param area VoxelArea
|
||||
local function meadowPostProcessing(biome, mapGenerator, factors, data, data2, index, x, y, z, nodeType, area)
|
||||
if nodeType ~= 'TURF' then
|
||||
return
|
||||
end
|
||||
|
||||
if ryeNoise == nil then ryeNoise = core.get_value_noise(ryeNoiseParams) end
|
||||
|
||||
if ryeNoise:get_2d({x=x, y=z}) + math.random(0, 3) > 8 then
|
||||
local i = area:index(x,y+1,z)
|
||||
data[i] = id('plants:rye')
|
||||
data2[i] = 3
|
||||
end
|
||||
end
|
||||
|
||||
mapGenerator:registerBiome('midgard', 'green_meadow', {
|
||||
tempPoint = 80,
|
||||
@@ -718,6 +745,7 @@ mapGenerator:registerBiome('midgard', 'green_meadow', {
|
||||
bottom = 'soils:humus',
|
||||
},
|
||||
soilHeight = 5,
|
||||
postProcessing = meadowPostProcessing,
|
||||
--generateRock = generateRock,
|
||||
--generateTurf = generateTurf,
|
||||
--generateSoil = generateSoil,
|
||||
|
||||
Reference in New Issue
Block a user