I did get it to work but the results were disappointing with a test dome. It simply took too long for oxygen to be produced and move (or at least, one of the two processes was slowing things down). After an evening (few hours) my test dome still didn't have a full breathable atmosphere. On the flipside, increasing the speed through the abm's made the server slower (--FPS,++cpu usage).
Another avenue might be to implement the lua drowning mod in reverse (make players suffocate above a certain Y threshold w/o the spacesuit) though that comes with it's own caveat of not knowing when a player is indoors or not (they would suffocate in bases). One solution to that might be to add atmospheric generator nodes. Register/poll the position of these gens and give them an effective radius. Then the suffocation (reverse drowning) mod could simply check if the player is within range of said generator.
Code: Select all
--[[
minetest.register_node(":air", {
description = "Air",
inventory_image = "unknown_node.png",
wield_image = "unknown_node.png",
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
air_equivalent = true,
drop = "",
-- groups = {not_in_creative_inventory=1},
})
minetest.register_node(":void", {
description = "Void (you hacker you!)",
inventory_image = "unknown_node.png",
wield_image = "unknown_node.png",
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
air_equivalent = true,
drop = "",
groups = {not_in_creative_inventory=1},
damage_per_second = 2,
post_effect_color = {a=64, r=255, g=148, b=0},
})
for i=1,8 do
minetest.register_ore({
ore_type = "scatter",
ore = 'void',
wherein = 'air',
clust_scarcity = 1,
clust_num_ores = 1,
clust_size = 1,
height_min = 14000,
height_max = 30000,
})
end
minetest.register_abm({
nodenames = { "air"},
interval = 2,
chance = 10,
action = function(pos, node, active_object_count, active_object_count_wider)
if pos.y > 14000 then
for _, cp in pairs({{x=pos.x+1,y=pos.y,z=pos.z},{x=pos.x-1,y=pos.y,z=pos.z},{x=pos.x,y=pos.y+1,z=pos.z},
{x=pos.x,y=pos.y-1,z=pos.z},{x=pos.x,y=pos.y,z=pos.z+1},{x=pos.x,y=pos.y,z=pos.z-1},}) do
if minetest.env:get_node(cp).name == 'void' then
-- print('moving air')
minetest.env:remove_node(cp) -- air dest
minetest.env:add_node(pos,{name='void'}) -- air source
break
end
end
end
end
})
minetest.register_abm({
nodenames = { "group:leaves"},
interval = 5,
chance = 6,
action = function(pos, node, active_object_count, active_object_count_wider)
if pos.y > 14000 then
for _, cp in pairs({{x=pos.x+1,y=pos.y,z=pos.z},{x=pos.x-1,y=pos.y,z=pos.z},{x=pos.x,y=pos.y+1,z=pos.z},
{x=pos.x,y=pos.y-1,z=pos.z},{x=pos.x,y=pos.y,z=pos.z+1},{x=pos.x,y=pos.y,z=pos.z-1},}) do
if minetest.env:get_node(cp).name == 'void' then
-- print('making air')
minetest.env:remove_node(cp) -- air dest
end
end
end
end
})
]]--