Sokomine wrote:Finally! Seasons again. There was 4seasons on the King Arthurs Land server for quite a while, and that did provide some intresting gameplay. I'm glad that a new mod has been created (and seems to be developed further :-)) which adds more variety to nature over time. The screenshots look very promising.
luewind wrote:I have been playing around with this mod a bit and rather enjoy the seasons and the weather. I was building in a snow region and noticed that even with snow accumulation turned on it was never growing on the snow already in the region. So I looked into it and saw that the default version of snow in minetest was treated differently then snow in Mymonths.
I messed around a bit with the abms.lua file and changed it to include the default snow and snow blocks. I also added a function that checks the adjacent snow nodes heights before turning a snow_cover_5 node into a snow block and if the height diffs are too high it tried to increase the adjacent nodes height. It works like snow drifting IRL and lets snow "drift" and build up under trees.
Here is a link to the fork I made on github to play around with: https://github.com/luewind/mymonths/blo ... r/abms.lua
luewind wrote:I submitted the pull request.
I'm still working on making the melting behavior not melt the snow/ice biomes. If minetest had biome support it would be a lot easier but I'm relying on snow biomes having ice blocks in them. This doesn't prevent taiga (snow forests) from melting and it makes it a lot harder if in the future having water freeze during winter is added (may then cause snow near rivers and oceans to never melt).
core.register_chatcommand("get_melt_prob", {
params = "", description = "returns the probability of a node melting at the players possition",
func = function(name, param)
local pos = minetest.get_player_by_name(name):getpos()
local list1 = minetest.find_nodes_in_area({x=pos.x-3,y=pos.y-2,z=pos.z-3},{x=pos.x+3,y=pos.y,z=pos.z+3},{"default:ice", "default:snowblock"})
local list2 = minetest.find_nodes_in_area({x=pos.x-3,y=pos.y-2,z=pos.z-3},{x=pos.x+3,y=pos.y,z=pos.z+3},{"mymonths:snow_cover_5","mymonths:snow_cover_4",
"mymonths:snow_cover_3","mymonths:snow_cover_2","mymonths:snow_cover_1"})
-- list1 is snow blocks and ice, list 2 is snow cover nodes
local count = 2 * table.getn(list1) + table.getn(list2)
local prob = 1 - count/147
prob = math.max(tonumber(string.format("%.2f", prob * 10)), 0)
minetest.chat_send_player(name, "probability od melthing here is: " .. prob .. "%")
return
end
})
minetest.register_abm({
nodenames = {'group:soil'},
interval = 240,
chance = 100,
action = function (pos)
-- return if not march or april
if mymonths.month_counter ~= 3
or mymonths.month_counter ~= 4 then
return
end
-- return if not March or April
if mymonths.month_counter ~= 3
and mymonths.month_counter ~= 4 then
return
end
minetest.register_abm({
nodename = {'mymonths:fall_grass'},
interval = 60,
chance = 40,
action = function (pos, node, active_object_count, active_object_count_wider)
if mymonths.month_counter == 4 then
minetest.set_node(pos, {name = 'default:dirt_with_grass'})
end
end
})
Sokomine wrote:It seems to be a very entertaining mod for singleplayer. Could make survival better.
-- leaves changing in September and October.
minetest.register_abm({
nodenames = {'group:leaves'},
interval = 60,
chance = 40,
action = function (pos, node, active_object_count, active_object_count_wider)
if mymonths.month_counter == 9
or mymonths.month_counter == 10 then
if node.name == 'default:leaves' then
minetest.set_node(pos, {name = 'mymonths:leaves_pale_green'})
elseif node.name == 'mymonths:leaves_pale_green' then
minetest.set_node(pos, {name = 'mymonths:leaves_orange'})
elseif node.name == 'mymonths:leaves_orange' then
minetest.set_node(pos, {name = 'mymonths:leaves_red'})
elseif node.name == 'mymonths:leaves_red' then
minetest.set_node(pos, {name = 'mymonths:sticks_default'})
elseif node.name == 'default:aspen_leaves' then
minetest.set_node(pos, {name = 'mymonths:leaves_yellow_aspen'})
elseif node.name == 'mymonths:leaves_yellow_aspen' then
minetest.set_node(pos, {name = 'mymonths:leaves_orange_aspen'})
elseif node.name == 'mymonths:leaves_orange_aspen' then
minetest.set_node(pos, {name = 'mymonths:leaves_red_aspen'})
end
end
end
})
-- leaves changing in September and October.
local newleaves_table = {
{old = "default:leaves", new = "mymonths:leaves_pale_green"},
{old = "mymonths:leaves_pale_green", new = "mymonths:leaves_orange"},
{old = "mymonths:leaves_orange", new = "mymonths:leaves_red"},
{old = "mymonths:leaves_red", new = "mymonths:sticks_default"},
{old = "default:aspen_leaves", new = "mymonths:leaves_yellow_aspen"},
{old = "mymonths:leaves_yellow_aspen", new = "mymonths:leaves_orange_aspen"},
{old = "mymonths:leaves_orange_aspen", new = "mymonths:leaves_red_aspen"}
}
for i in pairs(newleaves_table) do
minetest.register_abm({
nodenames = {newleaves_table[i].old},
interval = 60,
chance = 40,
action = function (pos)
if mymonths.month_counter == 9
or mymonths.month_counter == 10 then
minetest.set_node(pos, {name = newleaves_table[i].new})
end
end
})
end
Users browsing this forum: No registered users and 59 guests