diff options
author | orwell96 <mono96.mml@gmail.com> | 2016-09-12 22:58:18 +0200 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2016-09-12 22:58:18 +0200 |
commit | d3af97b63e92c84f1857483aa49fb677acaff541 (patch) | |
tree | 54efd33e481d188aa2482ba3decbfc440f8765e2 | |
parent | bdfe260780bb318f3fdc9771de51786160ca1e57 (diff) | |
download | advtrains-d3af97b63e92c84f1857483aa49fb677acaff541.tar.gz advtrains-d3af97b63e92c84f1857483aa49fb677acaff541.tar.bz2 advtrains-d3af97b63e92c84f1857483aa49fb677acaff541.zip |
adding a signal.
it is controllable by mesecons and by right click. it does not influence trains
-rw-r--r-- | init.lua | 1 | ||||
-rw-r--r-- | models/advtrains_retrosignal_off.b3d | bin | 0 -> 13093 bytes | |||
-rw-r--r-- | models/advtrains_retrosignal_on.b3d | bin | 0 -> 13093 bytes | |||
-rw-r--r-- | models/blender/mbb/retrosignal.blend | bin | 0 -> 507800 bytes | |||
-rw-r--r-- | models/blender/mbb/retrosignal.blend1 | bin | 0 -> 481276 bytes | |||
-rw-r--r-- | models/blender/mbb/signal2.png | bin | 0 -> 39924 bytes | |||
-rw-r--r-- | signals.lua | 31 | ||||
-rw-r--r-- | textures/advtrains_retrosignal.png | bin | 0 -> 8496 bytes |
8 files changed, 32 insertions, 0 deletions
@@ -22,5 +22,6 @@ dofile(advtrains.modpath.."/pseudoload.lua"); dofile(advtrains.modpath.."/couple.lua"); dofile(advtrains.modpath.."/damage.lua"); +dofile(advtrains.modpath.."/signals.lua"); dofile(advtrains.modpath.."/misc_nodes.lua"); dofile(advtrains.modpath.."/crafting.lua"); diff --git a/models/advtrains_retrosignal_off.b3d b/models/advtrains_retrosignal_off.b3d Binary files differnew file mode 100644 index 0000000..56bf5eb --- /dev/null +++ b/models/advtrains_retrosignal_off.b3d diff --git a/models/advtrains_retrosignal_on.b3d b/models/advtrains_retrosignal_on.b3d Binary files differnew file mode 100644 index 0000000..880c995 --- /dev/null +++ b/models/advtrains_retrosignal_on.b3d diff --git a/models/blender/mbb/retrosignal.blend b/models/blender/mbb/retrosignal.blend Binary files differnew file mode 100644 index 0000000..94af470 --- /dev/null +++ b/models/blender/mbb/retrosignal.blend diff --git a/models/blender/mbb/retrosignal.blend1 b/models/blender/mbb/retrosignal.blend1 Binary files differnew file mode 100644 index 0000000..ff1466c --- /dev/null +++ b/models/blender/mbb/retrosignal.blend1 diff --git a/models/blender/mbb/signal2.png b/models/blender/mbb/signal2.png Binary files differnew file mode 100644 index 0000000..7af4e2d --- /dev/null +++ b/models/blender/mbb/signal2.png diff --git a/signals.lua b/signals.lua new file mode 100644 index 0000000..44fe621 --- /dev/null +++ b/signals.lua @@ -0,0 +1,31 @@ +--advtrains by orwell96 +--signals.lua + +for r,f in pairs({on="off", off="on"}) do + minetest.register_node("advtrains:retrosignal_"..r, { + drawtype = "mesh", + paramtype="light", + paramtype2="facedir", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4}, + }, + mesh = "advtrains_retrosignal_"..r..".b3d", + tiles = {"advtrains_retrosignal.png"}, + description="Lampless Signal ("..r..")", + on_rightclick=switchfunc, + groups = { + choppy=3, + not_blocking_trains=1 + }, + mesecons = {effector = { + action_on = function (pos, node) + minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f, param2 = node.param2}) + end + }}, + on_rightclick=function(pos, node, clicker) + minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f, param2 = node.param2}) + end, + }) +end diff --git a/textures/advtrains_retrosignal.png b/textures/advtrains_retrosignal.png Binary files differnew file mode 100644 index 0000000..141198d --- /dev/null +++ b/textures/advtrains_retrosignal.png |