diff --git a/mods/CORE/MapGen/src/MapGen.lua b/mods/CORE/MapGen/src/MapGen.lua index 4ba93ca..ef13178 100644 --- a/mods/CORE/MapGen/src/MapGen.lua +++ b/mods/CORE/MapGen/src/MapGen.lua @@ -244,6 +244,7 @@ function MapGen:register2DPeaksFromFile(layerName, map, zeroPos,peakColors) local modPath = core.get_modpath(core.get_current_modname()) local peaks = Api.ff2luat(modPath .. '/textures/maps/' .. map) local mapSize = peaks.size + peaks.size = nil print(dump(peaks)) for color, peaksPos in pairs(peaks) do diff --git a/mods/ENVIRONMENT/mapGenerator/src/asyncInit.lua b/mods/ENVIRONMENT/mapGenerator/src/asyncInit.lua index 71f6d26..bafa56b 100644 --- a/mods/ENVIRONMENT/mapGenerator/src/asyncInit.lua +++ b/mods/ENVIRONMENT/mapGenerator/src/asyncInit.lua @@ -37,6 +37,8 @@ dofile(core.get_modpath('smc__api__table')..'/init.lua') -- TODO: пока что закоментировано, поскольку вызывает ошибку из-за global_step -- Api loader -- dofile(core.get_modpath('smc__api__api_loader')..'/init.lua') +Api = {} +dofile(core.get_modpath('smc__api__api_loader')..'/src/Api/ff2lua.lua') ---@type MapGen local mapGenerator = dofile(core.get_modpath('smc__core__map_generator')..'/src/mapGenerator.lua') diff --git a/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua b/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua index 763b5eb..82a9ec9 100644 --- a/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua +++ b/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua @@ -61,7 +61,7 @@ local land1 = { } local land2 = { - offset = 20, + offset = 10, scale = 5, spread = {x = 30, y = 30, z = 30}, seed = 47, @@ -133,22 +133,42 @@ mapGenerator:register2DPeaks('midgard', v(200, 0, 100), v(-300, 0, -200), })--]] - +--[[ mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', {x=250, y=250}, { - ['#396fffff'] = {noise = { + ['#396FFFFF'] = {noise = { landscapeNoise = land1, tempNoise = climat2, humidityNoise = climat2, } }, - ['3fff26ff'] = {noise = { + ['#3FFF26FF'] = {noise = { landscapeNoise = land2, tempNoise = climat2, humidityNoise = climat2, } } -}) +})--]] +local N = 32 +for x = -10, 10 do + for z = - 10, 10 do + local land + if math.random(0,1) == 0 then + land = land1 + else + land = land2 + end + + print(x) + + mapGenerator:register2DPeak('midgard', vector.new(x*N, 0, z*N), { + landscapeNoise = land, + tempNoise = climat2, + humidityNoise = climat2, + }) + end +end +--[[ mapGenerator:registerCavern('midgard', 'cavern1', { minY = -48, maxY = 0, @@ -163,7 +183,7 @@ mapGenerator:registerCavern('midgard', 'cavern1', { persistence = 0.5, lacunarity = 2.0 }, -}) +})--]] -- --- Biomes --- diff --git a/mods/ENVIRONMENT/mapGenerator/textures/maps/map.ff b/mods/ENVIRONMENT/mapGenerator/textures/maps/map.ff deleted file mode 100644 index 01cc1d9..0000000 Binary files a/mods/ENVIRONMENT/mapGenerator/textures/maps/map.ff and /dev/null differ