Add the intro cutscene, a start to the map, and various other things.

This commit is contained in:
Signal 2025-11-16 02:48:08 -05:00
parent d0c0a3ebb6
commit 1b2199705b
46 changed files with 1401 additions and 91 deletions

View file

@ -7,8 +7,9 @@ function artifact.register_node(name, def)
if not name:find ":" then
name = "artifact:"..name
end
-- We might need to add groups below.
if not def.groups then def.groups = {} end
if artifact.debug then
if not def.groups then def.groups = {} end
def.groups.dig_immediate = 3
end
if def._variants then
@ -99,6 +100,49 @@ local function rep(tx, size)
return out
end
-- These nodes are only used for the intro cutscene.
artifact.register_node("stone_brown", {
tiles = {{name = "artifact_stone_brown.png", align_style = "world"}},
_variants = {"stair", "slab"}
})
artifact.register_node("stone_tile_brown", {
tiles = {{name = "artifact_stone_tile_brown.png", align_style = "world"}},
_variants = {"stair", "slab"}
})
artifact.register_node("stone_bricks_brown", {
tiles = {{name = "artifact_stone_bricks_brown.png", align_style = "world"}},
_variants = {"stair", "slab"}
})
artifact.register_node("torch", {
drawtype = "mesh",
paramtype2 = "facedir",
mesh = "artifact_torch.obj",
tiles = {"artifact_torch.png"},
use_texture_alpha = "clip",
light_source = 10,
paramtype = "light",
sunlight_propagates = true
})
artifact.register_node("torch_standing", {
drawtype = "mesh",
paramtype2 = "facedir",
mesh = "artifact_torch_standing.obj",
tiles = {"artifact_torch.png"},
use_texture_alpha = "clip",
light_source = 10,
paramtype = "light",
sunlight_propagates = true
})
-- End ad-hoc nodes.
artifact.register_node("stone", {
tiles = {{name = "artifact_stone.png", align_style = "world"}},
_variants = {"stair", "slab"}
@ -132,6 +176,70 @@ artifact.register_node("stone_tile_small", {
_variants = {"stair", "slab"},
})
-- Why does making this texture a tile animation darken it!?
artifact.register_node("water", {
tiles = {{name = "artifact_water_source.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 6}}},
drawtype = "liquid",
use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = artifact.debug,
liquid_move_physics = true,
post_effect_color = "#2d5a7c55",
liquidtype = "source",
-- Minetest pro tip: Do not try to use aliases for these.
liquid_alternative_source = "artifact:water",
liquid_alternative_flowing = "artifact:water_flowing",
liquid_viscosity = 1,
liquid_range = 5,
})
artifact.register_node("water_flowing", {
tiles = {{name = "artifact_water_flowing.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.5}}},
special_tiles = {
{name = "artifact_water_flowing.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.5}},
{name = "artifact_water_flowing.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.5}}
},
drawtype = "flowingliquid",
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = artifact.debug,
buildable_to = true,
liquid_move_physics = true,
post_effect_color = "#2d5a7c55",
drop = "",
liquidtype = "flowing",
liquid_alternative_source = "artifact:water",
liquid_alternative_flowing = "artifact:water_flowing",
liquid_viscosity = 1,
liquid_range = 5,
})
-- Minetest doesn't properly handle having a custom nodebox on a liquid source, so we do this the hacky way.
artifact.register_node("water_static", {
tiles = {{name = "artifact_water_source.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 6}}},
drawtype = "nodebox",
node_box = {
type = "leveled",
fixed = {
-0.5, -0.5, -0.5,
0.5, 6/16, 0.5
}
},
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "leveled",
place_param2 = 60,
walkable = false,
pointable = artifact.debug,
liquid_move_physics = true,
post_effect_color = "#2d5a7c55",
})
artifact.register_node("vines", {
drawtype = "nodebox",
@ -249,12 +357,12 @@ artifact.register_node("light", {
-- Make darkness the default.
minetest.override_item("air", {
sunlight_propagates = false,
light_source = 2
light_source = 2 -- But not _too_ much darkness...
})
if artifact.debug then
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen.lua")
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen_debug.lua")
minetest.register_decoration {
deco_type = "simple",
@ -262,5 +370,6 @@ if artifact.debug then
place_on = "stone",
fill_ratio = 0.02,
}
else
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen.lua")
end

View file

@ -1,33 +1,20 @@
local vm_data = {}
local c_stone = minetest.get_content_id("artifact:stone")
local c_chest = minetest.get_content_id("chest_with_everything:chest")
-- Singlenode, but the single node is stone.
-- (Note that this is just the base mapgen; the world itself will
-- be loaded from a schematic on init.)
minetest.register_on_generated(function(vm, minp, maxp)
local min, max = vm:get_emerged_area()
local va = VoxelArea(min, max)
vm:get_data(vm_data)
if maxp.y < 0 then
for i in va:iterp(minp, maxp) do
vm_data[i] = c_stone
end
elseif maxp.y < 50 then
for x = min.x, max.x do
for z = min.z, max.z do
for y = min.y, -1 do
vm_data[va:index(x, y, z)] = c_stone
end
if x == 0 and z == 2 then
vm_data[va:index(x, 0, z)] = c_chest
end
end
end
for i in va:iterp(minp, maxp) do
vm_data[i] = c_stone
end
vm:set_data(vm_data)
minetest.generate_decorations(vm)
vm:calc_lighting()
end)

View file

@ -0,0 +1,33 @@
local vm_data = {}
local c_stone = minetest.get_content_id("artifact:stone")
local c_chest = minetest.get_content_id("chest_with_everything:chest")
minetest.register_on_generated(function(vm, minp, maxp)
local min, max = vm:get_emerged_area()
local va = VoxelArea(min, max)
vm:get_data(vm_data)
if maxp.y < 0 then
for i in va:iterp(minp, maxp) do
vm_data[i] = c_stone
end
elseif maxp.y < 50 then
for x = min.x, max.x do
for z = min.z, max.z do
for y = min.y, -1 do
vm_data[va:index(x, y, z)] = c_stone
end
if x == 0 and z == 2 then
vm_data[va:index(x, 0, z)] = c_chest
end
end
end
end
vm:set_data(vm_data)
minetest.generate_decorations(vm)
vm:calc_lighting()
end)

View file

@ -0,0 +1,187 @@
# Made in Blockbench 4.12.5
mtllib artifact_torch.mtl
o cube
v 0.4111417354376907 0.1185501736953839 0.0625
v 0.4111417354376907 0.1185501736953839 -0.0625
v 0.613156753728018 -0.2695170658200881 0.0625
v 0.613156753728018 -0.2695170658200881 -0.0625
v 0.300265381290413 0.06083159704100469 -0.0625
v 0.300265381290413 0.06083159704100469 0.0625
v 0.5022803995807403 -0.32723564247446735 -0.0625
v 0.5022803995807403 -0.32723564247446735 0.0625
vt 0.25 0.6875
vt 0.3125 0.6875
vt 0.3125 0.46875
vt 0.25 0.46875
vt 0.3125 0.6875
vt 0.375 0.6875
vt 0.375 0.46875
vt 0.3125 0.46875
vt 0.375 1
vt 0.4375 1
vt 0.4375 0.78125
vt 0.375 0.78125
vt 0.375 0.78125
vt 0.4375 0.78125
vt 0.4375 0.5625
vt 0.375 0.5625
vt 0.0625 0.5
vt 0 0.5
vt 0 0.5625
vt 0.0625 0.5625
vt 0.5 1
vt 0.4375 1
vt 0.4375 0.9375
vt 0.5 0.9375
vn 0 0 -1
vn 0.8870108331782217 0.4617486132350339 0
vn 0 0 1
vn -0.8870108331782217 -0.4617486132350339 0
vn -0.4617486132350339 0.8870108331782217 0
vn 0.4617486132350339 -0.8870108331782217 0
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o cube
v 0.43772062418414 0.2028476390962124 0.125
v 0.43772062418414 0.2028476390962124 -0.125
v 0.46657991251132963 0.14740946202257355 0.125
v 0.46657991251132963 0.14740946202257355 -0.125
v 0.21596791588958458 0.08741048578745392 -0.125
v 0.21596791588958458 0.08741048578745392 0.125
v 0.24482720421677417 0.03197230871381507 -0.125
v 0.24482720421677417 0.03197230871381507 0.125
vt 0.0625 0.5625
vt 0.1875 0.5625
vt 0.1875 0.53125
vt 0.0625 0.53125
vt 0.4375 0.9375
vt 0.5625 0.9375
vt 0.5625 0.90625
vt 0.4375 0.90625
vt 0.4375 0.90625
vt 0.5625 0.90625
vt 0.5625 0.875
vt 0.4375 0.875
vt 0.4375 0.875
vt 0.5625 0.875
vt 0.5625 0.84375
vt 0.4375 0.84375
vt 0.125 0.5625
vt 0 0.5625
vt 0 0.6875
vt 0.125 0.6875
vt 0.25 0.6875
vt 0.125 0.6875
vt 0.125 0.5625
vt 0.25 0.5625
vn 0 0 -1
vn 0.8870108331782217 0.4617486132350339 0
vn 0 0 1
vn -0.8870108331782217 -0.4617486132350339 0
vn -0.4617486132350339 0.8870108331782217 0
vn 0.4617486132350339 -0.8870108331782217 0
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o cube
v 0.3001499612370861 0.4835397432391481 0.1325825214724777
v 0.3001499612370861 0.4835397432391481 0.1325825214724777
v 0.44444640287303405 0.20634885787095372 0.13258252147247768
v 0.44444640287303405 0.20634885787095372 0.13258252147247768
v 0.06494569556474239 0.3611001523809069 -0.13258252147247748
v 0.06494569556474239 0.3611001523809069 -0.13258252147247748
v 0.20924213720069035 0.08390926701271256 -0.1325825214724775
v 0.20924213720069035 0.08390926701271256 -0.1325825214724775
vt 0 1
vt 0.1875 1
vt 0.1875 0.84375
vt 0 0.84375
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0 0.84375
vt 0.1875 0.84375
vt 0.1875 0.6875
vt 0 0.6875
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vn 0.6272113751262501 0.32650557562197663 -0.7071067811865476
vn 0.6272113751262504 0.32650557562197663 0.7071067811865475
vn -0.6272113751262501 -0.32650557562197663 0.7071067811865476
vn -0.6272113751262504 -0.32650557562197663 -0.7071067811865475
vn -0.4617486132350336 0.887010833178222 0
vn 0.4617486132350336 -0.887010833178222 0
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o cube
v 0.06494569556474178 0.36110015238090654 0.13258252147247745
v 0.06494569556474178 0.36110015238090654 0.13258252147247745
v 0.20924213720069024 0.08390926701271237 0.13258252147247768
v 0.20924213720069024 0.08390926701271237 0.13258252147247768
v 0.3001499612370855 0.4835397432391479 -0.13258252147247773
v 0.3001499612370855 0.4835397432391479 -0.13258252147247773
v 0.44444640287303394 0.20634885787095378 -0.1325825214724775
v 0.44444640287303394 0.20634885787095378 -0.1325825214724775
vt 0.1875 1
vt 0.375 1
vt 0.375 0.84375
vt 0.1875 0.84375
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0.1875 0.84375
vt 0.375 0.84375
vt 0.375 0.6875
vt 0.1875 0.6875
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vn 0.6272113751262494 0.3265055756219781 0.7071067811865478
vn -0.6272113751262501 -0.32650557562197735 0.7071067811865475
vn -0.6272113751262494 -0.3265055756219781 -0.7071067811865478
vn 0.6272113751262501 0.32650557562197735 -0.7071067811865475
vn -0.4617486132350349 0.8870108331782214 -8.049116928532382e-16
vn 0.4617486132350349 -0.8870108331782214 8.049116928532382e-16
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

View file

@ -0,0 +1,4 @@
# Made in Blockbench 4.12.5
newmtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
map_Kd artifact_torch.png
newmtl none

View file

@ -0,0 +1,187 @@
# Made in Blockbench 4.12.5
mtllib artifact_torch_standing.mtl
o cube
v 0.13013507308001968 0.3059361621615665 0.1325825214724777
v 0.13013507308001968 0.3059361621615665 0.1325825214724777
v 0.13013507308001954 -0.006563837838433541 0.13258252147247768
v 0.13013507308001954 -0.006563837838433541 0.13258252147247768
v -0.13502996986493548 0.3059361621615666 -0.13258252147247745
v -0.13502996986493548 0.3059361621615666 -0.13258252147247745
v -0.13502996986493562 -0.006563837838433416 -0.13258252147247748
v -0.13502996986493562 -0.006563837838433416 -0.13258252147247748
vt 0 1
vt 0.1875 1
vt 0.1875 0.84375
vt 0 0.84375
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0 0.84375
vt 0.1875 0.84375
vt 0.1875 0.6875
vt 0 0.6875
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vn 0.7071067811865476 -2.355138688025663e-16 -0.7071067811865476
vn 0.7071067811865476 -3.9252311467094373e-16 0.7071067811865475
vn -0.7071067811865476 2.355138688025663e-16 0.7071067811865476
vn -0.7071067811865476 3.9252311467094373e-16 -0.7071067811865475
vn 4.710277376051325e-16 1 0
vn -4.710277376051325e-16 -1 0
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o cube
v 0.06005255160754197 -0.0690638378384335 0.0625
v 0.06005255160754197 -0.0690638378384335 -0.0625
v 0.06005255160754197 -0.5065638378384335 0.0625
v 0.06005255160754197 -0.5065638378384335 -0.0625
v -0.06494744839245803 -0.0690638378384335 -0.0625
v -0.06494744839245803 -0.0690638378384335 0.0625
v -0.06494744839245803 -0.5065638378384335 -0.0625
v -0.06494744839245803 -0.5065638378384335 0.0625
vt 0.25 0.6875
vt 0.3125 0.6875
vt 0.3125 0.46875
vt 0.25 0.46875
vt 0.3125 0.6875
vt 0.375 0.6875
vt 0.375 0.46875
vt 0.3125 0.46875
vt 0.375 1
vt 0.4375 1
vt 0.4375 0.78125
vt 0.375 0.78125
vt 0.375 0.78125
vt 0.4375 0.78125
vt 0.4375 0.5625
vt 0.375 0.5625
vt 0.0625 0.5
vt 0 0.5
vt 0 0.5625
vt 0.0625 0.5625
vt 0.5 1
vt 0.4375 1
vt 0.4375 0.9375
vt 0.5 0.9375
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12
o cube
v 0.12255255160754197 -0.006563837838433506 0.125
v 0.12255255160754197 -0.006563837838433506 -0.125
v 0.12255255160754197 -0.0690638378384335 0.125
v 0.12255255160754197 -0.0690638378384335 -0.125
v -0.12744744839245803 -0.006563837838433506 -0.125
v -0.12744744839245803 -0.006563837838433506 0.125
v -0.12744744839245803 -0.0690638378384335 -0.125
v -0.12744744839245803 -0.0690638378384335 0.125
vt 0.0625 0.5625
vt 0.1875 0.5625
vt 0.1875 0.53125
vt 0.0625 0.53125
vt 0.4375 0.9375
vt 0.5625 0.9375
vt 0.5625 0.90625
vt 0.4375 0.90625
vt 0.4375 0.90625
vt 0.5625 0.90625
vt 0.5625 0.875
vt 0.4375 0.875
vt 0.4375 0.875
vt 0.5625 0.875
vt 0.5625 0.84375
vt 0.4375 0.84375
vt 0.125 0.5625
vt 0 0.5625
vt 0 0.6875
vt 0.125 0.6875
vt 0.25 0.6875
vt 0.125 0.6875
vt 0.125 0.5625
vt 0.25 0.5625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 20/52/13 23/51/13 21/50/13 18/49/13
f 19/56/14 20/55/14 18/54/14 17/53/14
f 24/60/15 19/59/15 17/58/15 22/57/15
f 23/64/16 24/63/16 22/62/16 21/61/16
f 22/68/17 17/67/17 18/66/17 21/65/17
f 23/72/18 20/71/18 19/70/18 24/69/18
o cube
v -0.1350299698649363 0.3059361621615665 0.13258252147247745
v -0.1350299698649363 0.3059361621615665 0.13258252147247745
v -0.1350299698649359 -0.00656383783843351 0.13258252147247768
v -0.1350299698649359 -0.00656383783843351 0.13258252147247768
v 0.13013507308001904 0.3059361621615666 -0.1325825214724777
v 0.13013507308001904 0.3059361621615666 -0.1325825214724777
v 0.13013507308001943 -0.006563837838433447 -0.13258252147247748
v 0.13013507308001943 -0.006563837838433447 -0.13258252147247748
vt 0.1875 1
vt 0.375 1
vt 0.375 0.84375
vt 0.1875 0.84375
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0.1875 0.84375
vt 0.375 0.84375
vt 0.375 0.6875
vt 0.1875 0.6875
vt 0 1
vt 0 1
vt 0 0.84375
vt 0 0.84375
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vt 0.1875 1
vt 0 1
vt 0 1
vt 0.1875 1
vn 0.7071067811865475 1.3738309013483032e-15 0.7071067811865478
vn -0.7071067811865478 -3.532708032038497e-16 0.7071067811865475
vn -0.7071067811865475 -1.3738309013483032e-15 -0.7071067811865478
vn 0.7071067811865478 3.532708032038497e-16 -0.7071067811865475
vn -1.099064721078642e-15 1 -8.635508522760762e-16
vn 1.099064721078642e-15 -1 8.635508522760762e-16
usemtl m_e3e69eb0-b6c9-b9c2-690f-4d510df185b2
f 28/76/19 31/75/19 29/74/19 26/73/19
f 27/80/20 28/79/20 26/78/20 25/77/20
f 32/84/21 27/83/21 25/82/21 30/81/21
f 31/88/22 32/87/22 30/86/22 29/85/22
f 30/92/23 25/91/23 26/90/23 29/89/23
f 31/96/24 28/95/24 27/94/24 32/93/24

View file

@ -0,0 +1 @@
{"(45, 21, 52)":{"fields":null,"inventory":null}}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB