From 44dc1a128cd6574b53ae68c33a6d2583eb878087 Mon Sep 17 00:00:00 2001 From: Jeija Date: Sat, 15 Dec 2012 18:45:51 +0100 Subject: Upload cleaned up mesecons to nextgen branch --- mesecons_extrawires/vertical.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mesecons_extrawires') diff --git a/mesecons_extrawires/vertical.lua b/mesecons_extrawires/vertical.lua index 64e6e80..652205d 100644 --- a/mesecons_extrawires/vertical.lua +++ b/mesecons_extrawires/vertical.lua @@ -78,7 +78,7 @@ minetest.register_node("mesecons_extrawires:vertical_on", { walkable = false, paramtype = "light", sunlight_propagates = true, - groups = {dig_immediate = 3}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, selection_box = vbox, node_box = vbox, is_vertical_conductor = true, @@ -118,11 +118,11 @@ minetest.register_node("mesecons_extrawires:vertical_off", { minetest.register_node("mesecons_extrawires:vertical_top_on", { description = "Vertical mesecon", drawtype = "nodebox", - tiles = {"wires_vertical_on.png"}, + tiles = {"wires_full_on.png"}, walkable = false, paramtype = "light", sunlight_propagates = true, - groups = {dig_immediate = 3}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, selection_box = tbox, node_box = tbox, is_vertical_conductor = true, @@ -140,11 +140,11 @@ minetest.register_node("mesecons_extrawires:vertical_top_on", { minetest.register_node("mesecons_extrawires:vertical_top_off", { description = "Vertical mesecon", drawtype = "nodebox", - tiles = {"wires_vertical_off.png"}, + tiles = {"wires_full_off.png"}, walkable = false, paramtype = "light", sunlight_propagates = true, - groups = {dig_immediate = 3}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, selection_box = tbox, node_box = tbox, is_vertical_conductor = true, @@ -163,12 +163,12 @@ minetest.register_node("mesecons_extrawires:vertical_top_off", { minetest.register_node("mesecons_extrawires:vertical_bottom_on", { description = "Vertical mesecon", drawtype = "nodebox", - tiles = {"wires_vertical_on.png"}, + tiles = {"wires_full_on.png"}, walkable = false, paramtype = "light", sunlight_propagates = true, vertical_conductor_state = "on", - groups = {dig_immediate = 3}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, selection_box = bbox, node_box = bbox, mesecons = {conductor = { @@ -184,11 +184,11 @@ minetest.register_node("mesecons_extrawires:vertical_bottom_on", { minetest.register_node("mesecons_extrawires:vertical_bottom_off", { description = "Vertical mesecon", drawtype = "nodebox", - tiles = {"wires_vertical_off.png"}, + tiles = {"wires_full_off.png"}, walkable = false, paramtype = "light", sunlight_propagates = true, - groups = {dig_immediate = 3}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, selection_box = bbox, node_box = bbox, is_vertical_conductor = true, -- cgit v1.2.3 From 34fa8a116702864f295f8858cfbd61dc4085bb3b Mon Sep 17 00:00:00 2001 From: Andres Eduardo Montoya Cruz <> Date: Fri, 21 Dec 2012 20:24:43 -0500 Subject: now the insulated wires change their color when they are turn on --- mesecons_extrawires/crossing.lua | 2 +- mesecons_extrawires/tjunction.lua | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mesecons_extrawires') diff --git a/mesecons_extrawires/crossing.lua b/mesecons_extrawires/crossing.lua index 2b35af1..9b381bf 100644 --- a/mesecons_extrawires/crossing.lua +++ b/mesecons_extrawires/crossing.lua @@ -6,7 +6,7 @@ end minetest.register_node("mesecons_extrawires:crossing_on", { drawtype = "nodebox", - tiles = {"jeija_insulated_wire_sides.png"}, + tiles = {"jeija_insulated_wire_sides_on.png"}, paramtype = "light", walkable = false, stack_max = 99, diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua index cb16cfb..aa100f5 100644 --- a/mesecons_extrawires/tjunction.lua +++ b/mesecons_extrawires/tjunction.lua @@ -28,11 +28,11 @@ end minetest.register_node("mesecons_extrawires:tjunction_on", { drawtype = "nodebox", tiles = { - "jeija_insulated_wire_sides.png", - "jeija_insulated_wire_sides.png", + "jeija_insulated_wire_sides_on.png", + "jeija_insulated_wire_sides_on.png", "jeija_insulated_wire_ends_on.png", "jeija_insulated_wire_ends_on.png", - "jeija_insulated_wire_sides.png", + "jeija_insulated_wire_sides_on.png", "jeija_insulated_wire_ends_on.png" }, paramtype = "light", @@ -55,11 +55,11 @@ minetest.register_node("mesecons_extrawires:tjunction_off", { drawtype = "nodebox", description = "T-junction", tiles = { - "jeija_insulated_wire_sides.png", - "jeija_insulated_wire_sides.png", + "jeija_insulated_wire_sides_off.png", + "jeija_insulated_wire_sides_off.png", "jeija_insulated_wire_ends_off.png", "jeija_insulated_wire_ends_off.png", - "jeija_insulated_wire_sides.png", + "jeija_insulated_wire_sides_off.png", "jeija_insulated_wire_ends_off.png" }, paramtype = "light", -- cgit v1.2.3 From d1ace465c7d5c3153dcab84fd4ba2b9d235028a6 Mon Sep 17 00:00:00 2001 From: Jeija Date: Thu, 27 Dec 2012 09:54:19 +0100 Subject: Add experimental 'corner' wire, an insulated bended wire (needs textures and maybe rename it) --- mesecons_extrawires/corner.lua | 83 +++++++++++++++++++++++++++++++++++++++ mesecons_extrawires/init.lua | 1 + mesecons_extrawires/tjunction.lua | 15 +++---- 3 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 mesecons_extrawires/corner.lua (limited to 'mesecons_extrawires') diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua new file mode 100644 index 0000000..885a1ca --- /dev/null +++ b/mesecons_extrawires/corner.lua @@ -0,0 +1,83 @@ +local corner_nodebox = { + type = "fixed", + fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 }, + { -3/32, -17/32, -16/32+0.001, 3/32, -13/32, 3/32}} +} + +local corner_selectionbox = { + type = "fixed", + fixed = { -16/32-0.001, -18/32, -16/32, 5/32, -12/32, 5/32 }, +} + +local corner_get_rules = function (node) + local rules = + {{x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}} + + for i = 0, node.param2 do + rules = mesecon:rotate_rules_left(rules) + end + + return rules +end + +minetest.register_node("mesecons_extrawires:corner_on", { + drawtype = "nodebox", + tiles = { + "jeija_insulated_wire_sides_on.png", + "jeija_insulated_wire_sides_on.png", + "jeija_insulated_wire_ends_on.png", + "jeija_insulated_wire_ends_on.png", + "jeija_insulated_wire_sides_on.png", + "jeija_insulated_wire_ends_on.png" + }, + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + sunlight_propagates = true, + selection_box = corner_selectionbox, + node_box = corner_nodebox, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, + drop = "mesecons_extrawires:insulated_off", + mesecons = {conductor = + { + state = mesecon.state.on, + rules = corner_get_rules, + offstate = "mesecons_extrawires:corner_off" + }} +}) + +minetest.register_node("mesecons_extrawires:corner_off", { + drawtype = "nodebox", + description = "Mesecon Corner", + tiles = { + "jeija_insulated_wire_sides_off.png", + "jeija_insulated_wire_sides_off.png", + "jeija_insulated_wire_ends_off.png", + "jeija_insulated_wire_ends_off.png", + "jeija_insulated_wire_sides_off.png", + "jeija_insulated_wire_ends_off.png" + }, + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + sunlight_propagates = true, + selection_box = corner_selectionbox, + node_box = corner_nodebox, + groups = {dig_immediate = 3}, + mesecons = {conductor = + { + state = mesecon.state.off, + rules = corner_get_rules, + onstate = "mesecons_extrawires:corner_on" + }} +}) + +minetest.register_craft({ + output = '"mesecons_extrawires:corner_off" 3', + recipe = { + {"", "", ""}, + {"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", ""}, + {"", "mesecons_insulated:insulated_off", ""}, + } +}) diff --git a/mesecons_extrawires/init.lua b/mesecons_extrawires/init.lua index 31dfcd2..ec51a93 100644 --- a/mesecons_extrawires/init.lua +++ b/mesecons_extrawires/init.lua @@ -1,4 +1,5 @@ -- dofile(minetest.get_modpath("mesecons_extrawires").."/crossing.lua"); -- The crossing code is not active right now because it is hard to maintain dofile(minetest.get_modpath("mesecons_extrawires").."/tjunction.lua"); +dofile(minetest.get_modpath("mesecons_extrawires").."/corner.lua"); dofile(minetest.get_modpath("mesecons_extrawires").."/vertical.lua"); diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua index aa100f5..9188b5b 100644 --- a/mesecons_extrawires/tjunction.lua +++ b/mesecons_extrawires/tjunction.lua @@ -11,17 +11,14 @@ local tjunction_selectionbox = { local tjunction_get_rules = function (node) local rules = - {{x = 1, y = 0, z = 0}, - {x =-1, y = 0, z = 0}, - {x = 0, y = 0, z = -1}} + {{x = 0, y = 0, z = 1}, + {x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}} - if node.param2 == 1 then + for i = 0, node.param2 do rules = mesecon:rotate_rules_left(rules) - elseif node.param2 == 2 then - rules = mesecon:rotate_rules_right(mesecon:rotate_rules_right(rules)) - elseif node.param2 == 3 then - rules = mesecon:rotate_rules_right(rules) end + return rules end @@ -42,7 +39,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", { selection_box = tjunction_selectionbox, node_box = tjunction_nodebox, groups = {dig_immediate = 3, mesecon_conductor_craftable=1, not_in_creative_inventory = 1}, - drop = "mesecons_insulated:insulated_off", + drop = "mesecons_extrawires:tjunction_off", mesecons = {conductor = { state = mesecon.state.on, -- cgit v1.2.3 From 84ad046533be7449b647ad06c9a168cfc91b2b60 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 27 Dec 2012 12:48:02 -0500 Subject: Added a couple of needed textures for curved/corner wires and tweak code to use them. Also fixed the "on" state image for wire ends so that it works for curved wires also. --- mesecons_extrawires/corner.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mesecons_extrawires') diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua index 885a1ca..df45d41 100644 --- a/mesecons_extrawires/corner.lua +++ b/mesecons_extrawires/corner.lua @@ -24,9 +24,9 @@ end minetest.register_node("mesecons_extrawires:corner_on", { drawtype = "nodebox", tiles = { + "jeija_insulated_wire_curved_tb_on.png", + "jeija_insulated_wire_curved_tb_on.png^[transformR270", "jeija_insulated_wire_sides_on.png", - "jeija_insulated_wire_sides_on.png", - "jeija_insulated_wire_ends_on.png", "jeija_insulated_wire_ends_on.png", "jeija_insulated_wire_sides_on.png", "jeija_insulated_wire_ends_on.png" @@ -51,9 +51,9 @@ minetest.register_node("mesecons_extrawires:corner_off", { drawtype = "nodebox", description = "Mesecon Corner", tiles = { + "jeija_insulated_wire_curved_tb_off.png", + "jeija_insulated_wire_curved_tb_off.png^[transformR270", "jeija_insulated_wire_sides_off.png", - "jeija_insulated_wire_sides_off.png", - "jeija_insulated_wire_ends_off.png", "jeija_insulated_wire_ends_off.png", "jeija_insulated_wire_sides_off.png", "jeija_insulated_wire_ends_off.png" -- cgit v1.2.3 From 92122379de3b92d66942e1dbe8900c0708e4b45c Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 27 Dec 2012 13:50:54 -0500 Subject: added and tweaked textures to improve appearance and tiling of insulated T-junctions. --- mesecons_extrawires/tjunction.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mesecons_extrawires') diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua index 9188b5b..5146b0c 100644 --- a/mesecons_extrawires/tjunction.lua +++ b/mesecons_extrawires/tjunction.lua @@ -25,8 +25,8 @@ end minetest.register_node("mesecons_extrawires:tjunction_on", { drawtype = "nodebox", tiles = { - "jeija_insulated_wire_sides_on.png", - "jeija_insulated_wire_sides_on.png", + "jeija_insulated_wire_tjunction_tb_on.png", + "jeija_insulated_wire_tjunction_tb_on.png^[transformR180", "jeija_insulated_wire_ends_on.png", "jeija_insulated_wire_ends_on.png", "jeija_insulated_wire_sides_on.png", @@ -52,8 +52,8 @@ minetest.register_node("mesecons_extrawires:tjunction_off", { drawtype = "nodebox", description = "T-junction", tiles = { - "jeija_insulated_wire_sides_off.png", - "jeija_insulated_wire_sides_off.png", + "jeija_insulated_wire_tjunction_tb_off.png", + "jeija_insulated_wire_tjunction_tb_off.png^[transformR180", "jeija_insulated_wire_ends_off.png", "jeija_insulated_wire_ends_off.png", "jeija_insulated_wire_sides_off.png", -- cgit v1.2.3