From 09fda4ffaa88ec5931aebc45c649cf808efbd813 Mon Sep 17 00:00:00 2001 From: Blockhead Date: Sun, 15 Mar 2020 21:41:53 +1100 Subject: Add 45 degree diagonal platforms with a mesh --- advtrains/misc_nodes.lua | 29 +++++++++++++++++++++++++ advtrains/models/advtrains_platform_diag.b3d | Bin 0 -> 1970 bytes advtrains/textures/advtrains_platform_diag.png | Bin 0 -> 93 bytes 3 files changed, 29 insertions(+) create mode 100644 advtrains/models/advtrains_platform_diag.b3d create mode 100644 advtrains/textures/advtrains_platform_diag.png diff --git a/advtrains/misc_nodes.lua b/advtrains/misc_nodes.lua index 85fb0ef..2638282 100644 --- a/advtrains/misc_nodes.lua +++ b/advtrains/misc_nodes.lua @@ -46,6 +46,28 @@ function advtrains.register_platform(modprefix, preset) paramtype = "light", sunlight_propagates = true, }) + local diagonalbox = { + type = "fixed", + fixed = { + {-0.5, -0.5, 0.5, -0.25, 0.5, -0.8 }, + {-0.25, -0.5, 0.5 , 0, 0.5, -0.55}, + {0, -0.5, 0.5 , 0.25, 0.5, -0.3 }, + {0.25 , -0.5, 0.5, 0.5, 0.5, -0.05} + } + } + minetest.register_node(modprefix..":platform_45_"..nodename, { + description = attrans("@1 Platform (45 degree)", desc), + groups = {cracky = 1, not_blocking_trains = 1, platform=2}, + sounds = default.node_sound_stone_defaults(), + drawtype = "mesh", + mesh = "advtrains_platform_diag.b3d", + selection_box = diagonalbox, + collision_box = diagonalbox, + tiles = {btex, btex.."^advtrains_platform_diag.png"}, + paramtype2 = "facedir", + paramtype = "light", + sunlight_propagates = true, + }) minetest.register_craft({ type="shapeless", output = modprefix .. ":platform_high_"..nodename.." 4", @@ -60,6 +82,13 @@ function advtrains.register_platform(modprefix, preset) "dye:yellow", preset }, }) + minetest.register_craft({ + type="shapeless", + output = modprefix .. ":platform_45_"..nodename.." 2", + recipe = { + "dye:yellow", preset, preset, preset + } + }) end diff --git a/advtrains/models/advtrains_platform_diag.b3d b/advtrains/models/advtrains_platform_diag.b3d new file mode 100644 index 0000000..46c8bd9 Binary files /dev/null and b/advtrains/models/advtrains_platform_diag.b3d differ diff --git a/advtrains/textures/advtrains_platform_diag.png b/advtrains/textures/advtrains_platform_diag.png new file mode 100644 index 0000000..6e262e2 Binary files /dev/null and b/advtrains/textures/advtrains_platform_diag.png differ -- cgit v1.2.3 From 301dcf953e9a73d0e92f1a48af141200891f0e55 Mon Sep 17 00:00:00 2001 From: Blockhead Date: Sun, 15 Mar 2020 21:56:42 +1100 Subject: Reduce the profile of the platforms by 0.1 Currently some trains clip the platform (especially E231 modpack), but they won't after the platform edge is moved back slightly. --- advtrains/misc_nodes.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advtrains/misc_nodes.lua b/advtrains/misc_nodes.lua index 2638282..f1fb030 100644 --- a/advtrains/misc_nodes.lua +++ b/advtrains/misc_nodes.lua @@ -38,8 +38,8 @@ function advtrains.register_platform(modprefix, preset) node_box = { type = "fixed", fixed = { - {-0.5, 0.3, -0.1, 0.5, 0.5, 0.5}, - {-0.5, -0.5, 0 , 0.5, 0.3, 0.5} + {-0.5, 0.3, 0, 0.5, 0.5, 0.5}, + {-0.5, -0.5, 0.1 , 0.5, 0.3, 0.5} }, }, paramtype2="facedir", -- cgit v1.2.3