Inocudom wrote:The mod below is a good basis for creating alien ruins above ground and below ground.
http://forum.minetest.net/viewtopic.php?id=5524
Inocudom wrote:How do you intend to make it so that the sky always looks like the player is in space, even during the daytime?
if minetest.place_schematic==nil then
function minetest.place_schematic(pos, schematic)
local x = pos.x
local y = pos.y
local z = pos.z
local set_node = minetest.set_node
local scmdata = schematic.data
local j2, k2
for k = 0, schematic.size.z-1 do
k2 = k*schematic.size.x*schematic.size.y
for j = 0, schematic.size.y-1 do
j2 = j*schematic.size.x
for i = 0, schematic.size.x-1 do
if scmdata[i+j2+k2+1].name~="ignore" then
set_node({x=x+i,y=y+j,z=z+k}, scmdata[i+j2+k2+1])
end
end
end
end
end
endNore wrote:@mauvebic: were you finally able to finish your code for an atmosphere? If so, I'd like to see it.
--[[
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
})
]]--

Nore wrote:Is it water at the top of the map? That looks strange on a moon...
paramat: If you want faster generation for those who have the indev release, without affecting the generation time for the others, use that code




mauvebic wrote:updated shots of moonbase Titan I. Residential building is up, got water, plasma & beer distrubtion running :-)
Inocudom wrote:Good to see you back with us again, Mauvebic.
BadWolf wrote:I'm slightly confused, I'm trying to learn and understand the code here, mauvebic, did your code create air inside the structures only?
mauvebic wrote:I'lll keep posting shots of my base as it progresses (unless paramat asks me to move them) :-)
local HEXP = 1.5
local LEXP = 3local HEXP = 2
local LEXP = 2minetest.register_node("moonrealm:airgen", {
description = "Air Generator",
tiles = {"moonrealm_airgen.png"},
groups = {dig_immediate=1},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local env = minetest.env
local x = pos.x
local y = pos.y
local z = pos.z
for i = -1,1 do
for j = -1,1 do
for k = -1,1 do
if not (i == 0 and j == 0 and k == 0) then
local nodename = env:get_node({x=x+i,y=y+j,z=z+k}).name
if nodename == "moonrealm:atmos" then
env:add_node({x=x+i,y=y+j,z=z+k},{name="moonrealm:air"})
end
end
end
end
end
end
})
-- On dignode. Atmosphere flows into a dug hole.
if ATMOS then
minetest.register_on_dignode(function(pos, oldnode, digger)
local env = minetest.env
local x = pos.x
local y = pos.y
local z = pos.z
for i = -1,1 do
for j = -1,1 do
for k = -1,1 do
if not (i == 0 and j == 0 and k == 0) then
local nodename = env:get_node({x=x+i,y=y+j,z=z+k}).name
if nodename == "moonrealm:atmos" then
env:add_node({x=x,y=y,z=z},{name="moonrealm:atmos"})
return
end
end
end
end
end
end)
end
-- Abm.
if ATMOS then
minetest.register_abm({
nodenames = {"moonrealm:air"},
neighbors = {"moonrealm:atmos"},
interval = AIRINT,
chance = 9,
action = function(pos, node, active_object_count, active_object_count_wider)
local env = minetest.env
local x = pos.x
local y = pos.y
local z = pos.z
for i = -1,1 do
for j = -1,1 do
for k = -1,1 do
if not (i == 0 and j == 0 and k == 0) then
local nodename = env:get_node({x=x+i,y=y+j,z=z+k}).name
if nodename == "moonrealm:atmos" then
env:add_node({x=x+i,y=y+j,z=z+k},{name="moonrealm:air"})
print ("[moonrealm] Air spreads ("..i.." "..j.." "..k..")")
end
end
end
end
end
end
})
endUsers browsing this forum: No registered users and 11 guests