Remove dark pathslab side texture. Paths don't replace roadslab
This commit is contained in:
parent
79649d991d
commit
f90ae54acc
27
init.lua
27
init.lua
@ -3,9 +3,8 @@
|
|||||||
-- Depends default
|
-- Depends default
|
||||||
-- License: code WTFPL
|
-- License: code WTFPL
|
||||||
|
|
||||||
-- 2 path systems
|
-- remove dark pathslab side textures
|
||||||
-- dark pathslab side textures
|
-- paths don't replace road slab
|
||||||
-- simpler mapgen: amplify terrain noise
|
|
||||||
|
|
||||||
-- Parameters
|
-- Parameters
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ local YCEN = 40 -- Terrain centre
|
|||||||
local YWAT = 1 -- Water level
|
local YWAT = 1 -- Water level
|
||||||
local TERSCA = 24 -- Vertical roads terrain scale
|
local TERSCA = 24 -- Vertical roads terrain scale
|
||||||
local YBTOP = 5 -- Beach top
|
local YBTOP = 5 -- Beach top
|
||||||
local YROCK = 256 -- Dirt thins to 1 node at this distance above YWAT
|
local YROCK = 192 -- Dirt thins out at this y
|
||||||
local DEPSEL = 8 -- Depth of dirt at sea level
|
local DEPSEL = 8 -- Depth of dirt at sea level
|
||||||
local APPCHA = 1 / 4 ^ 2 -- Maximum appletree chance per node
|
local APPCHA = 1 / 4 ^ 2 -- Maximum appletree chance per node
|
||||||
local TFLO = 0.015 -- Flora threshold. Keeps flora away from roads.
|
local TFLO = 0.015 -- Flora threshold. Keeps flora away from roads.
|
||||||
@ -24,9 +23,9 @@ local TPFLO = 0.02 -- Flora path threshold. Keeps flora away from paths.
|
|||||||
local np_terrain = {
|
local np_terrain = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=512, y=512, z=512},
|
spread = {x=768, y=768, z=768},
|
||||||
seed = -9111,
|
seed = -9111,
|
||||||
octaves = 4,
|
octaves = 6,
|
||||||
persist = 0.5
|
persist = 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,9 +115,9 @@ minetest.register_node("path:path", {
|
|||||||
sounds = default.node_sound_dirt_defaults(),
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("path:pathslab", { -- pathside texture darker because sunlight propagates = true
|
minetest.register_node("path:pathslab", {
|
||||||
description = "Path slab",
|
description = "Path slab",
|
||||||
tiles = {"path_path.png", "path_pathside.png", "path_pathside.png"},
|
tiles = {"path_path.png"},
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
@ -202,7 +201,7 @@ end)
|
|||||||
-- Spawn player
|
-- Spawn player
|
||||||
|
|
||||||
function spawnplayer(player)
|
function spawnplayer(player)
|
||||||
player:setpos({x=0, y=48, z=0})
|
player:setpos({x=0, y=0, z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_newplayer(function(player)
|
minetest.register_on_newplayer(function(player)
|
||||||
@ -305,7 +304,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local n_xprepathb = false
|
local n_xprepathb = false
|
||||||
local n_xprepathc = false
|
local n_xprepathc = false
|
||||||
local n_xprepathd = false
|
local n_xprepathd = false
|
||||||
local fimadep = math.max(DEPSEL * (1 - (y - YWAT) / YROCK), 1)
|
local fimadep = math.max(DEPSEL * (1 - (y - YWAT) / (YROCK - YWAT)), 0)
|
||||||
for x = x0-1, x1 do
|
for x = x0-1, x1 do
|
||||||
local nodid = data[vi]
|
local nodid = data[vi]
|
||||||
local nodidu = data[viu]
|
local nodidu = data[viu]
|
||||||
@ -330,10 +329,10 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
|
|
||||||
local n_terrain = nvals_terrain[nixz]
|
local n_terrain = nvals_terrain[nixz]
|
||||||
local ysurf = YCEN
|
local ysurf = YCEN
|
||||||
+ math.floor(n_terrain * (1 + n_abspatha ^ 2 * n_abspathb ^ 2 * 32) * TERSCA)
|
+ math.floor(n_terrain * (1 + n_abspatha ^ 2 * n_abspathb ^ 2 * 16) * TERSCA)
|
||||||
|
|
||||||
if chunk then
|
if chunk then
|
||||||
if y == ysurf and y > YBTOP then
|
if y == ysurf and y > YBTOP and y < YROCK then
|
||||||
if ((n_patha >= 0 and n_xprepatha < 0)
|
if ((n_patha >= 0 and n_xprepatha < 0)
|
||||||
or (n_patha < 0 and n_xprepatha >= 0))
|
or (n_patha < 0 and n_xprepatha >= 0))
|
||||||
or ((n_patha >= 0 and n_zprepatha < 0)
|
or ((n_patha >= 0 and n_zprepatha < 0)
|
||||||
@ -421,6 +420,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local nodid = data[vi]
|
local nodid = data[vi]
|
||||||
local nodida = data[via]
|
local nodida = data[via]
|
||||||
if nodid ~= c_roadblack
|
if nodid ~= c_roadblack
|
||||||
|
and nodid ~= c_roadslab
|
||||||
and nodid ~= c_roadwhite then
|
and nodid ~= c_roadwhite then
|
||||||
data[vi] = c_path
|
data[vi] = c_path
|
||||||
if nodida == c_grass then
|
if nodida == c_grass then
|
||||||
@ -433,6 +433,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local nodid = data[vi]
|
local nodid = data[vi]
|
||||||
local nodida = data[via]
|
local nodida = data[via]
|
||||||
if nodid ~= c_roadblack
|
if nodid ~= c_roadblack
|
||||||
|
and nodid ~= c_roadslab
|
||||||
and nodid ~= c_roadwhite
|
and nodid ~= c_roadwhite
|
||||||
and nodid ~= c_path
|
and nodid ~= c_path
|
||||||
and nodid ~= c_grass
|
and nodid ~= c_grass
|
||||||
@ -458,6 +459,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local nodid = data[vi]
|
local nodid = data[vi]
|
||||||
local nodida = data[via]
|
local nodida = data[via]
|
||||||
if nodid ~= c_roadblack
|
if nodid ~= c_roadblack
|
||||||
|
and nodid ~= c_roadslab
|
||||||
and nodid ~= c_roadwhite then
|
and nodid ~= c_roadwhite then
|
||||||
data[vi] = c_path
|
data[vi] = c_path
|
||||||
if nodida == c_grass then
|
if nodida == c_grass then
|
||||||
@ -470,6 +472,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local nodid = data[vi]
|
local nodid = data[vi]
|
||||||
local nodida = data[via]
|
local nodida = data[via]
|
||||||
if nodid ~= c_roadblack
|
if nodid ~= c_roadblack
|
||||||
|
and nodid ~= c_roadslab
|
||||||
and nodid ~= c_roadwhite
|
and nodid ~= c_roadwhite
|
||||||
and nodid ~= c_path
|
and nodid ~= c_path
|
||||||
and nodid ~= c_grass
|
and nodid ~= c_grass
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 566 B |
Loading…
x
Reference in New Issue
Block a user