jp wrote:Paramat / Splizard : instead of generate a thin layer of snow on top of the leaves, could you replace them by some snow-texturized leaves, please ?
Splizard wrote:Does it make a difference where you are in the desert?
Snow should only fall in a biome specified area.. which can still be in a desert but it shouldn't be the whole desert..
snow:pinetree, snow:needles, snow:sapling_pine
default:pinetree, default:pine_needles, default:pine_sapling
Hybrid Dog wrote:Shall l disable snowflakes in desert or make it rare?
terminate called after throwing an instance of 'ServerError'
what(): .../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: in function 'get_snow'
.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:191: in function <.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:183>
/usr/share/minetest/builtin/game/register.lua:341: in function </usr/share/minetest/builtin/game/register.lua:329>
--Get snow at position.
local get_snow = function(pos)
--Legacy support.
if weather_legacy == "snow" then
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
local x = pos.x
local y = pos.z
if perlin1:get2d({x, y}) <= 0.53 then
return false
end
-- disable falling snow in desert
local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
local noise3 = desert_perlin:get2d({x=x+150,y=y+50}) -- Offsets must match minetest mapgen desert perlin.
if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
return false
end
return true
end
return false
end
Ivà wrote:I've got crashes like:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
terminate called after throwing an instance of 'ServerError'
what(): .../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: attempt to perform arithmetic on local 'x' (a nil value)
stack traceback:
.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:99: in function 'get_snow'
.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:191: in function <.../.minetest/games/hogwarts/mods/snow/src/falling_snow.lua:183>
/usr/share/minetest/builtin/game/register.lua:341: in function </usr/share/minetest/builtin/game/register.lua:329>
Changing the get_snow function code as below solves the crash:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
--Get snow at position.
local get_snow = function(pos)
--Legacy support.
if weather_legacy == "snow" then
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
local x = pos.x
local y = pos.z
if perlin1:get2d({x, y}) <= 0.53 then
return false
end
-- disable falling snow in desert
local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
local noise3 = desert_perlin:get2d({x=x+150,y=y+50}) -- Offsets must match minetest mapgen desert perlin.
if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
return false
end
return true
end
return false
end
Ivà wrote:Ehmm... but... I didn't dig into the code so I'm not sure that x and y got the intended values here, for example in noise3 assignment there was a 'z' laying around... :-)
if perlin1:get2d({x, y}) <= 0.53 then
local noise3 = desert_perlin:get2d({x=x+150,y=z+50}) -- Offsets must match minetest mapgen desert perlin.
--Get snow at position.
local get_snow = function(pos)
--Legacy support.
if weather_legacy == "snow" then
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
if perlin1:get2d({x=pos.x, y=pos.z}) <= 0.53 then
return false
end
-- disable falling snow in desert
local desert_perlin = minetest.get_perlin(SEEDDIFF3, OCTAVES3, PERSISTENCE3, SCALE3)
local noise3 = desert_perlin:get2d({x=pos.x+150,y=pos.z+50}) -- Offsets must match minetest mapgen desert perlin.
if noise3 > 0.35 then -- Smooth transition 0.35 to 0.45.
return false
end
return true
end
return false
end
Users browsing this forum: No registered users and 56 guests