Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loud_walking
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
loud_walking
Commits
8a7c9d58
Commit
8a7c9d58
authored
8 years ago
by
Duane Robertson
Browse files
Options
Downloads
Patches
Plain Diff
Change water level.
parent
c437d102
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
init.lua
+1
-1
1 addition, 1 deletion
init.lua
mapgen.lua
+2
-14
2 additions, 14 deletions
mapgen.lua
with
3 additions
and
15 deletions
init.lua
+
1
−
1
View file @
8a7c9d58
...
...
@@ -61,7 +61,7 @@ if not minetest.set_mapgen_setting then
end
minetest
.
register_on_mapgen_init
(
function
(
mgparams
)
minetest
.
set_mapgen_params
({
mgname
=
"singlenode"
,
flags
=
"nolight"
})
minetest
.
set_mapgen_params
({
mgname
=
"singlenode"
,
water_level
=-
31000
,
flags
=
"nolight"
})
end
)
...
...
This diff is collapsed.
Click to expand it.
mapgen.lua
+
2
−
14
View file @
8a7c9d58
...
...
@@ -21,7 +21,6 @@ local glass = {"loud_walking:sky_scrith", "loud_walking:cloud_scrith", "loud_wal
local
data
=
{}
local
p2data
=
{}
-- vm rotation data buffer
local
lightmap
=
{}
local
vm
,
emin
,
emax
,
a
,
csize
,
heightmap
,
biomemap
local
div_sz_x
,
div_sz_z
,
minp
,
maxp
,
terrain
,
cave
local
cloud
...
...
@@ -190,7 +189,6 @@ local function place_schematic(pos, schem, center)
local
prob
=
schem
.
data
[
isch
].
prob
or
schem
.
data
[
isch
].
param1
or
255
if
prob
>=
math.random
(
255
)
and
schem
.
data
[
isch
].
name
~=
"air"
then
data
[
ivm
]
=
node
[
schem
.
data
[
isch
].
name
]
lightmap
[
ivm
]
=
0
end
local
param2
=
schem
.
data
[
isch
].
param2
or
0
p2data
[
ivm
]
=
param2
...
...
@@ -283,8 +281,7 @@ local function generate(p_minp, p_maxp, seed)
a
=
VoxelArea
:
new
({
MinEdge
=
emin
,
MaxEdge
=
emax
})
csize
=
vector
.
add
(
vector
.
subtract
(
maxp
,
minp
),
1
)
--vm:set_lighting({day = 0, night = 0}, minp, maxp)
lightmap
=
vm
:
get_light_data
()
vm
:
set_lighting
({
day
=
0
,
night
=
0
},
minp
,
maxp
)
local
ground
=
half_pod
.
y
local
heights
=
{}
...
...
@@ -315,7 +312,6 @@ local function generate(p_minp, p_maxp, seed)
local
dy
=
y
-
minp
.
y
local
fdy
=
y
%
fcsize
.
y
local
py
=
math_floor
(
y
/
fcsize
.
y
)
lightmap
[
ivm
]
=
0
if
py
~=
last_py
or
px
~=
last_px
or
pz
~=
last_pz
then
biome
,
cave_lining
=
get_biome
(
x
,
y
,
z
)
end
...
...
@@ -353,7 +349,6 @@ local function generate(p_minp, p_maxp, seed)
end
elseif
math.min
(
fdx
,
pod_size
.
x
-
fdx
)
+
math.min
(
fdy
,
pod_size
.
y
-
fdy
)
+
math.min
(
fdz
,
pod_size
.
z
-
fdz
)
<
bevel
then
--data[ivm] = node['air']
lightmap
[
ivm
]
=
0
in_cave
=
false
elseif
(
fdx
==
0
or
fdx
==
pod_size
.
x
-
1
)
or
(
fdz
==
0
or
fdz
==
pod_size
.
z
-
1
)
or
(
fdy
==
0
or
fdy
==
pod_size
.
y
-
1
)
or
math.min
(
fdx
,
pod_size
.
x
-
fdx
)
+
math.min
(
fdy
,
pod_size
.
y
-
fdy
)
+
math.min
(
fdz
,
pod_size
.
z
-
fdz
)
<
bevel
+
1
then
if
math_abs
(
fdy
-
half_pod
.
y
-
2
)
<
2
and
(
fdz
==
half_pod
.
z
or
fdx
==
half_pod
.
x
)
then
...
...
@@ -363,10 +358,8 @@ local function generate(p_minp, p_maxp, seed)
data
[
ivm
]
=
node
[
glass
[
3
]]
elseif
fdy
<
half_pod
.
y
then
data
[
ivm
]
=
node
[
"loud_walking:scrith"
]
lightmap
[
ivm
]
=
0
elseif
biome
==
"underground"
then
data
[
ivm
]
=
node
[
"loud_walking:scrith"
]
lightmap
[
ivm
]
=
0
elseif
fdy
==
pod_size
.
y
-
1
then
data
[
ivm
]
=
node
[
glass
[
cloud
[
index
]
<
cloud_i
and
1
or
2
]]
else
...
...
@@ -440,17 +433,13 @@ local function generate(p_minp, p_maxp, seed)
--data[ivm] = node["air"]
end
in_cave
=
true
lightmap
[
ivm
]
=
0
elseif
cave_lining
and
cave
[
index3d
]
^
2
>
(
biome
==
"underground"
and
0
.
4
or
1
.
2
-
math.sin
(
fdy
/
(
half_pod
.
y
*
0
.
2
)))
then
data
[
ivm
]
=
node
[
cave_lining
]
lightmap
[
ivm
]
=
0
elseif
fdy
>
height
+
ground
-
depth_top
then
data
[
ivm
]
=
node
[
node_top
]
lightmap
[
ivm
]
=
0
in_cave
=
false
elseif
fdy
>
height
+
ground
-
depth_filler
-
depth_top
then
data
[
ivm
]
=
node
[
node_filler
]
lightmap
[
ivm
]
=
0
in_cave
=
false
else
data
[
ivm
]
=
node
[
node_stone
]
...
...
@@ -461,7 +450,6 @@ local function generate(p_minp, p_maxp, seed)
elseif
in_cave
and
not
(
ocean
or
swamp
or
beach
)
and
node_stone
==
"default:ice"
and
math.random
(
10
)
==
1
then
data
[
ivm
-
a
.
ystride
]
=
node
[
"loud_walking:icicle_down"
]
end
lightmap
[
ivm
]
=
0
in_cave
=
false
end
...
...
@@ -590,7 +578,7 @@ local function generate(p_minp, p_maxp, seed)
vm
:
set_data
(
data
)
minetest
.
generate_ores
(
vm
,
minp
,
maxp
)
--vm:set_param2_data(p2data)
vm
:
set_light
_data
(
light
map
)
vm
:
set_light
ing
({
day
=
0
,
night
=
0
},
minp
,
ma
x
p
)
vm
:
update_liquids
()
vm
:
calc_lighting
(
minp
,
maxp
,
false
)
vm
:
write_to_map
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment