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
d9a2d026
Commit
d9a2d026
authored
9 years ago
by
Duane Robertson
Browse files
Options
Downloads
Patches
Plain Diff
Add control complexes and air ladders.
parent
74734f93
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mapgen.lua
+32
-12
32 additions, 12 deletions
mapgen.lua
nodes.lua
+18
-0
18 additions, 0 deletions
nodes.lua
textures/loud_walking_air_ladder.png
+0
-0
0 additions, 0 deletions
textures/loud_walking_air_ladder.png
with
50 additions
and
12 deletions
mapgen.lua
+
32
−
12
View file @
d9a2d026
...
...
@@ -72,6 +72,7 @@ do
biome_names
[
rarity
][
#
biome_names
[
rarity
]
+
1
]
=
biome
.
name
end
end
biomes
[
"control"
]
=
{}
local
cave_stones
=
{
"loud_walking:stone_with_moss"
,
...
...
@@ -175,6 +176,7 @@ end
local
function
get_height
(
dx
,
dz
,
terrain_scale
,
ocean
,
index
)
local
terr
local
half
=
math.floor
(
csize
.
y
/
2
+
0
.
5
)
terrain_scale
=
terrain_scale
or
1
--if index == true then
-- terr = minetest.get_perlin(terrain_noise):get2d({x=dx, y=dz})
...
...
@@ -203,14 +205,17 @@ local function get_height(dx, dz, terrain_scale, ocean, index)
end
local
function
get_biome
(
px
,
pz
)
local
sr
=
math.random
(
5
)
local
rarity
=
"common"
if
sr
>
4
then
rarity
=
"uncommon"
if
px
%
10
==
6
and
pz
%
10
==
6
then
return
"control"
else
local
sr
=
math.random
(
5
)
local
rarity
=
"common"
if
sr
>
4
then
rarity
=
"uncommon"
end
local
biome
=
biome_names
[
rarity
][
math.random
(
#
biome_names
[
rarity
])]
return
biome
end
local
biome
=
biome_names
[
rarity
][
math.random
(
#
biome_names
[
rarity
])]
return
biome
--return "savanna"
end
local
function
get_decoration
(
biome
)
...
...
@@ -234,8 +239,6 @@ function loud_walking.generate(p_minp, p_maxp, seed)
minp
,
maxp
=
p_minp
,
p_maxp
vm
,
emin
,
emax
=
minetest
.
get_mapgen_object
(
"voxelmanip"
)
vm
:
get_data
(
data
)
vm
:
set_lighting
({
day
=
15
,
night
=
0
},
minp
,
maxp
)
lightmap
=
vm
:
get_light_data
()
--p2data = vm:get_param2_data()
a
=
VoxelArea
:
new
({
MinEdge
=
emin
,
MaxEdge
=
emax
})
csize
=
vector
.
add
(
vector
.
subtract
(
maxp
,
minp
),
1
)
...
...
@@ -262,6 +265,10 @@ function loud_walking.generate(p_minp, p_maxp, seed)
cave_lining
=
nil
end
print
(
biome
)
vm
:
set_lighting
({
day
=
15
,
night
=
(
biome
==
"control"
and
15
or
0
)},
minp
,
maxp
)
lightmap
=
vm
:
get_light_data
()
local
node_top
=
biomes
[
biome
].
node_top
or
"default:dirt_with_grass"
local
node_filler
=
biomes
[
biome
].
node_filler
or
"default:dirt"
local
node_water_top
=
biomes
[
biome
].
node_water_top
or
"default:water_source"
...
...
@@ -311,7 +318,9 @@ function loud_walking.generate(p_minp, p_maxp, seed)
for
y
=
minp
.
y
,
maxp
.
y
do
local
dy
=
y
-
minp
.
y
if
pod
then
if
math.min
(
dx
,
csize
.
x
-
dx
)
+
math.min
(
dy
,
csize
.
y
-
dy
)
+
math.min
(
dz
,
csize
.
z
-
dz
)
<
bevel
then
if
biome
==
"control"
and
math.abs
(
dx
-
half
)
<
3
and
math.abs
(
dz
-
half
)
<
3
then
data
[
ivm
]
=
node
(
"loud_walking:air_ladder"
)
elseif
math.min
(
dx
,
csize
.
x
-
dx
)
+
math.min
(
dy
,
csize
.
y
-
dy
)
+
math.min
(
dz
,
csize
.
z
-
dz
)
<
bevel
then
data
[
ivm
]
=
node
(
"air"
)
lightmap
[
ivm
]
=
0
in_cave
=
false
...
...
@@ -319,7 +328,9 @@ function loud_walking.generate(p_minp, p_maxp, seed)
if
math.abs
(
dy
-
half
-
2
)
<
2
and
(
dz
==
half
or
dx
==
half
)
then
data
[
ivm
]
=
node
(
"air"
)
else
if
biome
~=
"underground"
and
dy
<
half
then
if
biome
==
"control"
then
data
[
ivm
]
=
node
(
glass
[
3
])
elseif
biome
~=
"underground"
and
dy
<
half
then
data
[
ivm
]
=
node
(
"loud_walking:scrith"
)
lightmap
[
ivm
]
=
0
elseif
dy
==
csize
.
y
-
1
then
...
...
@@ -329,6 +340,14 @@ function loud_walking.generate(p_minp, p_maxp, seed)
end
end
in_cave
=
false
elseif
biome
==
"control"
and
dy
%
5
==
0
then
data
[
ivm
]
=
node
(
"default:steelblock"
)
elseif
biome
==
"control"
and
(
math.abs
(
dx
-
half
)
<
3
or
math.abs
(
dz
-
half
)
<
3
)
then
data
[
ivm
]
=
node
(
"air"
)
elseif
biome
==
"control"
and
((
math.abs
(
dx
-
half
)
%
20
==
3
and
(
math.abs
(
dz
-
half
)
-
12
)
%
20
>
3
)
or
(
math.abs
(
dz
-
half
)
%
20
==
3
and
(
math.abs
(
dx
-
half
)
-
12
)
%
20
>
3
))
then
data
[
ivm
]
=
node
(
"default:steelblock"
)
elseif
biome
==
"control"
then
--
elseif
(((
dx
==
35
or
dx
==
45
)
and
dz
>=
35
and
dz
<=
45
)
or
((
dz
==
35
or
dz
==
45
)
and
dx
>=
35
and
dx
<=
45
))
and
dx
~=
40
and
dz
~=
40
and
dy
==
csize
.
y
-
2
then
data
[
ivm
]
=
node
(
"loud_walking:controls"
)
elseif
(((
dx
==
35
or
dx
==
45
)
and
dz
>=
35
and
dz
<=
45
)
or
((
dz
==
35
or
dz
==
45
)
and
dx
>=
35
and
dx
<=
45
))
and
dx
~=
40
and
dz
~=
40
and
dy
>
csize
.
y
-
5
then
...
...
@@ -410,6 +429,8 @@ function loud_walking.generate(p_minp, p_maxp, seed)
lightmap
[
ivm
]
=
0
in_cave
=
false
end
elseif
biome
==
"control"
and
math.abs
(
dx
-
half
)
<
3
and
math.abs
(
dz
-
half
)
<
3
then
data
[
ivm
]
=
node
(
"loud_walking:air_ladder"
)
elseif
connection
and
dy
==
half
and
((
dx
==
half
and
connection
%
4
==
0
)
or
(
dz
==
half
and
connection
%
2
==
1
))
then
data
[
ivm
]
=
node
(
"loud_walking:scrith"
)
lightmap
[
ivm
]
=
0
...
...
@@ -425,7 +446,6 @@ function loud_walking.generate(p_minp, p_maxp, seed)
end
if
pod
then
print
(
biome
)
for
dz
=
0
,
75
,
5
do
for
dx
=
0
,
75
,
5
do
if
biomes
[
biome
].
special_tree_prob
and
math.random
(
biomes
[
biome
].
special_tree_prob
)
==
1
then
...
...
This diff is collapsed.
Click to expand it.
nodes.lua
+
18
−
0
View file @
d9a2d026
...
...
@@ -173,3 +173,21 @@ end
register_flower
(
"orchid"
,
"Orchid"
,
{
"rainforest"
,
"rainforest_swamp"
},
0
.
025
)
register_flower
(
"bird_of_paradise"
,
"Bird of Paradise"
,
{
"rainforest"
,
"desertstone_grassland"
},
0
.
025
)
register_flower
(
"gerbera"
,
"Gerbera"
,
{
"savanna"
,
"rainforest"
,
"desertstone_grassland"
},
0
.
005
)
minetest
.
register_node
(
"loud_walking:air_ladder"
,
{
description
=
"Air Ladder"
,
drawtype
=
"glasslike"
,
tiles
=
{
"loud_walking_air_ladder.png"
},
paramtype
=
"light"
,
sunlight_propagates
=
true
,
walkable
=
false
,
use_texture_alpha
=
true
,
climbable
=
true
,
is_ground_content
=
false
,
selection_box
=
{
type
=
"fixed"
,
fixed
=
{
0
,
0
,
0
,
0
,
0
,
0
},
},
})
This diff is collapsed.
Click to expand it.
textures/loud_walking_air_ladder.png
0 → 100644
+
0
−
0
View file @
d9a2d026
2.09 KiB
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