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
c437d102
Commit
c437d102
authored
8 years ago
by
Duane Robertson
Browse files
Options
Downloads
Patches
Plain Diff
Lighting work. No good news.
parent
9928eb7b
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
mapgen.lua
+6
-3
6 additions, 3 deletions
mapgen.lua
nodes.lua
+4
-0
4 additions, 0 deletions
nodes.lua
with
10 additions
and
3 deletions
mapgen.lua
+
6
−
3
View file @
c437d102
...
...
@@ -142,7 +142,8 @@ end
local
pod_size
=
{
x
=
300
,
y
=
100
,
z
=
200
}
local
half_pod
=
{
x
=
math_floor
(
pod_size
.
x
/
2
),
y
=
math_floor
(
pod_size
.
y
/
2
),
z
=
math_floor
(
pod_size
.
z
/
2
)}
local
bridge_size
=
50
local
fcsize
=
{
x
=
pod_size
.
x
+
bridge_size
,
y
=
pod_size
.
y
+
bridge_size
,
z
=
pod_size
.
z
+
bridge_size
}
local
vert_sep
=
250
local
fcsize
=
{
x
=
pod_size
.
x
+
bridge_size
,
y
=
pod_size
.
y
+
vert_sep
,
z
=
pod_size
.
z
+
bridge_size
}
local
bevel
=
half_pod
.
y
local
room_size
=
20
local
control_off
=
math_floor
(
room_size
/
4
)
...
...
@@ -189,6 +190,7 @@ 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
...
...
@@ -281,7 +283,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
=
15
,
night
=
0
},
minp
,
maxp
)
--
vm:set_lighting({day =
0
, night = 0}, minp, maxp)
lightmap
=
vm
:
get_light_data
()
local
ground
=
half_pod
.
y
...
...
@@ -313,6 +315,7 @@ 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
...
...
@@ -437,7 +440,7 @@ local function generate(p_minp, p_maxp, seed)
--data[ivm] = node["air"]
end
in_cave
=
true
--
lightmap[ivm] = 0
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
...
...
This diff is collapsed.
Click to expand it.
nodes.lua
+
4
−
0
View file @
c437d102
...
...
@@ -40,6 +40,10 @@ node = loud_walking.clone_node("loud_walking:sky_scrith")
node
.
tiles
=
{
"loud_walking_glass_detail.png"
}
minetest
.
register_node
(
"loud_walking:transparent_scrith"
,
node
)
node
=
loud_walking
.
clone_node
(
"air"
)
node
.
light_source
=
15
minetest
.
register_node
(
"loud_walking:light_air"
,
node
)
minetest
.
register_node
(
"loud_walking:control_floor"
,
{
description
=
"Floor"
,
paramtype
=
"light"
,
...
...
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