summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2021-02-05 14:08:39 -0600
committercheapie <no-email-for-you@example.com>2021-02-05 14:08:39 -0600
commit5733785f3f467b4e279296357e536e8fb267e228 (patch)
tree0b869305118cceffcf1716741744e9749ce1732e
parent5283abb6f3a2ad19237271ad951b0df593301cdf (diff)
downloadmesecons_carts-5733785f3f467b4e279296357e536e8fb267e228.tar
mesecons_carts-5733785f3f467b4e279296357e536e8fb267e228.tar.gz
mesecons_carts-5733785f3f467b4e279296357e536e8fb267e228.tar.bz2
mesecons_carts-5733785f3f467b4e279296357e536e8fb267e228.tar.xz
mesecons_carts-5733785f3f467b4e279296357e536e8fb267e228.zip
Add conducting rails
-rw-r--r--README9
-rw-r--r--init.lua131
-rw-r--r--textures/mesecons_carts_digi_cond_crossing.pngbin0 -> 6791 bytes
-rw-r--r--textures/mesecons_carts_digi_cond_curve.pngbin0 -> 6637 bytes
-rw-r--r--textures/mesecons_carts_digi_cond_straight.pngbin0 -> 6753 bytes
-rw-r--r--textures/mesecons_carts_digi_cond_tjunction.pngbin0 -> 6957 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_off_crossing.pngbin0 -> 6587 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_off_curve.pngbin0 -> 6403 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_off_straight.pngbin0 -> 6543 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_off_tjunction.pngbin0 -> 6730 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_on_crossing.pngbin0 -> 6782 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_on_curve.pngbin0 -> 6664 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_on_straight.pngbin0 -> 6748 bytes
-rw-r--r--textures/mesecons_carts_mese_cond_on_tjunction.pngbin0 -> 6951 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_off_crossing.pngbin0 -> 6907 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_off_curve.pngbin0 -> 6736 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_off_straight.pngbin0 -> 6837 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_off_tjunction.pngbin0 -> 7017 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_on_crossing.pngbin0 -> 7132 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_on_curve.pngbin0 -> 6929 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_on_straight.pngbin0 -> 6936 bytes
-rw-r--r--textures/mesecons_carts_mese_digi_cond_on_tjunction.pngbin0 -> 7202 bytes
22 files changed, 140 insertions, 0 deletions
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
--- /dev/null
+++ b/textures/mesecons_carts_digi_cond_crossing.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_digi_cond_curve.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_digi_cond_straight.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_digi_cond_tjunction.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_off_crossing.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_off_curve.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_off_straight.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_off_tjunction.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_on_crossing.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_on_curve.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_on_straight.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_cond_on_tjunction.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_off_crossing.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_off_curve.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_off_straight.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_off_tjunction.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_on_crossing.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_on_curve.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_on_straight.png
Binary files 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
--- /dev/null
+++ b/textures/mesecons_carts_mese_digi_cond_on_tjunction.png
Binary files differ