function spawnplayer(player)
local DENOFF = -0.4
local TSTONE = 0.02
local PSCA = 4 -- Player scatter from world centre in chunks (80 nodes).
local xsp
local ysp
local zsp
local np_terrain = {
offset = 0,
scale = 1,
spread = {x=384, y=128, z=384},
seed = 593,
octaves = 5,
persist = 0.67
}
local np_terralt = {
offset = 0,
scale = 1,
spread = {x=237, y=79, z=237},
seed = 593,
octaves = 5,
persist = 0.67
}
for chunk = 1, 64 do
print ("[fracture] searching for spawn "..chunk)
local x0 = 80 * math.random(-PSCA, PSCA) - 32
local z0 = 80 * math.random(-PSCA, PSCA) - 32
local y0 = 80 * math.random(-PSCA, PSCA) - 32
local x1 = x0 + 79
local z1 = z0 + 79
local y1 = y0 + 79
local sidelen = 80
local chulens = {x=sidelen, y=sidelen, z=sidelen}
local minposxyz = {x=x0, y=y0, z=z0}
local nvals_terrain = minetest.get_perlin_map(np_terrain, chulens):get3dMap_flat(minposxyz)
local nvals_terralt = minetest.get_perlin_map(np_terralt, chulens):get3dMap_flat(minposxyz)
local nixyz = 1
local stable = {}
for z = z0, z1 do
for y = y0, y1 do
for x = x0, x1 do
local si = x - x0 + 1
local n_terrain = nvals_terrain[nixyz]
local n_terralt = nvals_terralt[nixyz]
local density = (n_terrain + n_terralt) * 0.5 + DENOFF
if density >= TSTONE then
stable[si] = true
elseif stable[si] and density < 0 then
ysp = y + 1
xsp = x
zsp = z
break
end
nixyz = nixyz + 1
end
if ysp then
break
end
end
if ysp then
break
end
end
if ysp then
break
end
end
print ("[fracture] spawn player ("..xsp.." "..ysp.." "..zsp..")")
player:setpos({x=xsp, y=ysp, z=zsp})
local vm = minetest.get_voxel_manip()
local pos1 = {x=xsp-2, y=ysp-2, z=zsp-2}
local pos2 = {x=xsp+2, y=ysp+2, z=zsp+2}
local emin, emax = vm:read_from_map(pos1, pos2)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local data = vm:get_data()
local c_glass = minetest.get_content_id("default:glass")
for i = -2, 2 do
for j = -2, 2 do
for k = -2, 2 do
if i ^ 2 + j ^ 2 + k ^ 2 >= 4 then
local vi = area:index(xsp + i, ysp + j, zsp + k)
data[vi] = c_glass
end
end
end
end
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end
minetest.register_on_newplayer(function(player)
spawnplayer(player)
end)
minetest.register_on_respawnplayer(function(player)
spawnplayer(player)
return true
end)
[noisegrid] chunk minp (-32 -32 -32)
[noisegrid] emin (-48 -48 -48)
[noisegrid] emax (63 63 63)
HeroOfTheWinds wrote:I noticed that this hasn't been really updated lately, so I'll give a short rundown of recent additions and changes...Zsoltisawesome wrote:Current issues: Spacesuits don't work, vacuum doesn't spread, caves spawn with air, not vacuum, vacuum only goes up to the normal water level...
I hate bugs...
All of these are now fixed! I am the vacuum master!
Lua Voxel Manipulator reigns supreme now.
Ores have been largely changed, only Mese and iron return from regular Minetest right now. In place of coal, we now have phosphorus. The new titanium has been added as a highly durable metal, and now there is a new ore called Lunarium that is better than even diamond. (Think of it as moon mese) Silicon can also be found, and it drops the same silicon used in Mesecons. Tools can be crafted from titanium and lunarium.
Light Crystals can now be crafted into light sticks, which have a recipe modeled after torches and give off light just tad bit dimmer than regular torches. Speaking of regular torches, they now go out and become unlit if they are placed in a vacuum. Place them in air from an airgen, though, and it's all good. To relight a torch that's gone out, rightclick it with a stick while in air.
Airgen was bugged, it would spread air out even in total vacuum. Also, if a sealed room became unsealed, the air wouldn't leave. Needless to say, fixed. Several similar errors occurred with liquids, those were also fixed.
Moon trees have been added to provide a source of wood. They are basically monochrome versions of regular trees, and spawn very few and far apart.
Zeg9's UFOs have been added, modified to travel faster and run on lunarium lumps instead of obsidian shards.
New node, half-functional, half-decorative: Air Shield. Can be passed through like trapstone from moreblocks, and has a snazzy animated texture. Use it for doors on buildings with air inside.
Stay tuned for more!
Zsoltisawesome wrote:<snip>
paramat wrote:Please could you add me as a contributor in the README? I wrote the footprints, air/vacuum spread and hydroponics codes. I also created 15 of the textures.
Also, i know that some of the air/vacuum spreading code has been rewritten, but you might want to revert to my original code as it was carefully designed and tested over months by mauvebic and myself. Some of the air/vacuum behaviour might have seemed odd but it was that way for good reasons, one of which is avoiding uncontrolled and exponential life support air spread which can cause an ABM server meltdown. If you experience unexplained server slowdown that might be the reason.
HeroOfTheWinds wrote:This is in fact still being worked on, primarily over on OldCoder's Moontest server. Nothing too big has been done yet, but I have something huge in development for it... just not ready yet. I will say this: Moontest may no longer be just the moon. There has been a lot of bugfixing going on in the background too, and there's an ingame wiki page on the server saying what other bugs are up for fixing. Progress will be better once I'm on break from college...
Users browsing this forum: No registered users and 11 guests