Map level 4008, spawn player there. XZ limits +/-2000 to represent edges of world

This commit is contained in:
paramat 2014-08-26 05:10:50 +01:00
parent 622105a4e5
commit be106fdbd1
2 changed files with 47 additions and 26 deletions

View File

@ -1,4 +1,4 @@
watershedmini 0.2.1 by paramat watershedmini 0.2.2 by paramat
For latest stable Minetest back to 0.4.8 For latest stable Minetest back to 0.4.8
Depends default Depends default
Licenses: code WTFPL, textures CC BY-SA Licenses: code WTFPL, textures CC BY-SA

View File

@ -1,38 +1,42 @@
-- watershedmini 0.2.1 by paramat -- watershedmini 0.2.2 by paramat
-- For latest stable Minetest and back to 0.4.8 -- For latest stable Minetest and back to 0.4.8
-- Depends default -- Depends default
-- License: code WTFPL, textures CC BY-SA -- License: code WTFPL, textures CC BY-SA
-- acacialeaf and needles to mark all biomes -- map level to 4008, above clouds
-- desert stone added -- xyz limits set to +/-2000
-- volcanos added -- spawn player at map y
-- double biome size to match watershed 0.5.0
-- Parameters -- Parameters
local ZOOM = 16 -- Must be 2^n. Reduce octaves to avoid spread of highest octave being < 1 local ZOOM = 16 -- Must be 2^n. Reduce octaves to avoid spread of highest octave being < 1
local YMIN = -33000 -- Approximate base of realm stone local XMIN = -2000 -- Map limits
local YMAX = 33000 -- Approximate top of atmosphere / mountains / floatlands local XMAX = 2000
local YWAT = 1 -- Sea surface y local YMIN = 2000
local YMAX = 6000
local ZMIN = -2000
local ZMAX = 2000
local TERCEN = YWAT - 128/ZOOM -- Terrain zero level, average seabed local YWAT = 4008 -- Sea surface y
local TERSCA = 512/ZOOM -- Vertical terrain scale
local XLSAMP = 0.1 -- Extra large scale height variation amplitude
local BASAMP = 0.3 -- Base terrain amplitude
local MIDAMP = 0.1 -- Mid terrain amplitude
local CANAMP = 0.4 -- Canyon terrain maximum amplitude
local ATANAMP = 1.1 -- Arctan function amplitude, smaller = more and larger floatlands above ridges
local BLENEXP = 2 -- Terrain blend exponent
local TRIVER = -0.028 -- Densitybase threshold for river surface
local TSTREAM = -0.004 -- Densitymid threshold for stream surface
local TLAVA = 2 -- Maximum densitybase threshold for lava, small because grad is non-linear
local HITET = 0.35 -- High temperature threshold local TERCEN = YWAT - 128/ZOOM
local LOTET = -0.35 -- Low .. local TERSCA = 512/ZOOM
local ICETET = -0.7 -- Ice .. local XLSAMP = 0.1
local HIHUT = 0.35 -- High humidity threshold local BASAMP = 0.3
local LOHUT = -0.35 -- Low .. local MIDAMP = 0.1
local CANAMP = 0.4
local ATANAMP = 1.1
local BLENEXP = 2
local TRIVER = -0.028
local TSTREAM = -0.004
local TLAVA = 2
local HITET = 0.35
local LOTET = -0.35
local ICETET = -0.7
local HIHUT = 0.35
local LOHUT = -0.35
-- 3D noise for terrain -- 3D noise for terrain
@ -121,10 +125,27 @@ minetest.register_on_mapgen_init(function(mgparams)
minetest.set_mapgen_params({mgname="singlenode"}) minetest.set_mapgen_params({mgname="singlenode"})
end) end)
-- Spawn player
function spawnplayer(player)
player:setpos({x=0, y=4024, z=0})
end
minetest.register_on_newplayer(function(player)
spawnplayer(player)
end)
minetest.register_on_respawnplayer(function(player)
spawnplayer(player)
return true
end)
-- On generated function -- On generated function
minetest.register_on_generated(function(minp, maxp, seed) minetest.register_on_generated(function(minp, maxp, seed)
if minp.y < YMIN or maxp.y > YMAX then if minp.x < XMIN or maxp.x > XMAX
or minp.y < YMIN or maxp.y > YMAX
or minp.z < ZMIN or maxp.z > ZMAX then
return return
end end