From 5733785f3f467b4e279296357e536e8fb267e228 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 5 Feb 2021 14:08:39 -0600 Subject: Add conducting rails --- README | 9 ++ init.lua | 131 +++++++++++++++++++++ textures/mesecons_carts_digi_cond_crossing.png | Bin 0 -> 6791 bytes textures/mesecons_carts_digi_cond_curve.png | Bin 0 -> 6637 bytes textures/mesecons_carts_digi_cond_straight.png | Bin 0 -> 6753 bytes textures/mesecons_carts_digi_cond_tjunction.png | Bin 0 -> 6957 bytes textures/mesecons_carts_mese_cond_off_crossing.png | Bin 0 -> 6587 bytes textures/mesecons_carts_mese_cond_off_curve.png | Bin 0 -> 6403 bytes textures/mesecons_carts_mese_cond_off_straight.png | Bin 0 -> 6543 bytes .../mesecons_carts_mese_cond_off_tjunction.png | Bin 0 -> 6730 bytes textures/mesecons_carts_mese_cond_on_crossing.png | Bin 0 -> 6782 bytes textures/mesecons_carts_mese_cond_on_curve.png | Bin 0 -> 6664 bytes textures/mesecons_carts_mese_cond_on_straight.png | Bin 0 -> 6748 bytes textures/mesecons_carts_mese_cond_on_tjunction.png | Bin 0 -> 6951 bytes .../mesecons_carts_mese_digi_cond_off_crossing.png | Bin 0 -> 6907 bytes .../mesecons_carts_mese_digi_cond_off_curve.png | Bin 0 -> 6736 bytes .../mesecons_carts_mese_digi_cond_off_straight.png | Bin 0 -> 6837 bytes ...mesecons_carts_mese_digi_cond_off_tjunction.png | Bin 0 -> 7017 bytes .../mesecons_carts_mese_digi_cond_on_crossing.png | Bin 0 -> 7132 bytes .../mesecons_carts_mese_digi_cond_on_curve.png | Bin 0 -> 6929 bytes .../mesecons_carts_mese_digi_cond_on_straight.png | Bin 0 -> 6936 bytes .../mesecons_carts_mese_digi_cond_on_tjunction.png | Bin 0 -> 7202 bytes 22 files changed, 140 insertions(+) create mode 100644 textures/mesecons_carts_digi_cond_crossing.png create mode 100644 textures/mesecons_carts_digi_cond_curve.png create mode 100644 textures/mesecons_carts_digi_cond_straight.png create mode 100644 textures/mesecons_carts_digi_cond_tjunction.png create mode 100644 textures/mesecons_carts_mese_cond_off_crossing.png create mode 100644 textures/mesecons_carts_mese_cond_off_curve.png create mode 100644 textures/mesecons_carts_mese_cond_off_straight.png create mode 100644 textures/mesecons_carts_mese_cond_off_tjunction.png create mode 100644 textures/mesecons_carts_mese_cond_on_crossing.png create mode 100644 textures/mesecons_carts_mese_cond_on_curve.png create mode 100644 textures/mesecons_carts_mese_cond_on_straight.png create mode 100644 textures/mesecons_carts_mese_cond_on_tjunction.png create mode 100644 textures/mesecons_carts_mese_digi_cond_off_crossing.png create mode 100644 textures/mesecons_carts_mese_digi_cond_off_curve.png create mode 100644 textures/mesecons_carts_mese_digi_cond_off_straight.png create mode 100644 textures/mesecons_carts_mese_digi_cond_off_tjunction.png create mode 100644 textures/mesecons_carts_mese_digi_cond_on_crossing.png create mode 100644 textures/mesecons_carts_mese_digi_cond_on_curve.png create mode 100644 textures/mesecons_carts_mese_digi_cond_on_straight.png create mode 100644 textures/mesecons_carts_mese_digi_cond_on_tjunction.png diff --git a/README b/README index 6b26c43..53ec1f9 100644 --- a/README +++ b/README @@ -28,6 +28,9 @@ This mod adds several types of rails for use with the existing carts from minete -- When powered via mesecons while the cart is still stopped on it, causes the cart to resume moving with its previous speed. -- If left powered, acts as a normal rail. +* Mesecons Conducting Rail +-- Acts as a normal rail (does not specially affect the cart) but conducts mesecons signals. + * Digilines Controlled Rail (available only if digilines is installed) -- Sends a table on its set channel when passed over by a cart, including the following elements: ---- pos: Exact position of the cart @@ -39,3 +42,9 @@ This mod adds several types of rails for use with the existing carts from minete ---- "power1" through "power15": Causes the rail to act as a powered rail. The power of a normal powered rail is 5. ---- "brake1" through "brake15": Causes the rail to act as a brake rail. The power of a normal brake rail is 5. ---- "idle" (also "power0" or "brake0"): Causes the rail to act as a normal rail, applying no power or braking force. + +* Digilines Conducting Rail (available only if digilines is installed) +-- Acts as a normal rail (does not specially affect the cart) but conducts digilines signals. + +* Mesecons and Digilines Conducting Rail (available only if digilines is installed) +-- Acts as a normal rail (does not specially affect the cart) but conducts both mesecons and digilines signals. diff --git a/init.lua b/init.lua index 324e451..fae5faf 100644 --- a/init.lua +++ b/init.lua @@ -10,6 +10,45 @@ local mesecons_rules = { {x = 0,y = -1,z = 0,}, } +carts:register_rail("mesecons_carts:mese_cond_rail_off", { + description = "Mesecons Conducting Rail", + tiles = { + "mesecons_carts_mese_cond_off_straight.png", + "mesecons_carts_mese_cond_off_curve.png", + "mesecons_carts_mese_cond_off_tjunction.png", + "mesecons_carts_mese_cond_off_crossing.png", + }, + groups = carts:get_rail_groups(), + mesecons = { + conductor = { + rules = mesecons_rules, + state = mesecon.state.off, + onstate = "mesecons_carts:mese_cond_rail_on", + offstate = "mesecons_carts:mese_cond_rail_off", + }, + }, +}, {}) + +carts:register_rail("mesecons_carts:mese_cond_rail_on", { + description = "Mesecons Conducting Rail (on state - you hacker you!)", + tiles = { + "mesecons_carts_mese_cond_on_straight.png", + "mesecons_carts_mese_cond_on_curve.png", + "mesecons_carts_mese_cond_on_tjunction.png", + "mesecons_carts_mese_cond_on_crossing.png", + }, + drop = "mesecons_carts:mese_cond_rail_off", + groups = carts:get_rail_groups({not_in_creative_inventory = 1,}), + mesecons = { + conductor = { + rules = mesecons_rules, + state = mesecon.state.on, + onstate = "mesecons_carts:mese_cond_rail_on", + offstate = "mesecons_carts:mese_cond_rail_off", + }, + }, +}, {}) + carts:register_rail("mesecons_carts:power_rail_off", { description = "Mesecons-Controlled Powered Rail", tiles = { @@ -361,6 +400,15 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "mesecons_carts:mese_cond_rail_off 6", + recipe = { + {"carts:rail","mesecons:wire_00000000_off","carts:rail",}, + {"carts:rail","mesecons:wire_00000000_off","carts:rail",}, + {"carts:rail","mesecons:wire_00000000_off","carts:rail",}, + }, +}) + if minetest.get_modpath("digilines") then local digilines_rules = { {x = 1,y = 0,z = 0,}, @@ -379,6 +427,71 @@ if minetest.get_modpath("digilines") then {x = 0,y = 1,z = 0,}, } + carts:register_rail("mesecons_carts:mese_digi_cond_rail_off", { + description = "Mesecons and Digilines Conducting Rail", + tiles = { + "mesecons_carts_mese_digi_cond_off_straight.png", + "mesecons_carts_mese_digi_cond_off_curve.png", + "mesecons_carts_mese_digi_cond_off_tjunction.png", + "mesecons_carts_mese_digi_cond_off_crossing.png", + }, + groups = carts:get_rail_groups(), + mesecons = { + conductor = { + rules = mesecons_rules, + state = mesecon.state.off, + onstate = "mesecons_carts:mese_digi_cond_rail_on", + offstate = "mesecons_carts:mese_digi_cond_rail_off", + }, + }, + digiline = { + wire = { + rules = digilines_rules, + }, + }, + }, {}) + + carts:register_rail("mesecons_carts:mese_digi_cond_rail_on", { + description = "Mesecons and Digilines Conducting Rail (on state - you hacker you!)", + tiles = { + "mesecons_carts_mese_digi_cond_on_straight.png", + "mesecons_carts_mese_digi_cond_on_curve.png", + "mesecons_carts_mese_digi_cond_on_tjunction.png", + "mesecons_carts_mese_digi_cond_on_crossing.png", + }, + drop = "mesecons_carts:mese_digi_cond_rail_off", + groups = carts:get_rail_groups({not_in_creative_inventory = 1,}), + mesecons = { + conductor = { + rules = mesecons_rules, + state = mesecon.state.on, + onstate = "mesecons_carts:mese_digi_cond_rail_on", + offstate = "mesecons_carts:mese_digi_cond_rail_off", + }, + }, + digiline = { + wire = { + rules = digilines_rules, + }, + }, + }, {}) + + carts:register_rail("mesecons_carts:digi_cond_rail", { + description = "Digilines Conducting Rail", + tiles = { + "mesecons_carts_digi_cond_straight.png", + "mesecons_carts_digi_cond_curve.png", + "mesecons_carts_digi_cond_tjunction.png", + "mesecons_carts_digi_cond_crossing.png", + }, + groups = carts:get_rail_groups(), + digiline = { + wire = { + rules = digilines_rules, + }, + }, + }, {}) + local function digilinesrail_onstep(cart,dtime) local cartpos = cart.object:get_pos() local trackpos = {} @@ -560,4 +673,22 @@ if minetest.get_modpath("digilines") then {"carts:rail","default:sand","",}, }, }) + minetest.register_craft({ + output = "mesecons_carts:digi_cond_rail 6", + recipe = { + {"carts:rail","digilines:wire_std_00000000","carts:rail",}, + {"carts:rail","digilines:wire_std_00000000","carts:rail",}, + {"carts:rail","digilines:wire_std_00000000","carts:rail",}, + }, + }) + minetest.register_craft({ + output = "mesecons_carts:mese_digi_cond_rail_off", + type = "shapeless", + recipe = {"mesecons_carts:mese_cond_rail_off","digilines:wire_std_00000000",}, + }) + minetest.register_craft({ + output = "mesecons_carts:mese_digi_cond_rail_off", + type = "shapeless", + recipe = {"mesecons_carts:digi_cond_rail","mesecons:wire_00000000_off",}, + }) end diff --git a/textures/mesecons_carts_digi_cond_crossing.png b/textures/mesecons_carts_digi_cond_crossing.png new file mode 100644 index 0000000..08ec3d7 Binary files /dev/null and b/textures/mesecons_carts_digi_cond_crossing.png differ diff --git a/textures/mesecons_carts_digi_cond_curve.png b/textures/mesecons_carts_digi_cond_curve.png new file mode 100644 index 0000000..f5ccd5a Binary files /dev/null and b/textures/mesecons_carts_digi_cond_curve.png differ diff --git a/textures/mesecons_carts_digi_cond_straight.png b/textures/mesecons_carts_digi_cond_straight.png new file mode 100644 index 0000000..f6bcd1c Binary files /dev/null and b/textures/mesecons_carts_digi_cond_straight.png differ diff --git a/textures/mesecons_carts_digi_cond_tjunction.png b/textures/mesecons_carts_digi_cond_tjunction.png new file mode 100644 index 0000000..c2b3974 Binary files /dev/null and b/textures/mesecons_carts_digi_cond_tjunction.png differ diff --git a/textures/mesecons_carts_mese_cond_off_crossing.png b/textures/mesecons_carts_mese_cond_off_crossing.png new file mode 100644 index 0000000..4915d3a Binary files /dev/null and b/textures/mesecons_carts_mese_cond_off_crossing.png differ diff --git a/textures/mesecons_carts_mese_cond_off_curve.png b/textures/mesecons_carts_mese_cond_off_curve.png new file mode 100644 index 0000000..6d84517 Binary files /dev/null and b/textures/mesecons_carts_mese_cond_off_curve.png differ diff --git a/textures/mesecons_carts_mese_cond_off_straight.png b/textures/mesecons_carts_mese_cond_off_straight.png new file mode 100644 index 0000000..8f2dd55 Binary files /dev/null and b/textures/mesecons_carts_mese_cond_off_straight.png differ diff --git a/textures/mesecons_carts_mese_cond_off_tjunction.png b/textures/mesecons_carts_mese_cond_off_tjunction.png new file mode 100644 index 0000000..68be295 Binary files /dev/null and b/textures/mesecons_carts_mese_cond_off_tjunction.png differ diff --git a/textures/mesecons_carts_mese_cond_on_crossing.png b/textures/mesecons_carts_mese_cond_on_crossing.png new file mode 100644 index 0000000..4af255e Binary files /dev/null and b/textures/mesecons_carts_mese_cond_on_crossing.png differ diff --git a/textures/mesecons_carts_mese_cond_on_curve.png b/textures/mesecons_carts_mese_cond_on_curve.png new file mode 100644 index 0000000..f074bb1 Binary files /dev/null and b/textures/mesecons_carts_mese_cond_on_curve.png differ diff --git a/textures/mesecons_carts_mese_cond_on_straight.png b/textures/mesecons_carts_mese_cond_on_straight.png new file mode 100644 index 0000000..623065d Binary files /dev/null and b/textures/mesecons_carts_mese_cond_on_straight.png differ diff --git a/textures/mesecons_carts_mese_cond_on_tjunction.png b/textures/mesecons_carts_mese_cond_on_tjunction.png new file mode 100644 index 0000000..03571c8 Binary files /dev/null and b/textures/mesecons_carts_mese_cond_on_tjunction.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_off_crossing.png b/textures/mesecons_carts_mese_digi_cond_off_crossing.png new file mode 100644 index 0000000..8ab3c10 Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_off_crossing.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_off_curve.png b/textures/mesecons_carts_mese_digi_cond_off_curve.png new file mode 100644 index 0000000..741344e Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_off_curve.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_off_straight.png b/textures/mesecons_carts_mese_digi_cond_off_straight.png new file mode 100644 index 0000000..173b781 Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_off_straight.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_off_tjunction.png b/textures/mesecons_carts_mese_digi_cond_off_tjunction.png new file mode 100644 index 0000000..f337fe9 Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_off_tjunction.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_on_crossing.png b/textures/mesecons_carts_mese_digi_cond_on_crossing.png new file mode 100644 index 0000000..579cf90 Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_on_crossing.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_on_curve.png b/textures/mesecons_carts_mese_digi_cond_on_curve.png new file mode 100644 index 0000000..81ef9be Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_on_curve.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_on_straight.png b/textures/mesecons_carts_mese_digi_cond_on_straight.png new file mode 100644 index 0000000..f5ceb2b Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_on_straight.png differ diff --git a/textures/mesecons_carts_mese_digi_cond_on_tjunction.png b/textures/mesecons_carts_mese_digi_cond_on_tjunction.png new file mode 100644 index 0000000..d4fe7a4 Binary files /dev/null and b/textures/mesecons_carts_mese_digi_cond_on_tjunction.png differ -- cgit v1.2.3