well heres my winter abm:
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
if CURRENT_SEASON == 1 then
if node.name == 'madblocks:grass_autumn' or node.name == 'default:dirt_with_grass' or node.name == 'madblocks:grass_spring' then
minetest.env:add_node(pos,{type="node",name='madblocks:grass_winter'})
elseif node.name == 'madblocks:leaves_autumn' or node.name == 'default:leaves' or node.name == 'madblocks:leaves_spring' then
minetest.env:add_node(pos,{type="node",name='madblocks:leaves_winter'})
elseif node.name == 'default:desert_sand' then
above = minetest.env:get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
if above ~= nil and above.name == 'air' then
minetest.env:add_node(pos,{type="node",name='madblocks:desertsand_winter'})
end
elseif node.name == 'default:sand' then
above = minetest.env:get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
if above ~= nil and above.name == 'air' then
minetest.env:add_node(pos,{type="node",name='madblocks:sand_winter'})
end
elseif node.name == 'default:cactus' then
above = minetest.env:get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
if above ~= nil and above.name == 'air' then
minetest.env:add_node(pos,{type="node",name='madblocks:cactus_winter'})
end
elseif node.name == 'default:water_source' then
above = minetest.env:get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
if above ~= nil and above.name == 'air' then
minetest.env:add_node(pos,{type="node",name='madblocks:ice_source'})
end
elseif node.name == 'default:water_flowing' then
above = minetest.env:get_node_or_nil({x=pos.x,y=pos.y+1,z=pos.z})
if above ~= nil and above.name == 'air' then
minetest.env:add_node(pos,{type="node",name='madblocks:ice_flowing'})
end
end
from what i understand, you want to use a < snow > node and place it ontop of anything thats solid and has air on top?
I think celerons' right having an ABM that works on such a massive scale would slow the game down. Hell i had to get rid of electricity in madblocks to make up the performance gobbled up by weather (and it still lags abit at the solstices)
heads up - If youre thinking of adding lua-entity falling snowflakes, dont test it out on a world you intend to keep, i ruined my last city that way lol
Hey celeron, is there a way we could add/change a texture to 'air' nodes to simlulate rain/snow? would be hella more easy than generating falling nodes or lua entities hehe. If we could change the skybox and cloud colors we could even simulate storms :-)