v1.20 Add traffic lights

This commit is contained in:
Joachim Stolberg 2025-01-08 19:11:22 +01:00
parent 1856622438
commit 3948135ec0
27 changed files with 665 additions and 12 deletions

View File

@ -96,6 +96,13 @@ Available worlds will be converted to 'lsqlite3', but there is no way back, so:
### History ### History
**2025-01-08 V1.20**
- Add Traffic Lights and accesories
- Add TA4 water remover device
- Improve door and fly controller
- Fix several issues
**2024-12-31 V1.19** **2024-12-31 V1.19**
- Add Everness support #187 (ore sieving) - Add Everness support #187 (ore sieving)

View File

@ -63,6 +63,7 @@ return {
"3,TA4 LED Pflanzenlampe / TA4 LED Grow Light", "3,TA4 LED Pflanzenlampe / TA4 LED Grow Light",
"3,TA4 LED Straßenlampe / TA4 LED Street Lamp", "3,TA4 LED Straßenlampe / TA4 LED Street Lamp",
"3,TA4 LED Industrielampe / TA4 LED Industrial Lamp", "3,TA4 LED Industrielampe / TA4 LED Industrial Lamp",
"3,TA4 Ampel / TA4 Traffic Light",
"2,TA4 Flüssigkeitsfilter", "2,TA4 Flüssigkeitsfilter",
"3,Fundament-Ebene", "3,Fundament-Ebene",
"3,Schotter-Ebene", "3,Schotter-Ebene",
@ -605,6 +606,17 @@ return {
"\n".. "\n"..
"\n".. "\n"..
"\n", "\n",
"Die TA4 Ampel gibt es in zwei Ausführungen: in schwarz (europäische Version) und in gelb (amerikanische Version). Zusätzlich gibt es\n"..
"einen Mast\\, einen Arm und einen Verbinder-Block. Die Ampel kann auf oder an einen Mast montiert werden. Sie kann aber nicht\n"..
"an einen Arm montiert werden. Dies hat technische Gründe. Dafür gibt es den Verbinder-Block\\, der zwischen Arm und Ampel gesetzt wird.\n"..
"\n"..
"Die Ampel kann über Kommandos wie beim TA4 Signal Tower angesteuert werden.\n"..
"Wird zusätzlich der TA4 Spieler Detektor eingesetzt\\, so kann die Ampel auch auf Fußgänger oder Fahrzeuge reagieren.\n"..
"\n"..
"Die Ampel benötigt keinen Strom.\n"..
"\n"..
"\n"..
"\n",
"Im Flüssigkeitsfilter wird Rotschlamm gefiltert.\n".. "Im Flüssigkeitsfilter wird Rotschlamm gefiltert.\n"..
"Dabei entsteht entweder Lauge\\, welche unten in einem Tank gesammelt werden kann oder Wüstenkopfsteinpflaster\\, welches sich im Filter absetzt.\n".. "Dabei entsteht entweder Lauge\\, welche unten in einem Tank gesammelt werden kann oder Wüstenkopfsteinpflaster\\, welches sich im Filter absetzt.\n"..
"Wenn der Filter zu sehr verstopft ist\\, muss er geleert und neu befüllt werden.\n".. "Wenn der Filter zu sehr verstopft ist\\, muss er geleert und neu befüllt werden.\n"..
@ -940,6 +952,7 @@ return {
"ta4_growlight", "ta4_growlight",
"ta4_streetlamp", "ta4_streetlamp",
"ta4_industriallamp", "ta4_industriallamp",
"ta4_trafficlight",
"ta4_liquid_filter", "ta4_liquid_filter",
"", "",
"", "",
@ -1036,6 +1049,7 @@ return {
"", "",
"", "",
"", "",
"",
"ta4_liquid_filter_base", "ta4_liquid_filter_base",
"ta4_liquid_filter_gravel", "ta4_liquid_filter_gravel",
"ta4_liquid_filter_top", "ta4_liquid_filter_top",

View File

@ -63,6 +63,7 @@ return {
"3,TA4 LED Grow Light", "3,TA4 LED Grow Light",
"3,TA4 Street Lamp", "3,TA4 Street Lamp",
"3,TA4 LED Industrial Lamp", "3,TA4 LED Industrial Lamp",
"3,TA4 traffic light",
"2,TA4 Liquid Filter", "2,TA4 Liquid Filter",
"3,Base Layer", "3,Base Layer",
"3,Gravel Layer", "3,Gravel Layer",
@ -603,6 +604,14 @@ return {
"\n".. "\n"..
"\n".. "\n"..
"\n", "\n",
"The TA4 traffic light is available in two versions: black (European version) and yellow (American version). In addition\\, there is a mast\\, an arm and a connector block. The traffic light can be mounted on or to a mast. However\\, it cannot be mounted to an arm. This is for technical reasons. This is why there is the connector block\\, which is placed between the arm and the traffic light.\n"..
"\n"..
"The traffic light can be controlled using commands like the TA4 signal tower. If the TA4 player detector is also used\\, the traffic light can also react to pedestrians or vehicles.\n"..
"\n"..
"The traffic light does not require any electricity.\n"..
"\n"..
"\n"..
"\n",
"The liquid filter filters red mud.\n".. "The liquid filter filters red mud.\n"..
"A part of the red mud becomes lye\\, which can be collected at the bottom in a tank.\n".. "A part of the red mud becomes lye\\, which can be collected at the bottom in a tank.\n"..
"The other part becomes desert cobblestone and clutters the filter material.\n".. "The other part becomes desert cobblestone and clutters the filter material.\n"..
@ -941,6 +950,7 @@ return {
"ta4_growlight", "ta4_growlight",
"ta4_streetlamp", "ta4_streetlamp",
"ta4_industriallamp", "ta4_industriallamp",
"ta4_trafficlight",
"ta4_liquid_filter", "ta4_liquid_filter",
"", "",
"", "",
@ -1037,6 +1047,7 @@ return {
"", "",
"", "",
"", "",
"",
"ta4_liquid_filter_base", "ta4_liquid_filter_base",
"ta4_liquid_filter_gravel", "ta4_liquid_filter_gravel",
"ta4_liquid_filter_top", "ta4_liquid_filter_top",

View File

@ -13,7 +13,7 @@
techage = {} techage = {}
-- Version for compatibility checks, see readme.md/history -- Version for compatibility checks, see readme.md/history
techage.version = 1.19 techage.version = 1.20
if minetest.global_exists("tubelib") then if minetest.global_exists("tubelib") then
minetest.log("error", "[techage] Techage can't be used together with the mod tubelib!") minetest.log("error", "[techage] Techage can't be used together with the mod tubelib!")
@ -305,6 +305,7 @@ dofile(MP.."/logic/button_2x.lua")
dofile(MP.."/logic/button_4x.lua") dofile(MP.."/logic/button_4x.lua")
dofile(MP.."/logic/signallamp_2x.lua") dofile(MP.."/logic/signallamp_2x.lua")
dofile(MP.."/logic/signallamp_4x.lua") dofile(MP.."/logic/signallamp_4x.lua")
dofile(MP.."/logic/trafficlight.lua")
if minetest.global_exists("mesecon") then if minetest.global_exists("mesecon") then
dofile(MP.."/logic/mesecons_converter.lua") dofile(MP.."/logic/mesecons_converter.lua")
end end

View File

@ -142,8 +142,11 @@ end
-- --
if techage.modified_recipes_enabled then if techage.modified_recipes_enabled then
minetest.clear_craft({ minetest.clear_craft({
output = "default:bronze_ingot", recipe = {
type = "crafting", {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
{"default:copper_ingot", "default:tin_ingot", "default:copper_ingot"},
{"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
}
}) })
-- delete cooking iron lumps into steel ingots -- delete cooking iron lumps into steel ingots
minetest.clear_craft({ minetest.clear_craft({
@ -159,14 +162,6 @@ if techage.modified_recipes_enabled then
}) })
end end
-- add again
minetest.register_craft({
output = 'default:bronze_ingot 9',
recipe = {
{'default:bronzeblock'},
}
})
techage.ironage_register_recipe({ techage.ironage_register_recipe({
output = "default:bronze_ingot 4", output = "default:bronze_ingot 4",
recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"}, recipe = {"default:copper_ingot", "default:copper_ingot", "default:copper_ingot", "default:tin_ingot"},

View File

@ -1522,6 +1522,13 @@ TA4 Derrick=TA4 Bohrturm
[TA] Derrick is being built!=[TA] Bohrturm wird errichtet [TA] Derrick is being built!=[TA] Bohrturm wird errichtet
[TA] Derrick is being removed!=[TA] Bohrturm wird abgebaut [TA] Derrick is being removed!=[TA] Bohrturm wird abgebaut
### trafficlight.lua ###
TA4 Traffic Light=TA4 Ampel
TA4 Traffic Light Arm=TA4 Ampel Arm
TA4 Traffic Light Connector=TA4 Ampel Verbinder
TA4 Traffic Light Pole=TA4 Ampel Mast
### transformer.lua ### ### transformer.lua ###
TA4 Isolation Transformer=TA4 Trenntransformator TA4 Isolation Transformer=TA4 Trenntransformator

View File

@ -1522,6 +1522,13 @@ TA4 Derrick=TA4 Derrick
[TA] Derrick is being built!=[TA] Le derrick est en cours de construction! [TA] Derrick is being built!=[TA] Le derrick est en cours de construction!
[TA] Derrick is being removed!=[TA] Le derrick est retiré! [TA] Derrick is being removed!=[TA] Le derrick est retiré!
### trafficlight.lua ###
TA4 Traffic Light=
TA4 Traffic Light Arm=
TA4 Traffic Light Connector=
TA4 Traffic Light Pole=
### transformer.lua ### ### transformer.lua ###
TA4 Isolation Transformer= TA4 Isolation Transformer=

View File

@ -1518,6 +1518,13 @@ TA4 Derrick=TA4 Буровая вышка
[TA] Derrick is being built!=[TA] Буровая вышка построена! [TA] Derrick is being built!=[TA] Буровая вышка построена!
[TA] Derrick is being removed!=[TA] Буровая вышка удалена! [TA] Derrick is being removed!=[TA] Буровая вышка удалена!
### trafficlight.lua ###
TA4 Traffic Light=
TA4 Traffic Light Arm=
TA4 Traffic Light Connector=
TA4 Traffic Light Pole=
### transformer.lua ### ### transformer.lua ###
TA4 Isolation Transformer=TA4 Изолирующий трансформатор TA4 Isolation Transformer=TA4 Изолирующий трансформатор

View File

@ -1522,6 +1522,13 @@ TA4 Derrick=
[TA] Derrick is being built!= [TA] Derrick is being built!=
[TA] Derrick is being removed!= [TA] Derrick is being removed!=
### trafficlight.lua ###
TA4 Traffic Light=
TA4 Traffic Light Arm=
TA4 Traffic Light Connector=
TA4 Traffic Light Pole=
### transformer.lua ### ### transformer.lua ###
TA4 Isolation Transformer= TA4 Isolation Transformer=

577
logic/trafficlight.lua Normal file
View File

@ -0,0 +1,577 @@
--[[
TechAge
=======
Copyright (C) 2019-2025 Joachim Stolberg
AGPL v3
See LICENSE.txt for more information
Traffic Lights
]]--
local S = techage.S
local M = minetest.get_meta
local P2S = minetest.pos_to_string
local TITLE = S("TA4 Traffic Light")
local
ConvertTo = {
off = {
["techage:ta4_trafficlight1_red"] = "techage:ta4_trafficlight1",
["techage:ta4_trafficlight1_amber"] = "techage:ta4_trafficlight1",
["techage:ta4_trafficlight1_green"] = "techage:ta4_trafficlight1",
["techage:ta4_trafficlight1B_red"] = "techage:ta4_trafficlight1B",
["techage:ta4_trafficlight1B_amber"] = "techage:ta4_trafficlight1B",
["techage:ta4_trafficlight1B_green"] = "techage:ta4_trafficlight1B",
["techage:ta4_trafficlight2_red"] = "techage:ta4_trafficlight2",
["techage:ta4_trafficlight2_amber"] = "techage:ta4_trafficlight2",
["techage:ta4_trafficlight2_green"] = "techage:ta4_trafficlight2",
["techage:ta4_trafficlight2B_red"] = "techage:ta4_trafficlight2B",
["techage:ta4_trafficlight2B_amber"] = "techage:ta4_trafficlight2B",
["techage:ta4_trafficlight2B_green"] = "techage:ta4_trafficlight2B",
},
green = {
["techage:ta4_trafficlight1_red"] = "techage:ta4_trafficlight1_green",
["techage:ta4_trafficlight1_amber"] = "techage:ta4_trafficlight1_green",
["techage:ta4_trafficlight1"] = "techage:ta4_trafficlight1_green",
["techage:ta4_trafficlight1B_red"] = "techage:ta4_trafficlight1B_green",
["techage:ta4_trafficlight1B_amber"] = "techage:ta4_trafficlight1B_green",
["techage:ta4_trafficlight1B"] = "techage:ta4_trafficlight1B_green",
["techage:ta4_trafficlight2_red"] = "techage:ta4_trafficlight2_green",
["techage:ta4_trafficlight2_amber"] = "techage:ta4_trafficlight2_green",
["techage:ta4_trafficlight2"] = "techage:ta4_trafficlight2_green",
["techage:ta4_trafficlight2B_red"] = "techage:ta4_trafficlight2B_green",
["techage:ta4_trafficlight2B_amber"] = "techage:ta4_trafficlight2B_green",
["techage:ta4_trafficlight2B"] = "techage:ta4_trafficlight2B_green",
},
amber = {
["techage:ta4_trafficlight1_red"] = "techage:ta4_trafficlight1_amber",
["techage:ta4_trafficlight1_green"] = "techage:ta4_trafficlight1_amber",
["techage:ta4_trafficlight1"] = "techage:ta4_trafficlight1_amber",
["techage:ta4_trafficlight1B_red"] = "techage:ta4_trafficlight1B_amber",
["techage:ta4_trafficlight1B_green"] = "techage:ta4_trafficlight1B_amber",
["techage:ta4_trafficlight1B"] = "techage:ta4_trafficlight1B_amber",
["techage:ta4_trafficlight2_red"] = "techage:ta4_trafficlight2_amber",
["techage:ta4_trafficlight2_green"] = "techage:ta4_trafficlight2_amber",
["techage:ta4_trafficlight2"] = "techage:ta4_trafficlight2_amber",
["techage:ta4_trafficlight2B_red"] = "techage:ta4_trafficlight2B_amber",
["techage:ta4_trafficlight2B_green"] = "techage:ta4_trafficlight2B_amber",
["techage:ta4_trafficlight2B"] = "techage:ta4_trafficlight2B_amber",
},
red = {
["techage:ta4_trafficlight1_amber"] = "techage:ta4_trafficlight1_red",
["techage:ta4_trafficlight1_green"] = "techage:ta4_trafficlight1_red",
["techage:ta4_trafficlight1"] = "techage:ta4_trafficlight1_red",
["techage:ta4_trafficlight1B_amber"] = "techage:ta4_trafficlight1B_red",
["techage:ta4_trafficlight1B_green"] = "techage:ta4_trafficlight1B_red",
["techage:ta4_trafficlight1B"] = "techage:ta4_trafficlight1B_red",
["techage:ta4_trafficlight2_amber"] = "techage:ta4_trafficlight2_red",
["techage:ta4_trafficlight2_green"] = "techage:ta4_trafficlight2_red",
["techage:ta4_trafficlight2"] = "techage:ta4_trafficlight2_red",
["techage:ta4_trafficlight2B_amber"] = "techage:ta4_trafficlight2B_red",
["techage:ta4_trafficlight2B_green"] = "techage:ta4_trafficlight2B_red",
["techage:ta4_trafficlight2B"] = "techage:ta4_trafficlight2B_red",
},
}
local function is_pole(pos)
local node = minetest.get_node(pos)
local dir = tubelib2.side_to_dir("B", node.param2)
local pos2 = tubelib2.get_pos(pos, dir)
local name = minetest.get_node(pos2).name
return name == "techage:trafficlight_connector" or name == "techage:trafficlight_pole"
end
local function switch_on(pos, color)
local node = techage.get_node_lvm(pos)
if ConvertTo[color][node.name] then
node.name = ConvertTo[color][node.name]
M(pos):set_string("state", color)
minetest.swap_node(pos, node)
end
end
local function switch_off(pos)
local node = techage.get_node_lvm(pos)
if ConvertTo["off"][node.name] then
node.name = ConvertTo["off"][node.name]
M(pos):set_string("state", "off")
minetest.swap_node(pos, node)
end
end
local node_box = {
type = "fixed",
fixed = {{-6/32, -16/32, -6/32, 6/32, 16/32, 6/32}},
}
local node_boxB = {
type = "fixed",
fixed = {{-6/32, -16/32, 8/32, 6/32, 16/32, 20/32}},
}
local tiles1 = {
-- up, down, right, left, back, front
"techage_trafficlight1.png^[transformR90",
"techage_trafficlight1.png^[transformFXR90",
"techage_trafficlight1.png",
"techage_trafficlight1.png^[transformFX",
"techage_trafficlight1.png",
"techage_trafficlight1_off.png",
}
local tiles1B = {
-- up, down, right, left, back, front
"techage_trafficlight1B.png^[transformR90",
"techage_trafficlight1B.png^[transformFXR90",
"techage_trafficlight1B.png",
"techage_trafficlight1B.png^[transformFX",
"techage_trafficlight1.png",
"techage_trafficlight1_off.png",
}
local tiles2 = {
-- up, down, right, left, back, front
"techage_trafficlight2.png^[transformR90",
"techage_trafficlight2.png^[transformFXR90",
"techage_trafficlight2.png",
"techage_trafficlight2.png^[transformFX",
"techage_trafficlight2.png",
"techage_trafficlight2_off.png",
}
local tiles2B = {
-- up, down, right, left, back, front
"techage_trafficlight2B.png^[transformR90",
"techage_trafficlight2B.png^[transformFXR90",
"techage_trafficlight2B.png",
"techage_trafficlight2B.png^[transformFX",
"techage_trafficlight2.png",
"techage_trafficlight2_off.png",
}
local function on_rightclick(pos, node, clicker)
if not minetest.is_protected(pos, clicker:get_player_name()) then
local state = M(pos):get_string("state")
if state == "off" then
switch_on(pos, "green")
else
switch_off(pos)
end
end
end
local function after_dig_node(pos, oldnode, oldmetadata)
techage.remove_node(pos, oldnode, oldmetadata)
end
minetest.register_node("techage:ta4_trafficlight1", {
description = TITLE,
tiles = table.copy(tiles1),
drawtype = "nodebox",
node_box = node_box,
after_place_node = function(pos, placer)
local number
if is_pole(pos) then
local node = minetest.get_node(pos)
node.name = "techage:ta4_trafficlight1B"
minetest.swap_node(pos, node)
number = techage.add_node(pos, "techage:ta4_trafficlight1B")
else
number = techage.add_node(pos, "techage:ta4_trafficlight1")
end
local meta = M(pos)
meta:set_string("state", "off")
meta:set_string("infotext", TITLE .. " " .. number)
end,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 0,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {cracky=2, crumbly=2},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
})
for _,color in ipairs({"green", "amber", "red"}) do
tiles1[6] = "techage_trafficlight1_" .. color .. '.png'
minetest.register_node("techage:ta4_trafficlight1_" .. color, {
description = TITLE,
tiles = table.copy(tiles1),
drawtype = "nodebox",
node_box = node_box,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 10,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {crumbly=0, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
drop = "techage:ta4_trafficlight1",
})
end
minetest.register_node("techage:ta4_trafficlight1B", {
description = TITLE,
tiles = table.copy(tiles1B),
drawtype = "nodebox",
node_box = node_boxB,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 0,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {cracky=2, crumbly=2, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
drop = "techage:ta4_trafficlight1",
})
for _,color in ipairs({"green", "amber", "red"}) do
tiles1B[6] = "techage_trafficlight1_" .. color .. '.png'
minetest.register_node("techage:ta4_trafficlight1B_" .. color, {
description = TITLE,
tiles = table.copy(tiles1B),
drawtype = "nodebox",
node_box = node_boxB,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 10,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {crumbly=0, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
drop = "techage:ta4_trafficlight1",
})
end
minetest.register_node("techage:ta4_trafficlight2", {
description = TITLE,
tiles = table.copy(tiles2),
drawtype = "nodebox",
node_box = node_box,
after_place_node = function(pos, placer)
local number
if is_pole(pos) then
local node = minetest.get_node(pos)
node.name = "techage:ta4_trafficlight2B"
minetest.swap_node(pos, node)
number = techage.add_node(pos, "techage:ta4_trafficlight2B")
else
number = techage.add_node(pos, "techage:ta4_trafficlight2")
end
local meta = M(pos)
meta:set_string("state", "off")
meta:set_string("infotext", TITLE .. " " .. number)
end,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 0,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {cracky=2, crumbly=2},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
})
for _,color in ipairs({"green", "amber", "red"}) do
tiles2[6] = "techage_trafficlight2_" .. color .. '.png'
minetest.register_node("techage:ta4_trafficlight2_" .. color, {
description = TITLE,
tiles = table.copy(tiles2),
drawtype = "nodebox",
node_box = node_box,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 10,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {crumbly=0, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
drop = "techage:ta4_trafficlight2",
})
end
minetest.register_node("techage:ta4_trafficlight2B", {
description = TITLE,
tiles = table.copy(tiles2B),
drawtype = "nodebox",
node_box = node_boxB,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 0,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {cracky=2, crumbly=2, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
drop = "techage:ta4_trafficlight1",
})
for _,color in ipairs({"green", "amber", "red"}) do
tiles2B[6] = "techage_trafficlight2_" .. color .. '.png'
minetest.register_node("techage:ta4_trafficlight2B_" .. color, {
description = TITLE,
tiles = table.copy(tiles2B),
drawtype = "nodebox",
node_box = node_boxB,
on_rightclick = on_rightclick,
after_dig_node = after_dig_node,
paramtype = "light",
use_texture_alpha = techage.CLIP,
light_source = 10,
sunlight_propagates = true,
paramtype2 = "facedir",
groups = {crumbly=0, not_in_creative_inventory=1},
is_ground_content = false,
sounds = default.node_sound_glass_defaults(),
drop = "techage:ta4_trafficlight2",
})
end
minetest.register_craft({
output = "techage:ta4_trafficlight1",
recipe = {
{"", "dye:black", ""},
{"", "techage:ta4_signaltower", ""},
{"", "default:steel_ingot", ""},
},
})
minetest.register_craft({
output = "techage:ta4_trafficlight2",
recipe = {
{"", "dye:orange", ""},
{"", "techage:ta4_signaltower", ""},
{"", "default:steel_ingot", ""},
},
})
techage.register_node({
"techage:ta4_trafficlight1",
"techage:ta4_trafficlight1_green",
"techage:ta4_trafficlight1_amber",
"techage:ta4_trafficlight1_red",
"techage:ta4_trafficlight2",
"techage:ta4_trafficlight2_green",
"techage:ta4_trafficlight2_amber",
"techage:ta4_trafficlight2_red",
"techage:ta4_trafficlight1B",
"techage:ta4_trafficlight1B_green",
"techage:ta4_trafficlight1B_amber",
"techage:ta4_trafficlight1B_red",
"techage:ta4_trafficlight2B",
"techage:ta4_trafficlight2B_green",
"techage:ta4_trafficlight2B_amber",
"techage:ta4_trafficlight2B_red"}, {
on_recv_message = function(pos, src, topic, payload)
if topic == "green" then
switch_on(pos, "green")
elseif topic == "amber" then
switch_on(pos, "amber")
elseif topic == "red" then
switch_on(pos, "red")
elseif topic == "off" then
switch_off(pos)
elseif topic == "state" then
local meta = minetest.get_meta(pos)
return meta:get_string("state")
end
end,
on_beduino_receive_cmnd = function(pos, src, topic, payload)
if topic == 2 then
local color = ({"green", "amber", "red"})[payload[1]]
if color then
switch_on(pos, color)
else
switch_off(pos)
end
return 0
else
return 2 -- unknown or invalid topic
end
end,
on_beduino_request_data = function(pos, src, topic, payload)
if topic == 130 then
local meta = minetest.get_meta(pos)
local color = ({off = 0, green = 1, amber = 2, red = 3})[meta:get_string("state")] or 1
return 0, {color}
else
return 2, "" -- unknown or invalid topic
end
end,
})
minetest.register_node("techage:trafficlight_pole", {
description = S("TA4 Traffic Light Pole"),
tiles = {
"techage_trafficlight_pole.png",
},
paramtype2 = "facedir", -- important!
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {{ -4/32, -16/32, -4/32, 4/32, 16/32, 4/32}},
connect_left = {{-16/32, 0/32, -3/32, 3/32, 6/32, 3/32}},
connect_right = {{ -3/32, 0/32, -3/32, 16/32, 6/32, 3/32}},
connect_back = {{ -3/32, 0/32, -3/32, 3/32, 6/32, 16/32}},
connect_front = {{ -3/32, 0/32, -16/32, 3/32, 6/32, 3/32}},
},
connects_to = {
"techage:trafficlight_arm",
"techage:trafficlight_connector",
"techage:ta4_trafficlight1",
"techage:ta4_trafficlight1B",
"techage:ta4_trafficlight1_red",
"techage:ta4_trafficlight1_amber",
"techage:ta4_trafficlight1_green",
"techage:ta4_trafficlight1B_red",
"techage:ta4_trafficlight1B_amber",
"techage:ta4_trafficlight1B_green",
"techage:ta4_trafficlight2",
"techage:ta4_trafficlight2B",
"techage:ta4_trafficlight2_red",
"techage:ta4_trafficlight2_amber",
"techage:ta4_trafficlight2_green",
"techage:ta4_trafficlight2B_red",
"techage:ta4_trafficlight2B_amber",
"techage:ta4_trafficlight2B_green",
},
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky=2, crumbly=2, choppy=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("techage:trafficlight_connector", {
description = S("TA4 Traffic Light Connector"),
tiles = {
"techage_trafficlight_pole.png",
},
paramtype2 = "facedir", -- important!
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {{ -4/32, -4/32, -4/32, 4/32, 10/32, 4/32}},
connect_left = {{-16/32, 0/32, -3/32, 3/32, 6/32, 3/32}},
connect_right = {{ -3/32, 0/32, -3/32, 16/32, 6/32, 3/32}},
connect_back = {{ -3/32, 0/32, -3/32, 3/32, 6/32, 16/32}},
connect_front = {{ -3/32, 0/32, -16/32, 3/32, 6/32, 3/32}},
},
connects_to = {
"techage:trafficlight_arm",
"techage:trafficlight_connector",
"techage:trafficlight_pole",
"techage:ta4_trafficlight1",
"techage:ta4_trafficlight1B",
"techage:ta4_trafficlight1_red",
"techage:ta4_trafficlight1_amber",
"techage:ta4_trafficlight1_green",
"techage:ta4_trafficlight1B_red",
"techage:ta4_trafficlight1B_amber",
"techage:ta4_trafficlight1B_green",
"techage:ta4_trafficlight2",
"techage:ta4_trafficlight2B",
"techage:ta4_trafficlight2_red",
"techage:ta4_trafficlight2_amber",
"techage:ta4_trafficlight2_green",
"techage:ta4_trafficlight2B_red",
"techage:ta4_trafficlight2B_amber",
"techage:ta4_trafficlight2B_green",
},
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky=2, crumbly=2, choppy=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("techage:trafficlight_arm", {
description = S("TA4 Traffic Light Arm"),
tiles = {
"techage_trafficlight_pole.png",
},
paramtype2 = "facedir", -- important!
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {{ -3/32, 0/32, -16/32, 3/32, 6/32, 16/32}},
},
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky=2, crumbly=2, choppy=2},
sounds = default.node_sound_defaults(),
})
minetest.register_craft({
output = "techage:trafficlight_pole",
recipe = {
{"", "basic_materials:steel_bar", ""},
{"", "basic_materials:steel_bar", "dye:dark_grey"},
{"", "basic_materials:steel_bar", ""},
},
})
minetest.register_craft({
output = "techage:trafficlight_arm",
recipe = {
{"", "dye:dark_grey", ""},
{"basic_materials:steel_bar", "basic_materials:steel_bar", "basic_materials:steel_bar"},
{"", "", ""},
},
})
minetest.register_craft({
output = "techage:trafficlight_connector",
recipe = {
{"dye:dark_grey", "basic_materials:steel_bar", ""},
{"basic_materials:steel_bar", "", ""},
{"", "", ""},
},
})

View File

@ -691,8 +691,18 @@ Die Lampe benötigt 1 ku Strom.
[ta4_industriallamp|image] [ta4_industriallamp|image]
### TA4 Ampel / TA4 Traffic Light
Die TA4 Ampel gibt es in zwei Ausführungen: in schwarz (europäische Version) und in gelb (amerikanische Version). Zusätzlich gibt es
einen Mast, einen Arm und einen Verbinder-Block. Die Ampel kann auf oder an einen Mast montiert werden. Sie kann aber nicht
an einen Arm montiert werden. Dies hat technische Gründe. Dafür gibt es den Verbinder-Block, der zwischen Arm und Ampel gesetzt wird.
Die Ampel kann über Kommandos wie beim TA4 Signal Tower angesteuert werden.
Wird zusätzlich der TA4 Spieler Detektor eingesetzt, so kann die Ampel auch auf Fußgänger oder Fahrzeuge reagieren.
Die Ampel benötigt keinen Strom.
[ta4_trafficlight|image]
## TA4 Flüssigkeitsfilter ## TA4 Flüssigkeitsfilter

View File

@ -681,7 +681,15 @@ The lamp requires 1 ku of electricity.
[ta4_industriallamp|image] [ta4_industriallamp|image]
### TA4 traffic light
The TA4 traffic light is available in two versions: black (European version) and yellow (American version). In addition, there is a mast, an arm and a connector block. The traffic light can be mounted on or to a mast. However, it cannot be mounted to an arm. This is for technical reasons. This is why there is the connector block, which is placed between the arm and the traffic light.
The traffic light can be controlled using commands like the TA4 signal tower. If the TA4 player detector is also used, the traffic light can also react to pedestrians or vehicles.
The traffic light does not require any electricity.
[ta4_trafficlight|image]
## TA4 Liquid Filter ## TA4 Liquid Filter

View File

@ -1458,6 +1458,7 @@ As payload data, these commands may require numeric values or a string value.
| Turn on/off | 1 | state | Turn device (lamp, machine, button...) on/off.<br>`state`: 0 = "off", 1 = "on" | | Turn on/off | 1 | state | Turn device (lamp, machine, button...) on/off.<br>`state`: 0 = "off", 1 = "on" |
| Turn on/off Signs Bot | 1 | state | Turn device (lamp, machine, button...) on/off.<br>`state`: 0 = "off", 1 = "on" | | Turn on/off Signs Bot | 1 | state | Turn device (lamp, machine, button...) on/off.<br>`state`: 0 = "off", 1 = "on" |
| Signal Tower | 2 | color | Set Signal Tower color<br>`color`: 0 = "off", 1 = "green", 2 = "amber", 3 = "red" | | Signal Tower | 2 | color | Set Signal Tower color<br>`color`: 0 = "off", 1 = "green", 2 = "amber", 3 = "red" |
| Traffic Light | 2 | color | Set Traffic Light color<br>`color`: 0 = "off", 1 = "green", 2 = "amber", 3 = "red" |
| Signal Lamp | 3 | idx, color | Set the lamp color for "TA4 2x" and "TA4 4x" Signal Lamps<br>`idx` is the lamp number (1..4)<br>`color`: 0 = "off", 1 = "green", 2 = "amber", 3 = "red" | | Signal Lamp | 3 | idx, color | Set the lamp color for "TA4 2x" and "TA4 4x" Signal Lamps<br>`idx` is the lamp number (1..4)<br>`color`: 0 = "off", 1 = "green", 2 = "amber", 3 = "red" |
| Distri. Filter Slot | 4 | idx, state | Enable/disable a Distributor filter slot.<br>`idx` is the slot number: 1 = "red", 2 = "green", 3 = "blue", 4 = "yellow"<br>`state`: 0 = "off", 1 = "on" | | Distri. Filter Slot | 4 | idx, state | Enable/disable a Distributor filter slot.<br>`idx` is the slot number: 1 = "red", 2 = "green", 3 = "blue", 4 = "yellow"<br>`state`: 0 = "off", 1 = "on" |
| Detector Block Countdown | 5 | counter | Set countdown counter of the TA4 Item Detector block to the given value and start countdown mode. | | Detector Block Countdown | 5 | counter | Set countdown counter of the TA4 Item Detector block to the given value and start countdown mode. |
@ -1504,6 +1505,7 @@ corresponds to the error from previous chapter.
| Minecart State (Cart Terminal) | 129 | cart-id | state | Returns 0 = UNKNOWN, 1 = STOPPED, 2 = RUNNING | | Minecart State (Cart Terminal) | 129 | cart-id | state | Returns 0 = UNKNOWN, 1 = STOPPED, 2 = RUNNING |
| Minecart Distance (Cart Terminal)| 130 | cart-id | distance | Returns the distance from the cart to the Cart Terminal in meters | | Minecart Distance (Cart Terminal)| 130 | cart-id | distance | Returns the distance from the cart to the Cart Terminal in meters |
| Signal Tower Color | 130 | - | color | OFF = 0, GREEN = 1, AMBER = 2, RED = 3 | | Signal Tower Color | 130 | - | color | OFF = 0, GREEN = 1, AMBER = 2, RED = 3 |
| Traffic Light Color | 130 | - | color | OFF = 0, GREEN = 1, AMBER = 2, RED = 3 |
| Chest State | 131 | - | state | State of a TA3/TA4 chest or Sensor Chest: EMPTY = 0, LOADED = 1, FULL = 2 | | Chest State | 131 | - | state | State of a TA3/TA4 chest or Sensor Chest: EMPTY = 0, LOADED = 1, FULL = 2 |
| TA3/TA4 Button State | 131 | - | state | OFF = 0, ON = 1 | | TA3/TA4 Button State | 131 | - | state | OFF = 0, ON = 1 |
| Fuel Level | 132 | - | level | Fuel level of a fuel consuming block (0..65535) | | Fuel Level | 132 | - | level | Fuel level of a fuel consuming block (0..65535) |

View File

@ -408,7 +408,7 @@ Please note, that this is not a technical distinction, only a logical.
| cmnd | data | comment | | cmnd | data | comment |
| -------------------------------- | ------------ | ------------------------------------------------------------ | | -------------------------------- | ------------ | ------------------------------------------------------------ |
| "on", "off" | nil | turn a node on/off (machine, lamp,...) | | "on", "off" | nil | turn a node on/off (machine, lamp,...) |
| "red, "amber", "green", "off" | nil | set Signal Tower color | | "red, "amber", "green", "off" | nil | set Signal Tower or Traffic Light color |
| "red, "amber", "green", "off" | lamp number (1..4) | Set the signal lamp color. Valid for "TA4 2x Signal Lamp" and "TA4 4x Signal Lamp" | | "red, "amber", "green", "off" | lamp number (1..4) | Set the signal lamp color. Valid for "TA4 2x Signal Lamp" and "TA4 4x Signal Lamp" |
| "port" | string<br />`<color>=on/off` | Enable/disable a Distributor filter slot..<br />Example: `"yellow=on"`<br />colors: red, green, blue, yellow | | "port" | string<br />`<color>=on/off` | Enable/disable a Distributor filter slot..<br />Example: `"yellow=on"`<br />colors: red, green, blue, yellow |
| "config" | "\<slot> \<item list>" | Configure a Distributor filter slot, like: "red default:dirt dye:blue" | | "config" | "\<slot> \<item list>" | Configure a Distributor filter slot, like: "red default:dirt dye:blue" |

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B