several bugs fixed here and there

This commit is contained in:
Joachim Stolberg 2020-02-17 22:46:29 +01:00
parent 87db6be6fc
commit 4f25578f16
25 changed files with 166 additions and 490 deletions

View File

@ -79,7 +79,7 @@ function techage.fuel.can_dig(pos, player)
nvm.liquid = nvm.liquid or {} nvm.liquid = nvm.liquid or {}
nvm.liquid.amount = nvm.liquid.amount or 0 nvm.liquid.amount = nvm.liquid.amount or 0
local inv = M(pos):get_inventory() local inv = M(pos):get_inventory()
return inv:is_empty("fuel") and nvm.liquid.amount == 0 return not inv or inv:is_empty("fuel") and nvm.liquid.amount == 0
end end
function techage.fuel.on_rightclick(pos, node, clicker) function techage.fuel.on_rightclick(pos, node, clicker)

View File

@ -48,8 +48,7 @@ end
function techage.liquid.is_empty(pos) function techage.liquid.is_empty(pos)
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
local inv = minetest.get_meta(pos):get_inventory() return not nvm.liquid or (nvm.liquid.amount or 0) == 0
return inv:is_empty("src") and inv:is_empty("dst") and (not nvm.liquid or (nvm.liquid.amount or 0) == 0)
end end
techage.liquid.recv_message = { techage.liquid.recv_message = {
@ -89,6 +88,7 @@ local function get_full_container(empty_container, inv_item)
return ContainerDef[empty_container] and ContainerDef[empty_container][inv_item] return ContainerDef[empty_container] and ContainerDef[empty_container][inv_item]
end end
-- used by filler
local function fill_container(pos, inv, empty_container) local function fill_container(pos, inv, empty_container)
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
nvm.liquid = nvm.liquid or {} nvm.liquid = nvm.liquid or {}
@ -112,6 +112,7 @@ local function fill_container(pos, inv, empty_container)
return false return false
end end
-- used by filler
local function empty_container(pos, inv, full_container) local function empty_container(pos, inv, full_container)
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
nvm.liquid = nvm.liquid or {} nvm.liquid = nvm.liquid or {}
@ -135,7 +136,7 @@ local function empty_container(pos, inv, full_container)
return false return false
end end
-- check if the given empty container can be replaced by a full -- check if the wielded empty container can be replaced by a full
-- container and added to the players inventory -- container and added to the players inventory
local function fill_on_punch(nvm, empty_container, item_count, puncher) local function fill_on_punch(nvm, empty_container, item_count, puncher)
nvm.liquid = nvm.liquid or {} nvm.liquid = nvm.liquid or {}
@ -176,10 +177,17 @@ local function fill_on_punch(nvm, empty_container, item_count, puncher)
end end
end end
local function empty_on_punch(pos, nvm, full_container) -- check of the wielded full container can be emptied into the tank
local function empty_on_punch(pos, nvm, full_container, item_count)
nvm.liquid = nvm.liquid or {} nvm.liquid = nvm.liquid or {}
nvm.liquid.amount = nvm.liquid.amount or 0 nvm.liquid.amount = nvm.liquid.amount or 0
local lqd_def = get_liquid_def(full_container) local lqd_def
-- handle legacy items
if full_container == "techage:hydrogen" or full_container == "techage:oil_source" then
lqd_def = {inv_item = full_container, size = item_count, container = ""}
else
lqd_def = get_liquid_def(full_container)
end
local ndef_lqd = LQD(pos) local ndef_lqd = LQD(pos)
if lqd_def and ndef_lqd then if lqd_def and ndef_lqd then
local tank_size = ndef_lqd.capa or 0 local tank_size = ndef_lqd.capa or 0
@ -204,7 +212,7 @@ function techage.liquid.on_punch(pos, node, puncher, pointed_thing)
local wielded_item = puncher:get_wielded_item():get_name() local wielded_item = puncher:get_wielded_item():get_name()
local item_count = puncher:get_wielded_item():get_count() local item_count = puncher:get_wielded_item():get_count()
local new_item = fill_on_punch(nvm, wielded_item, item_count, puncher) local new_item = fill_on_punch(nvm, wielded_item, item_count, puncher)
or empty_on_punch(pos, nvm, wielded_item) or empty_on_punch(pos, nvm, wielded_item, item_count)
if new_item then if new_item then
puncher:set_wielded_item(new_item) puncher:set_wielded_item(new_item)
M(pos):set_string("formspec", techage.fuel.formspec(pos, nvm)) M(pos):set_string("formspec", techage.fuel.formspec(pos, nvm))

View File

@ -212,7 +212,7 @@ techage.register_node({"techage:ta4_generator", "techage:ta4_generator_on"}, {
on_transfer = function(pos, in_dir, topic, payload) on_transfer = function(pos, in_dir, topic, payload)
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
if topic == "trigger" then if topic == "trigger" then
print("trigger", nvm.provided) --print("trigger", nvm.provided)
nvm.heatexchanger_trigger = 3 nvm.heatexchanger_trigger = 3
if nvm.running then if nvm.running then
return nvm.provided or 0.1 return nvm.provided or 0.1

View File

@ -1,404 +0,0 @@
--[[
TechAge
=======
Copyright (C) 2019-2020 Joachim Stolberg
GPL v3
See LICENSE.txt for more information
TA4 Heat Exchanger
]]--
-- for lazy programmers
local S2P = minetest.string_to_pos
local P2S = minetest.pos_to_string
local M = minetest.get_meta
local S = techage.S
local CYCLE_TIME = 2
local PWR_PERF = 60
local GRVL_CAPA = 700
local PWR_CAPA = {
[3] = GRVL_CAPA * 3 * 3 * 3, -- 18900 Cyc = 630 min = 31.5 Tage bei einem ku, oder 31,5 * 24 kuh = 756 kuh = 12,6 h bei 60 ku
[5] = GRVL_CAPA * 5 * 5 * 5, -- ~2.5 days
[7] = GRVL_CAPA * 7 * 7 * 7, -- ~6 days
}
local Cable = techage.ElectricCable
local Pipe = techage.LiquidPipe
local power = techage.power
local function in_range(val, min, max)
if val < min then return min end
if val > max then return max end
return val
end
-- commands for 'techage:heatexchanger1'
local function turbine_cmnd(pos, cmnd)
return techage.transfer(
pos,
"R", -- outdir
cmnd, -- topic
nil, -- payload
Pipe, -- Pipe
{"techage:ta4_turbine", "techage:ta4_turbine_on"})
end
local function heatexchanger3_cmnd(pos, cmnd)
return techage.transfer(
{x = pos.x, y = pos.y + 1, z = pos.z},
"U", -- outdir
cmnd, -- topic
nil, -- payload
nil, -- Pipe
{"techage:heatexchanger3"})
end
local function inlet_cmnd(pos, cmnd, payload)
return techage.transfer(
pos,
"L", -- outdir
cmnd, -- topic
payload, -- payload
Pipe, -- Pipe
{"techage:ta4_pipe_inlet"})
end
local function play_sound(pos)
local mem = techage.get_mem(pos)
if not mem.handle or mem.handle == -1 then
mem.handle = minetest.sound_play("techage_booster", {
pos = pos,
gain = 0.5,
max_hear_distance = 10,
loop = true})
if mem.handle == -1 then
minetest.after(1, play_sound, pos)
end
end
end
local function stop_sound(pos)
local mem = techage.get_mem(pos)
if mem.handle then
minetest.sound_stop(mem.handle)
mem.handle = nil
end
end
local function swap_node(pos, name)
local node = techage.get_node_lvm(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
local function charging(pos, nvm, is_charging)
if nvm.capa >= nvm.capa_max then
return
end
if is_charging ~= nvm.was_charging then
nvm.was_charging = is_charging
if is_charging then
turbine_cmnd(pos, "stop")
play_sound(pos)
else
turbine_cmnd(pos, "start")
stop_sound(pos)
end
elseif is_charging then
play_sound(pos)
end
end
local function delivering(pos, nvm, delivered)
if nvm.capa <= 0 then
return
end
if delivered ~= nvm.had_delivered then
nvm.had_delivered = delivered
if delivered > 0 then
turbine_cmnd(pos, "start")
elseif delivered == 0 then
turbine_cmnd(pos, "stop")
end
end
end
local function glowing(pos, nvm, should_glow)
if nvm.win_pos then
if should_glow then
swap_node(nvm.win_pos, "techage:glow_gravel")
else
swap_node(nvm.win_pos, "default:gravel")
end
end
end
local function formspec(self, pos, nvm)
return "size[5,3]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"image[0,0.5;1,2;"..techage.power.formspec_power_bar(nvm.capa_max, nvm.capa).."]"..
"label[0.2,2.5;Load]"..
"button[1.1,1;1.8,1;update;"..S("Update").."]"..
"image_button[3,1;1,1;".. self:get_state_button_image(nvm) ..";state_button;]"..
"image[4,0.5;1,2;"..techage.power.formspec_load_bar(-(nvm.delivered or 0), PWR_PERF).."]"..
"label[4.2,2.5;Flow]"
end
local function error_info(pos, err)
local own_num = M(pos):get_string("node_number")
local pos1 = {x = pos.x, y = pos.y + 1, z = pos.z}
M(pos1):set_string("infotext", S("TA4 Heat Exchanger").." "..own_num.." : "..err)
end
local function can_start(pos, nvm, state)
if turbine_cmnd(pos, "power") then
local diameter = inlet_cmnd(pos, "diameter")
if diameter then
nvm.capa_max = PWR_CAPA[tonumber(diameter)] or 0
if nvm.capa_max ~= 0 then
local owner = M(pos):get_string("owner") or ""
if inlet_cmnd(pos, "volume", owner) then
error_info(pos, "")
return true
else
error_info(pos, "storage volume error")
return false
end
else
error_info(pos, "wrong storage diameter: "..diameter)
return false
end
else
error_info(pos, "inlet/pipe error")
return false
end
else
error_info(pos, "power network error")
return false
end
return false
end
local function start_node(pos, nvm, state)
nvm.running = true
nvm.delivered = 0
nvm.was_charging = true
nvm.had_delivered = nil
play_sound(pos)
nvm.win_pos = inlet_cmnd(pos, "window")
power.secondary_start(pos, nvm, PWR_PERF, PWR_PERF)
end
local function stop_node(pos, nvm, state)
nvm.running = false
nvm.delivered = 0
turbine_cmnd(pos, "stop")
power.secondary_stop(pos, nvm)
end
local State = techage.NodeStates:new({
node_name_passive = "techage:heatexchanger1",
cycle_time = CYCLE_TIME,
standby_ticks = 0,
can_start = can_start,
start_node = start_node,
stop_node = stop_node,
})
local function node_timer(pos, elapsed)
local nvm = techage.get_nvm(pos)
if nvm.running and turbine_cmnd(pos, "power") then
nvm.capa = nvm.capa or 0
nvm.capa_max = nvm.capa_max or 0
nvm.delivered = nvm.delivered or 0
nvm.delivered = power.secondary_alive(pos, nvm, nvm.capa, nvm.capa_max)
nvm.capa = nvm.capa - nvm.delivered
nvm.capa = in_range(nvm.capa, 0, nvm.capa_max)
glowing(pos, nvm, nvm.capa > nvm.capa_max * 0.8)
charging(pos, nvm, nvm.delivered < 0)
delivering(pos, nvm, nvm.delivered)
end
return nvm.running
end
local function can_dig(pos, player)
local nvm = techage.get_nvm(pos)
return not nvm.running
end
local function orientate_node(pos, name)
local node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
if node.name == name then
local param2 = node.param2
node = minetest.get_node(pos)
node.param2 = param2
minetest.swap_node(pos, node)
else
minetest.remove_node(pos)
return true
end
end
-- Top
minetest.register_node("techage:heatexchanger3", {
description = S("TA4 Heat Exchanger 3"),
tiles = {
-- up, down, right, left, back, front
"techage_filling_ta4.png^techage_frame_ta4_top.png",
"techage_hole_ta4.png",
"techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_hole_pipe.png",
"techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_hole_pipe.png",
"techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png",
"techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png",
},
after_place_node = function(pos, placer)
return orientate_node(pos, "techage:heatexchanger2")
end,
paramtype2 = "facedir",
groups = {crumbly = 2, cracky = 2, snappy = 2},
on_rotate = screwdriver.disallow,
is_ground_content = false,
sounds = default.node_sound_metal_defaults(),
})
-- Middle node with the formspec from the bottom node
minetest.register_node("techage:heatexchanger2", {
description = S("TA4 Heat Exchanger 2"),
tiles = {
-- up, down, right, left, back, front
"techage_hole_ta4.png",
"techage_hole_ta4.png",
"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_tes_turb.png",
"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_tes_core.png",
"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png",
"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png",
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1.5/2, -1/2, 1/2, 1/2, 1/2},
},
after_place_node = function(pos, placer)
if orientate_node(pos, "techage:heatexchanger1") then
return true
end
local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z}
local nvm = techage.get_nvm(pos1)
local own_num = M(pos1):get_string("node_number")
M(pos):set_string("formspec", formspec(State, pos1, nvm))
M(pos):set_string("infotext", S("TA4 Heat Exchanger").." "..own_num)
end,
on_rightclick = function(pos)
local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z}
local nvm = techage.get_nvm(pos1)
M(pos):set_string("formspec", formspec(State, pos1, nvm))
end,
on_receive_fields = function(pos, formname, fields, player)
if minetest.is_protected(pos, player:get_player_name()) then
return
end
local pos1 = {x = pos.x, y = pos.y - 1, z = pos.z}
local nvm = techage.get_nvm(pos1)
State:state_button_event(pos1, nvm, fields)
M(pos):set_string("formspec", formspec(State, pos1, nvm))
end,
paramtype2 = "facedir",
groups = {crumbly = 2, cracky = 2, snappy = 2},
on_rotate = screwdriver.disallow,
is_ground_content = false,
sounds = default.node_sound_metal_defaults(),
})
-- Base
minetest.register_node("techage:heatexchanger1", {
description = S("TA4 Heat Exchanger 1"),
tiles = {
-- up, down, right, left, back, front
"techage_hole_ta4.png^techage_appl_arrow_white.png",
"techage_filling_ta4.png^techage_frame_ta4.png",
"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_pipe.png",
"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_pipe.png",
"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png",
"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png",
},
on_timer = node_timer,
paramtype2 = "facedir",
groups = {crumbly = 2, cracky = 2, snappy = 2},
on_rotate = screwdriver.disallow,
is_ground_content = false,
sounds = default.node_sound_metal_defaults(),
})
techage.power.register_node({"techage:heatexchanger1"}, {
conn_sides = {"F", "B"},
power_network = Cable,
after_place_node = function(pos, placer)
local nvm = techage.get_nvm(pos)
local meta = M(pos)
local own_num = techage.add_node(pos, "techage:heatexchanger1")
meta:set_string("owner", placer:get_player_name())
State:node_init(pos, nvm, own_num)
nvm.capa = 0
end,
})
Pipe:add_secondary_node_names({"techage:heatexchanger1", "techage:heatexchanger3"})
-- for logical communication
techage.register_node({"techage:heatexchanger1"}, {
on_recv_message = function(pos, src, topic, payload)
local nvm = techage.get_nvm(pos)
if topic == "load" then
return techage.power.percent(nvm.capa_max, nvm.capa)
elseif topic == "size" then
return (nvm.capa_max or 0) / GRVL_CAPA
else
return State:on_receive_message(pos, topic, payload)
end
end,
})
minetest.register_craft({
output = "techage:heatexchanger1",
recipe = {
{"default:tin_ingot", "techage:electric_cableS", "default:steel_ingot"},
{"techage:ta4_pipeS", "basic_materials:gear_steel", "techage:ta4_pipeS"},
{"", "techage:baborium_ingot", ""},
},
})
minetest.register_craft({
output = "techage:heatexchanger2",
recipe = {
{"default:tin_ingot", "", "default:steel_ingot"},
{"", "techage:ta4_wlanchip", ""},
{"", "techage:baborium_ingot", ""},
},
})
minetest.register_craft({
output = "techage:heatexchanger3",
recipe = {
{"default:tin_ingot", "dye:blue", "default:steel_ingot"},
{"techage:ta4_pipeS", "basic_materials:gear_steel", "techage:ta4_pipeS"},
{"", "techage:baborium_ingot", ""},
},
})

View File

@ -135,6 +135,8 @@ end
local function tubelib2_on_update2(pos, outdir, tlib2, node) local function tubelib2_on_update2(pos, outdir, tlib2, node)
power.update_network(pos, outdir, tlib2) power.update_network(pos, outdir, tlib2)
local nvm = techage.get_nvm(pos)
nvm.running = false
end end
local function can_start(pos, nvm) local function can_start(pos, nvm)
@ -179,7 +181,7 @@ local function node_timer(pos, elapsed)
nvm.needed = taken - given nvm.needed = taken - given
nvm.capa = in_range(nvm.capa + nvm.needed, 0, nvm.capa_max) nvm.capa = in_range(nvm.capa + nvm.needed, 0, nvm.capa_max)
glowing(pos, nvm, nvm.capa > nvm.capa_max * 0.8) glowing(pos, nvm, nvm.capa > nvm.capa_max * 0.8)
print("node_timer TES "..P2S(pos), nvm.needed, nvm.capa, nvm.capa_max) --print("node_timer TES "..P2S(pos), nvm.needed, nvm.capa, nvm.capa_max)
return true return true
end end

View File

@ -8,7 +8,7 @@
GPL v3 GPL v3
See LICENSE.txt for more information See LICENSE.txt for more information
TA4 Electrolyzer v2 TA4 Electrolyzer
]]-- ]]--
@ -64,8 +64,8 @@ local function stop_node(pos, nvm, state)
end end
local State = techage.NodeStates:new({ local State = techage.NodeStates:new({
node_name_passive = "techage:ta4_electrolyzer2", node_name_passive = "techage:ta4_electrolyzer",
node_name_active = "techage:ta4_electrolyzer2_on", node_name_active = "techage:ta4_electrolyzer_on",
cycle_time = CYCLE_TIME, cycle_time = CYCLE_TIME,
standby_ticks = STANDBY_TICKS, standby_ticks = STANDBY_TICKS,
formspec_func = formspec, formspec_func = formspec,
@ -90,7 +90,7 @@ end
local function generating(pos, nvm) local function generating(pos, nvm)
nvm.num_pwr_units = nvm.num_pwr_units or 0 nvm.num_pwr_units = nvm.num_pwr_units or 0
nvm.countdown = nvm.countdown or 0 nvm.countdown = nvm.countdown or 0
print("electrolyzer", nvm.running, nvm.taken, nvm.num_pwr_units, nvm.liquid.amount) --print("electrolyzer", nvm.running, nvm.taken, nvm.num_pwr_units, nvm.liquid.amount)
if nvm.taken > 0 then if nvm.taken > 0 then
nvm.num_pwr_units = nvm.num_pwr_units + (nvm.taken or 0) nvm.num_pwr_units = nvm.num_pwr_units + (nvm.taken or 0)
if nvm.num_pwr_units >= PWR_UNITS_PER_HYDROGEN_ITEM then if nvm.num_pwr_units >= PWR_UNITS_PER_HYDROGEN_ITEM then
@ -140,7 +140,7 @@ local function after_place_node(pos)
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
nvm.running = false nvm.running = false
nvm.num_pwr_units = 0 nvm.num_pwr_units = 0
local number = techage.add_node(pos, "techage:ta4_electrolyzer2") local number = techage.add_node(pos, "techage:ta4_electrolyzer")
State:node_init(pos, nvm, number) State:node_init(pos, nvm, number)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
M(pos):set_int("in_dir", techage.side_to_indir("R", node.param2)) M(pos):set_int("in_dir", techage.side_to_indir("R", node.param2))
@ -196,7 +196,7 @@ local liquid_def = {
end end
} }
minetest.register_node("techage:ta4_electrolyzer2", { minetest.register_node("techage:ta4_electrolyzer", {
description = S("TA4 Electrolyzer"), description = S("TA4 Electrolyzer"),
tiles = { tiles = {
-- up, down, right, left, back, front -- up, down, right, left, back, front
@ -231,7 +231,7 @@ minetest.register_node("techage:ta4_electrolyzer2", {
is_ground_content = false, is_ground_content = false,
}) })
minetest.register_node("techage:ta4_electrolyzer2_on", { minetest.register_node("techage:ta4_electrolyzer_on", {
description = S("TA4 Electrolyzer"), description = S("TA4 Electrolyzer"),
tiles = { tiles = {
-- up, down, right, left, back, front -- up, down, right, left, back, front
@ -278,12 +278,12 @@ minetest.register_node("techage:ta4_electrolyzer2_on", {
light_source = 6, light_source = 6,
}) })
Cable:add_secondary_node_names({"techage:ta4_electrolyzer2", "techage:ta4_electrolyzer2_on"}) Cable:add_secondary_node_names({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on"})
Pipe:add_secondary_node_names({"techage:ta4_electrolyzer2", "techage:ta4_electrolyzer2_on"}) Pipe:add_secondary_node_names({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on"})
techage.register_node({"techage:ta4_electrolyzer2", "techage:ta4_electrolyzer2_on"}, liquid.recv_message) techage.register_node({"techage:ta4_electrolyzer", "techage:ta4_electrolyzer_on"}, liquid.recv_message)
minetest.register_craft({ minetest.register_craft({
output = "techage:ta4_electrolyzer2", output = "techage:ta4_electrolyzer",
recipe = { recipe = {
{'default:steel_ingot', 'dye:blue', 'default:steel_ingot'}, {'default:steel_ingot', 'dye:blue', 'default:steel_ingot'},
{'techage:electric_cableS', 'default:glass', 'techage:tubeS'}, {'techage:electric_cableS', 'default:glass', 'techage:tubeS'},

View File

@ -83,11 +83,6 @@ local function has_hydrogen(nvm)
return nvm.num_pwr_units > 0 or (nvm.liquid.amount > 0 and nvm.liquid.name == "techage:hydrogen") return nvm.num_pwr_units > 0 or (nvm.liquid.amount > 0 and nvm.liquid.name == "techage:hydrogen")
end end
local function contains_hydrogen(pos)
local inv = M(pos):get_inventory()
return inv:contains_item("src", ItemStack("techage:hydrogen"))
end
local function consuming(pos, nvm) local function consuming(pos, nvm)
if nvm.num_pwr_units <= 0 then if nvm.num_pwr_units <= 0 then
nvm.num_pwr_units = nvm.num_pwr_units + PWR_UNITS_PER_HYDROGEN_ITEM nvm.num_pwr_units = nvm.num_pwr_units + PWR_UNITS_PER_HYDROGEN_ITEM
@ -99,7 +94,7 @@ end
-- converts hydrogen into power -- converts hydrogen into power
local function node_timer(pos, elapsed) local function node_timer(pos, elapsed)
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
print("fuelcell", nvm.running, nvm.given, nvm.num_pwr_units) --print("fuelcell", nvm.running, nvm.given, nvm.num_pwr_units)
if has_hydrogen(nvm) then if has_hydrogen(nvm) then
local outdir = M(pos):get_int("outdir") local outdir = M(pos):get_int("outdir")
nvm.given = power.generator_alive(pos, Cable, CYCLE_TIME, outdir) nvm.given = power.generator_alive(pos, Cable, CYCLE_TIME, outdir)

View File

@ -36,18 +36,18 @@ minetest.register_craftitem("techage:gasoline", {
}) })
minetest.register_craftitem("techage:gas", { minetest.register_craftitem("techage:gas", {
description = S("TA3 Gas"), description = S("TA3 Propane"),
inventory_image = "techage_gas_inv.png", inventory_image = "techage_gas_inv.png",
}) })
minetest.register_craftitem("techage:ta3_cylinder_small_gas", { minetest.register_craftitem("techage:ta3_cylinder_small_gas", {
description = S("Gas Cylinder Small"), description = S("Propane Cylinder Small"),
inventory_image = "techage_gas_cylinder_small.png^[colorize:#e51818:120", inventory_image = "techage_gas_cylinder_small.png^[colorize:#e51818:120",
stack_max = 1, stack_max = 1,
}) })
minetest.register_craftitem("techage:ta3_cylinder_large_gas", { minetest.register_craftitem("techage:ta3_cylinder_large_gas", {
description = S("Gas Cylinder Large"), description = S("Propane Cylinder Large"),
inventory_image = "techage_gas_cylinder_large.png^[colorize:#e51818:120", inventory_image = "techage_gas_cylinder_large.png^[colorize:#e51818:120",
stack_max = 1, stack_max = 1,
}) })

View File

@ -46,6 +46,7 @@ end
-- store network ID on each pump like node -- store network ID on each pump like node
local function store_netID(pos, outdir, netID) local function store_netID(pos, outdir, netID)
networks.connection_walk(pos, outdir, Pipe, function(pos, indir, node) networks.connection_walk(pos, outdir, Pipe, function(pos, indir, node)
print("store_netID", dump(indir))
local ntype = net_def(pos, "pipe2").ntype local ntype = net_def(pos, "pipe2").ntype
if ntype and ntype == "pump" then if ntype and ntype == "pump" then
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
@ -84,6 +85,7 @@ local function get_netID(pos, outdir)
end end
local function get_network_table(pos, outdir, ntype) local function get_network_table(pos, outdir, ntype)
print("get_network_table", outdir)
local netID = get_netID(pos, outdir) local netID = get_netID(pos, outdir)
if netID then if netID then
local netw = networks.get_network("pipe2", netID) local netw = networks.get_network("pipe2", netID)

View File

@ -65,6 +65,7 @@ local State4 = techage.NodeStates:new({
local function pumping(pos, nvm, state, capa) local function pumping(pos, nvm, state, capa)
local outdir = M(pos):get_int("outdir") local outdir = M(pos):get_int("outdir")
local starter = get_starter_name(pos) local starter = get_starter_name(pos)
print("pumping", outdir, Flip[outdir])
local taken, name = liquid.take(pos, Flip[outdir], nil, capa, starter) local taken, name = liquid.take(pos, Flip[outdir], nil, capa, starter)
if taken > 0 then if taken > 0 then
local leftover = liquid.put(pos, outdir, name, taken, starter) local leftover = liquid.put(pos, outdir, name, taken, starter)

View File

@ -119,6 +119,8 @@ Power Source=Stromquelle
Primary available=Primär verfügbar Primary available=Primär verfügbar
Primary needed=Primär benötigt Primary needed=Primär benötigt
Priv missing=Rechte fehlen Priv missing=Rechte fehlen
Propane Cylinder Large=Propangasflasche groß
Propane Cylinder Small=Propangasflasche klein
Pumpjack=Ölpumpe Pumpjack=Ölpumpe
Punch the block to make the area visible.=Schlage auf den Bock um den Bereich anzuzeigen. Punch the block to make the area visible.=Schlage auf den Bock um den Bereich anzuzeigen.
Pusher=Schieber Pusher=Schieber
@ -214,7 +216,6 @@ TA3 Fuel Oil=TA3 Schweröl
TA3 Fuel Oil Barrel=TA3 Schwerölfass TA3 Fuel Oil Barrel=TA3 Schwerölfass
TA3 Fuel Oil Canister=TA3 Schwerölkanister TA3 Fuel Oil Canister=TA3 Schwerölkanister
TA3 Furnace Oil Burner=TA3 Ofen-Ölbrenner TA3 Furnace Oil Burner=TA3 Ofen-Ölbrenner
TA3 Gas=TA3 Gas
TA3 Gasoline=TA3 Benzin TA3 Gasoline=TA3 Benzin
TA3 Gasoline Barrel=TA3 Benzinfass TA3 Gasoline Barrel=TA3 Benzinfass
TA3 Gasoline Canister=TA3 Benzinkanister TA3 Gasoline Canister=TA3 Benzinkanister
@ -236,6 +237,7 @@ TA3 Player Detector=TA3 Spieler Detektor
TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox
TA3 Power Station Oil Burner=TA3 Kraftwerks-Ölbrenner TA3 Power Station Oil Burner=TA3 Kraftwerks-Ölbrenner
TA3 Power Terminal=TA3 Strom Terminal TA3 Power Terminal=TA3 Strom Terminal
TA3 Propane=TA3 Propan
TA3 Protected Chest=TA3 Gesicherte Kiste TA3 Protected Chest=TA3 Gesicherte Kiste
TA3 Pump=TA3 Pumpe TA3 Pump=TA3 Pumpe
TA3 Repeater=TA3 Wiederholer TA3 Repeater=TA3 Wiederholer

View File

@ -1,9 +1,11 @@
# textdomain: techage # textdomain: techage
#### TA3 Terminal ####@n@nSend commands to your machines@nand output text messages from your@nmachines to the Terminal.@n@nCommand syntax:@n cmd <num> <cmnd>@n@nexample: cmd 181 on@n<num> is the number of the node to which the command is sent@n'on' is the command to turn machines/nodes on@nFurther commands can be retrieved by clicking on@nmachines/nodes with the Techage Info Tool.@n@nLocal commands:@n- clear @= clear screen@n- help @= this message@n- pub @= switch to public use@n- priv @= switch to private use@nTo program a user button with a command:@n set <button-num> <button-text> <command>@ne.g. 'set 1 ON cmd 123 on'@n= #### TA3 Terminal ####@n@nSend commands to your machines@nand output text messages from your@nmachines to the Terminal.@n@nCommand syntax:@n cmd <num> <cmnd>@n@nexample: cmd 181 on@n<num> is the number of the node to which the command is sent@n'on' is the command to turn machines/nodes on@nFurther commands can be retrieved by clicking on@nmachines/nodes with the Techage Info Tool.@n@nLocal commands:@n- clear @= clear screen@n- help @= this message@n- pub @= switch to public use@n- priv @= switch to private use@nTo program a user button with a command:@n set <button-num> <button-text> <command>@ne.g. 'set 1 ON cmd 123 on'@n=
(Num. nodes loaded / max. : Power current / max.)=(Anz. Blöcke geladen / max. : Strom aktuell / max.) Active:=Aktiv:
All nodes:=Alle Blöcke:
Allow to dig/place Techage power lines nearby power poles=Erlaubt TODO Allow to dig/place Techage power lines nearby power poles=Erlaubt TODO
Aluminum=Aluminium Aluminum=Aluminium
Area already loaded or max. number of Forceload Blocks reached!=Bereich bereits geladen oder maximale Anzahl von Forceload Blöcken erreicht!
Ash=Asche Ash=Asche
Autocrafter=Autocrafter Autocrafter=Autocrafter
Axle Power Source=Achsenkraftquelle Axle Power Source=Achsenkraftquelle
@ -29,30 +31,56 @@ Biome=Biom
Block configured items for open ports=Blockiere konfigurierte Gegenstände für offene Ausgänge Block configured items for open ports=Blockiere konfigurierte Gegenstände für offene Ausgänge
Build derrick=Errichte Ölturm Build derrick=Errichte Ölturm
Compressed Gravel=Komprimiertes Kies Compressed Gravel=Komprimiertes Kies
Consum. 1=Konsum. 1
Consum. 2=Konsum. 2
Depth=Tiefe Depth=Tiefe
Digging depth=Grabungstiefe
Dirt with Ash=Erde mit Asche Dirt with Ash=Erde mit Asche
Distributor=Verteiler Distributor=Verteiler
Doser=Dosierer
Drill Bit=Bohrstange Drill Bit=Bohrstange
Drill area is protected=Bohrbereich ist geschützt
Drill bits missing=Bohrgestänge fehlt
Ele Power Source=Ele Kraftquelle Ele Power Source=Ele Kraftquelle
Electricity=Strom
Electrolyzer=Eletrolyseur
Electronic Fab=Elektronikfabrik Electronic Fab=Elektronikfabrik
Enter=Eingeben Enter=Eingeben
Epoxide Resin=Epoxidharz Epoxide Resin=Epoxidharz
Epoxide Resin Barrel=Epoxidharz Fass Epoxide Resin Barrel=Epoxidharz Fass
Epoxide Resin Canister=Epoxidharz Kanister Epoxide Resin Canister=Epoxidharz Kanister
Error=Fehler Error=Fehler
Firebox=Feuerkasten
Flint and Iron=Flint and Iron Flint and Iron=Flint and Iron
Flowing Oil=Fließendes Öl Flowing Oil=Fließendes Öl
Flywheel=Schwungrad
Force order of filter items=Erzwinge Reihenfolge Force order of filter items=Erzwinge Reihenfolge
Fuel Cell=Brennstoffzelle
Fuel Menu=Brennstoff Menü
Furnace Top=Ofenoberteil Furnace Top=Ofenoberteil
Gas Cylinder Large=Gasflasche groß
Gas Cylinder Small=Gasflasche klein
Genera. 1=Genera. 1
Genera. 2=Genera. 2
Generator=Generator
Gibbsite Powder=Gibbsit Pulver Gibbsite Powder=Gibbsit Pulver
Gravel Rinser=Kiesspüler Gravel Rinser=Kiesspüler
Gravel Sieve=Kiessieb Gravel Sieve=Kiessieb
Grinder=Mühle Grinder=Mühle
Grinding=Mahlen Grinding=Mahlen
Heat=Hitze Heat=Hitze
Heat Exchanger=Wärmetauscher
Hydrogen Cylinder Large=Wasserstoffflasche groß
Hydrogen Cylinder Small=Wasserstoffflasche klein
In use:=In Benutzung:
Insert destination node number(s)=Gebe Zielnummer(n) ein Insert destination node number(s)=Gebe Zielnummer(n) ein
Inverter=Wechselrichter
Leave Powder=Laub Pulver Leave Powder=Laub Pulver
Liquid Filler=Einfülltrichter
Liquid Sampler=Flüssigkeitensammler Liquid Sampler=Flüssigkeitensammler
Liquid Tank=Flüssigkeitstank
List of your Forceload Blocks:=Liste der Forceload Blöcke
Load=Ladung
Lye=Lauge Lye=Lauge
Lye Barrel=Lauge Fass Lye Barrel=Lauge Fass
Lye Canister=Lauge Kanister Lye Canister=Lauge Kanister
@ -69,25 +97,33 @@ Meridium Sword=Meridium Schwert
More water expected (2 m deep)!=Mehr Wasser erwartet (2 m tief) More water expected (2 m deep)!=Mehr Wasser erwartet (2 m tief)
Needle Powder=Nadel Pulver Needle Powder=Nadel Pulver
Network Data=Netzwerkdaten Network Data=Netzwerkdaten
No network or active generator available!=Kein Stromnetz oder aktiver Generator verfügbar
No plan available=Kein Plan verfügar No plan available=Kein Plan verfügar
No wind at this altitude!=Kein Wind auf dieser Höhe No wind at this altitude!=Kein Wind auf dieser Höhe
Node owner=Blockbesitzer Node owner=Blockbesitzer
Number of all nodes=Anzahl aller Blöcke
Number of nodes=Anzahl Blöcke Number of nodes=Anzahl Blöcke
Oil Drill Box=Ölbohrkiste Oil Drill Box=Ölbohrkiste
Oil Pumpjack=Ölpumpe Oil Pumpjack=Ölpumpe
Oil Source=Erdöl Oil Source=Erdöl
Oil Tank=Öltank Oil Tank=Öltank
Oil amount=Ölmenge Oil amount=Ölmenge
Other consumers=Weitere Verbraucher
Outp=Ergeb. Outp=Ergeb.
Plan=Plan Plan=Plan
Plastic Granules=Plastikgranulat Plastic Granules=Plastikgranulat
Position=Position Position=Position
Position temperature=Positionstemperatur Position temperature=Positionstemperatur
Power=Energie Power AC=Wechselstrom
Power DC=Gleichstrom
Power Source=Stromquelle
Primary available=Primär verfügbar Primary available=Primär verfügbar
Primary needed=Primär benötigt Primary needed=Primär benötigt
Priv missing=Rechte fehlen
Pumpjack=Ölpumpe
Punch the block to make the area visible.=Schlage auf den Bock um den Bereich anzuzeigen.
Pusher=Schieber Pusher=Schieber
Quarry=Steinbrecher
Quarry area is protected=Bereich ist geschützt
Recipe=Rezept Recipe=Rezept
Red Mud=Rotschlamm Red Mud=Rotschlamm
Red Mud Barrel=Rotschlamm Fass Red Mud Barrel=Rotschlamm Fass
@ -99,8 +135,11 @@ Save=Speichern
Secondary available=Sekundär verfügbar Secondary available=Sekundär verfügbar
Secondary needed=Sekundär benötigt Secondary needed=Sekundär benötigt
Send signal if nodes have been:=Sende ein Signal falls Blöcke: Send signal if nodes have been:=Sende ein Signal falls Blöcke:
Show all forceload blocks in a 64x64x64 range=Zeige alle Forceload Blöcke im Umkreis von 64x64x64 Blöcken
Sieved Basalt Gravel=Basaltkies gesiebt Sieved Basalt Gravel=Basaltkies gesiebt
Sieved Gravel=Gesiebtes Kies Sieved Gravel=Gesiebtes Kies
Start level=Startebene
Start level @= 0@nmeans the same Y-level@nas the quarry is placed=Startebene @= 0@nbedeutet gleiche Y-Ebene@nwie der Steinbrecher
Steam Power Source=Dampfenergiequelle Steam Power Source=Dampfenergiequelle
Store=Speichern Store=Speichern
Switched to private use!=Zur privaten Nutzung umgeschaltet Switched to private use!=Zur privaten Nutzung umgeschaltet
@ -116,6 +155,7 @@ TA Industrial Lamp 2=TA Industrielampe 2
TA Industrial Lamp 3=TA Industrielampe 3 TA Industrial Lamp 3=TA Industrielampe 3
TA Junction Pipe=TA Leitungskupplung TA Junction Pipe=TA Leitungskupplung
TA Lamp=TA Lampe TA Lamp=TA Lampe
TA Liquid Filler=TA Einfülltrichter
TA Pipe=TA Leitung (Flüssigkeiten) TA Pipe=TA Leitung (Flüssigkeiten)
TA Power Line=TA Stromleitung TA Power Line=TA Stromleitung
TA Power Pole=TA Strommast TA Power Pole=TA Strommast
@ -130,7 +170,6 @@ TA1 Burning=TA1 Brennen
TA1 Charcoal=TA1 Holzkohle TA1 Charcoal=TA1 Holzkohle
TA1 Diamond Hammer (smash stone to gravel)=TA1 Diamanthammer (zerschlage Stein zu Kies) TA1 Diamond Hammer (smash stone to gravel)=TA1 Diamanthammer (zerschlage Stein zu Kies)
TA1 Gravel Sieve=TA1 Kiessieb TA1 Gravel Sieve=TA1 Kiessieb
TA1 Hopper=TA1 Trichter
TA1 Iron Ingot=TA1 Eisenbarren TA1 Iron Ingot=TA1 Eisenbarren
TA1 Lighter=TA1 Anzünder TA1 Lighter=TA1 Anzünder
TA1 Melting=TA1 Schmelzen TA1 Melting=TA1 Schmelzen
@ -149,7 +188,7 @@ TA2 Gearbox=TA2 Getriebeblock
TA2 Gravel Sieve=TA2 Kiessieb TA2 Gravel Sieve=TA2 Kiessieb
TA2 Protected Chest=TA2 Gesicherte Kiste TA2 Protected Chest=TA2 Gesicherte Kiste
TA2 Steam Pipe=TA2 Dampfleitung TA2 Steam Pipe=TA2 Dampfleitung
TA3 Akku=TA3 Akku TA3 Accu Box=Akkublock
TA3 Akku Box=TA3 Akku Block TA3 Akku Box=TA3 Akku Block
TA3 Bitumen=TA3 Bitumen TA3 Bitumen=TA3 Bitumen
TA3 Bitumen Barrel=TA3 Bitumenfass TA3 Bitumen Barrel=TA3 Bitumenfass
@ -161,7 +200,6 @@ TA3 Button/Switch=TA3 Taster/Schalter
TA3 Canister=TA3 Kanister TA3 Canister=TA3 Kanister
TA3 Cart Detector=TA3 Wagen Detektor TA3 Cart Detector=TA3 Wagen Detektor
TA3 Coal Power Station Firebox=TA3 Kohlekraftwerks-Feuerbox TA3 Coal Power Station Firebox=TA3 Kohlekraftwerks-Feuerbox
TA3 Coal/oil=TA3 Kohle/Öl
TA3 Cooler=TA3 Kühler TA3 Cooler=TA3 Kühler
TA3 Derrick=TA3 Bohrturm TA3 Derrick=TA3 Bohrturm
TA3 Detector=TA3 Detektor TA3 Detector=TA3 Detektor
@ -175,7 +213,6 @@ TA3 Ele Fab=TA3 E-Fabrik
TA3 Fuel Oil=TA3 Schweröl TA3 Fuel Oil=TA3 Schweröl
TA3 Fuel Oil Barrel=TA3 Schwerölfass TA3 Fuel Oil Barrel=TA3 Schwerölfass
TA3 Fuel Oil Canister=TA3 Schwerölkanister TA3 Fuel Oil Canister=TA3 Schwerölkanister
TA3 Funnel=TA3 Trichter
TA3 Furnace Oil Burner=TA3 Ofen-Ölbrenner TA3 Furnace Oil Burner=TA3 Ofen-Ölbrenner
TA3 Gas=TA3 Gas TA3 Gas=TA3 Gas
TA3 Gasoline=TA3 Benzin TA3 Gasoline=TA3 Benzin
@ -193,6 +230,7 @@ TA3 Oil Barrel=TA3 Ölfass
TA3 Oil Canister=TA3 Erdölkanister TA3 Oil Canister=TA3 Erdölkanister
TA3 Oil Explorer=TA3 Ölexplorer TA3 Oil Explorer=TA3 Ölexplorer
TA3 Oil Reboiler=TA3 Aufkocher TA3 Oil Reboiler=TA3 Aufkocher
TA3 Oil Reboiler: blocked=TA3 Aufkocher: blockiert
TA3 Oil Storage=TA3 Öl Speicher TA3 Oil Storage=TA3 Öl Speicher
TA3 Player Detector=TA3 Spieler Detektor TA3 Player Detector=TA3 Spieler Detektor
TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox
@ -213,7 +251,6 @@ TA4 Carbon Fiber=TA4 Kohlefaser
TA4 Derrick=TA4 Bohrturm TA4 Derrick=TA4 Bohrturm
TA4 Doser=TA4 Dosierer TA4 Doser=TA4 Dosierer
TA4 Electrolyzer=TA4 Elektrolyseur TA4 Electrolyzer=TA4 Elektrolyseur
TA4 Energy Storage=TA4 Energiespeicher
TA4 Fuel Cell=TA4 Brennstoffzelle TA4 Fuel Cell=TA4 Brennstoffzelle
TA4 Fuel Cell Stack=Brennstoffzellenstapel TA4 Fuel Cell Stack=Brennstoffzellenstapel
TA4 Furnace Heater=TA4 Ofenheizung TA4 Furnace Heater=TA4 Ofenheizung
@ -235,17 +272,18 @@ TA4 Reactor Filler Pipe=TA4 Reaktor Einfüllstutzen
TA4 Reactor Stand=TA4 Reaktor Ständer TA4 Reactor Stand=TA4 Reaktor Ständer
TA4 Rotor Blade=TA4 Rotorblatt TA4 Rotor Blade=TA4 Rotorblatt
TA4 Silicon Wafer=TA4 Silizium-Wafer TA4 Silicon Wafer=TA4 Silizium-Wafer
TA4 Silo=Silo
TA4 Solar Carrier Module=TA4 Solar Trägermodul TA4 Solar Carrier Module=TA4 Solar Trägermodul
TA4 Solar Carrier Module B=TA4 Solar Trägermodul U TA4 Solar Carrier Module B=TA4 Solar Trägermodul U
TA4 Solar Carrier Module T=TA4 Solar Trägermodul O TA4 Solar Carrier Module T=TA4 Solar Trägermodul O
TA4 Solar Inverter=TA4 Solar Wechselrichter TA4 Solar Inverter=TA4 Solar Wechselrichter
TA4 Solar Inverter AC=TA4 Solar Wechselrichter AC
TA4 Solar Inverter DC=TA4 Solar Wechselrichter DC TA4 Solar Inverter DC=TA4 Solar Wechselrichter DC
TA4 Solar Module=TA4 Solarmodul TA4 Solar Module=TA4 Solarmodul
TA4 Streetlamp Solar Cell=TA4 Straßenlampen-Solarzelle TA4 Streetlamp Solar Cell=TA4 Straßenlampen-Solarzelle
TA4 Tank=TA4 Tank TA4 Tank=TA4 Tank
TA4 Turbine=TA4 Turbine TA4 Turbine=TA4 Turbine
TA4 WLAN Chip=TA4 WLAN Chip TA4 WLAN Chip=TA4 WLAN Chip
TA4 Water Pump=Wasserpumpe
TA4 Wind Turbine=TA4 Windkraftanlage TA4 Wind Turbine=TA4 Windkraftanlage
TA4 Wind Turbine Nacelle=TA4 Windkraftanlagengondel TA4 Wind Turbine Nacelle=TA4 Windkraftanlagengondel
TA4 Wind Turbine Signal Lamp=TA4 Windkraftanlagenlampe TA4 Wind Turbine Signal Lamp=TA4 Windkraftanlagenlampe
@ -261,14 +299,26 @@ TechAge Signal Lamp=TechAge Signallampe
TechAge Signal Lamp (can be colored)=TechAge Signallampe (kann gefärbt werden) TechAge Signal Lamp (can be colored)=TechAge Signallampe (kann gefärbt werden)
TechAge Steel Mat=TechAge Stahlmatte TechAge Steel Mat=TechAge Stahlmatte
TechAge Trowel=TechAge Kelle TechAge Trowel=TechAge Kelle
Techage Forceload Block=Techage Forceload Block
The network is overloaded!=Das Stromnetz ist überlastet!
The network load is almost at the limit!=Das Stromnetz ist ziemlich am Limit!
The wind turbines are too close together!=Die Windkraftanlagen stehen zu eng beisammen! The wind turbines are too close together!=Die Windkraftanlagen stehen zu eng beisammen!
Thermal=Wärme
Time=Zeit Time=Zeit
Tiny Generator=Kleingenerator
To add fuel punch@nthis block@nwith a fuel container=Um Brennstoff nachzufüllen,@nschlage mit einem Kraftstoffbehälter@nauf den Block
To add liquids punch@nthe tank@nwith a liquid container=Um Flüssigkeit nachzufüllen,@nschlage mit einem Flüssigkeitsbehälter@nauf den Block
To add water punch@nthe boiler@nwith a water bucket=Um Wasser nachzufüllen,@nschlage mit einem Wassereimer@nauf den Block
Turned on:=Eingeschaltet:
Update=Update Update=Update
Usmium Nuggets=Usmium Nuggets Usmium Nuggets=Usmium Nuggets
Usmium Powder=Usmium Pulver Usmium Powder=Usmium Pulver
WLAN Chip=WLAN Chip WLAN Chip=WLAN Chip
Water=Wasser Water=Wasser
Water Barrel=Wasserfass Water Barrel=Wasserfass
Water Boiler=Wasserboiler
Water Pump=Wasserpumpe
[Bucket] Lava can only be placed below sea level!=Lava kann nur unterhalb der Meerehöhe platziert werden!
[TA4 Wind Turbine]=[TA4 Windkraftanlage] [TA4 Wind Turbine]=[TA4 Windkraftanlage]
[TA] Area is protected!=[TA] Bereich ist geschützt [TA] Area is protected!=[TA] Bereich ist geschützt
[TA] Derrick is being built!=[TA] Bohrturm wird errichtet [TA] Derrick is being built!=[TA] Bohrturm wird errichtet
@ -279,24 +329,36 @@ Water Barrel=Wasserfass
[TechAge Programmer] Unknown node on=[TechAge Programmer] Unbekannter Block bei [TechAge Programmer] Unknown node on=[TechAge Programmer] Unbekannter Block bei
[TechAge Programmer] foreign or unknown node!=[TechAge Programmer] Fremder oder unbekannter Block! [TechAge Programmer] foreign or unknown node!=[TechAge Programmer] Fremder oder unbekannter Block!
[TechAge Programmer] node programmed!=[TechAge Programmer] Nummer(n) programmiert! [TechAge Programmer] node programmed!=[TechAge Programmer] Nummer(n) programmiert!
[TechAge Programmer] number=[TechAge Programmer] Nummer= [TechAge Programmer] number=[TechAge Programmer] Nummer
[TechAge Programmer] programmer reset=[TechAge Programmer] Programmer zurück gesetzt [TechAge Programmer] programmer reset=[TechAge Programmer] Programmer zurück gesetzt
\\[ku\\]=\\[ku\\]
accept=akzeptieren accept=akzeptieren
added=hinzugefügt wird added=hinzugefügt wird
added or removed=hinzugefügt oder entfernt wird added or removed=hinzugefügt oder entfernt wird
block can't be dug=Block kann nicht abgebaut werden
commands like: help=Kommandos wie: help commands like: help=Kommandos wie: help
connected with=verbunden mit connected with=verbunden mit
did you check the plan?=hast du den Plan geprüft?
empty=leer empty=leer
full=voll
inlet/pipe error=Einlass/Röhrenfehler
level@==Ebene
light=Licht light=Licht
loaded=geladen
needs power=benötigt Strom
no fuel=kein Kraftstoff
no fuel or no power=kein Strom oder Brennstoff no fuel or no power=kein Strom oder Brennstoff
no oil=Kein Öl
no power=kein Strom no power=kein Strom
no usable water=Kein brauchbares Wasser
off=aus off=aus
on=an on=an
power=Strom pos@==pos@=
power=Energie
reactor defect=Reaktor defekt reactor defect=Reaktor defekt
reactor defect or no power=Reaktor defekt oder kein Strom reactor defect or no power=Reaktor defekt oder kein Strom
reactor has no power=Reaktor hat keinen Strom reactor has no power=Reaktor hat keinen Strom
removed=entfernt removed=entfernt
stopped=gestoppt stopped=gestoppt
water temperature=Wassertemperatur
wrong storage diameter=Falscher Wärmespeicher-Durchmesser
##### not used anymore ##### ##### not used anymore #####

View File

@ -117,6 +117,8 @@ Power Source=
Primary available= Primary available=
Primary needed= Primary needed=
Priv missing= Priv missing=
Propane Cylinder Large=
Propane Cylinder Small=
Pumpjack= Pumpjack=
Punch the block to make the area visible.= Punch the block to make the area visible.=
Pusher= Pusher=
@ -212,7 +214,6 @@ TA3 Fuel Oil=
TA3 Fuel Oil Barrel= TA3 Fuel Oil Barrel=
TA3 Fuel Oil Canister= TA3 Fuel Oil Canister=
TA3 Furnace Oil Burner= TA3 Furnace Oil Burner=
TA3 Gas=
TA3 Gasoline= TA3 Gasoline=
TA3 Gasoline Barrel= TA3 Gasoline Barrel=
TA3 Gasoline Canister= TA3 Gasoline Canister=
@ -234,6 +235,7 @@ TA3 Player Detector=
TA3 Power Station Firebox= TA3 Power Station Firebox=
TA3 Power Station Oil Burner= TA3 Power Station Oil Burner=
TA3 Power Terminal= TA3 Power Terminal=
TA3 Propane=
TA3 Protected Chest= TA3 Protected Chest=
TA3 Pump= TA3 Pump=
TA3 Repeater= TA3 Repeater=

View File

@ -87,7 +87,7 @@ local function set_given(pos, given, tlib_type)
else else
def["given"] = given def["given"] = given
end end
return given return def["given"]
end end
return 0 return 0
end end
@ -126,7 +126,7 @@ function techage.power.power_distribution(network, tlib_type)
network.available2 = get_generator_sum(network.gen2, tlib_type) network.available2 = get_generator_sum(network.gen2, tlib_type)
network.needed1 = get_consumer_sum(network.con1, tlib_type) network.needed1 = get_consumer_sum(network.con1, tlib_type)
network.needed2 = get_consumer_sum(network.con2, tlib_type) network.needed2 = get_consumer_sum(network.con2, tlib_type)
--print(network.available1, network.available2, network.needed1, network.needed2, network.alive) print(network.available1, network.available2, network.needed1, network.needed2, network.alive)
-- store results -- store results
network.on = network.available1 + network.available2 >= network.needed1 network.on = network.available1 + network.available2 >= network.needed1

View File

@ -49,7 +49,7 @@ end
-- store network ID on each node -- store network ID on each node
local function store_netID(pos, outdir, netID, Cable) local function store_netID(pos, outdir, netID, Cable)
networks.connection_walk(pos, outdir, Cable, function(pos, indir, node) networks.connection_walk(pos, outdir, Cable, function(pos, indir, node)
techage.mark_position("singleplayer", pos, "store", "", 2)----------------------------------------- --techage.mark_position("singleplayer", pos, "store", "", 2)-----------------------------------------
--print(node.name, dump(net_def(pos, Cable.tube_type))) --print(node.name, dump(net_def(pos, Cable.tube_type)))
if net_def(pos, Cable.tube_type) then if net_def(pos, Cable.tube_type) then
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
@ -63,7 +63,7 @@ end
local function delete_netID(pos, outdir, Cable) local function delete_netID(pos, outdir, Cable)
local netID = 0 local netID = 0
networks.connection_walk(pos, outdir, Cable, function(pos, indir, node) networks.connection_walk(pos, outdir, Cable, function(pos, indir, node)
techage.mark_position("singleplayer", pos, "delete", "", 2)---------------------------------------- --techage.mark_position("singleplayer", pos, "delete", "", 2)----------------------------------------
if net_def(pos, Cable.tube_type) then if net_def(pos, Cable.tube_type) then
local nvm = techage.get_nvm(pos) local nvm = techage.get_nvm(pos)
if nvm[Cable.tube_type] and nvm[Cable.tube_type]["netID"] then if nvm[Cable.tube_type] and nvm[Cable.tube_type]["netID"] then
@ -108,7 +108,7 @@ function techage.power.get_power(pos, outdir, Cable, inverter)
local sum = 0 local sum = 0
local num_inverter = 0 local num_inverter = 0
networks.connection_walk(pos, outdir, Cable, function(pos, indir, node) networks.connection_walk(pos, outdir, Cable, function(pos, indir, node)
techage.mark_position("singleplayer", pos, "get_power", "", 2)----------------------------------------- --techage.mark_position("singleplayer", pos, "get_power", "", 2)-----------------------------------------
local def = net_def(pos, Cable.tube_type) local def = net_def(pos, Cable.tube_type)
if def and def.on_getpower then if def and def.on_getpower then
sum = sum + def.on_getpower(pos) sum = sum + def.on_getpower(pos)

View File

@ -218,3 +218,5 @@ minetest.register_node("techage:power_terminal", {
Cable:add_secondary_node_names({"techage:power_terminal"}) Cable:add_secondary_node_names({"techage:power_terminal"})
minetest.register_alias("techage:ta3_power_terminal", "techage:power_terminal")

View File

@ -68,7 +68,7 @@ local function formspec(self, pos, nvm)
"box[0,-0.1;5.8,0.5;#c6e8ff]".. "box[0,-0.1;5.8,0.5;#c6e8ff]"..
"label[2.5,-0.1;"..minetest.colorize( "#000000", S("Inverter")).."]".. "label[2.5,-0.1;"..minetest.colorize( "#000000", S("Inverter")).."]"..
power.formspec_label_bar(0, 0.8, S("Power DC"), PWR_PERF, max_power).. power.formspec_label_bar(0, 0.8, S("Power DC"), PWR_PERF, max_power)..
power.formspec_label_bar(3.5, 0.8, S("Power AC"), PWR_PERF, delivered).. power.formspec_label_bar(3.5, 0.8, S("Power AC"), max_power, delivered)..
arrow.. arrow..
"image_button[2.5,3;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. "image_button[2.5,3;1,1;".. self:get_state_button_image(nvm) ..";state_button;]"..
"tooltip[2.5,3;1,1;"..self:get_state_tooltip(nvm).."]" "tooltip[2.5,3;1,1;"..self:get_state_tooltip(nvm).."]"

View File

@ -65,7 +65,7 @@ local function stop_sound(pos)
end end
local function can_start(pos, nvm, state) local function can_start(pos, nvm, state)
if nvm.burn_cycles > 0 or (nvm.liquid and nvm.liquid.amount and nvm.liquid.amount > 0) then if (nvm.burn_cycles or 0) > 0 or (nvm.liquid and nvm.liquid.amount and nvm.liquid.amount > 0) then
return true return true
end end
return S("no fuel") return S("no fuel")
@ -294,6 +294,15 @@ techage.register_node({"techage:tiny_generator", "techage:tiny_generator_on"}, {
if node.name == "techage:tiny_generator_on" then if node.name == "techage:tiny_generator_on" then
play_sound(pos) play_sound(pos)
end end
local inv = M(pos):get_inventory()
if not inv:is_empty("fuel") then
local nvm = techage.get_nvm(pos)
nvm.liquid = nvm.liquid or {}
local count = inv:get_stack("fuel", 1):get_count()
nvm.liquid.amount = (nvm.liquid.amount or 0) + count
nvm.liquid.name = "techage:gasoline"
inv:set_stack("fuel", 1, nil)
end
end, end,
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 881 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 442 B

View File

@ -15,23 +15,23 @@
local M = minetest.get_meta local M = minetest.get_meta
local S = techage.S local S = techage.S
local Nodes2Convert = { local Cable1 = techage.ElectricCable
["techage:detector_off"] = "techage:ta3_detector_off", local Cable2 = techage.TA4_Cable
["techage:detector_on"] = "techage:ta3_detector_on", local Pipe2 = techage.LiquidPipe
["techage:repeater"] = "techage:ta3_repeater", local networks = techage.networks
["techage:button_off"] = "techage:ta3_button_off",
["techage:button_on"] = "techage:ta3_button_on",
}
local function power_data(power) local function network_check(start_pos, Cable, player_name)
local tbl = {} local ndef = techage.networks.net_def(start_pos, Cable.tube_type)
tbl[1] = S("Primary available") ..": "..(power.prim_available or 0) local outdir = nil
tbl[2] = S("Secondary available") ..": "..(power.sec_available or 0) if ndef and ndef.ntype ~= "junc" then
tbl[3] = S("Primary needed") ..": "..(power.prim_needed or 0) outdir = M(start_pos):get_int("outdir")
tbl[4] = S("Secondary needed") ..": "..(power.sec_needed or 0) end
tbl[5] = S("Number of nodes") ..": "..(power.num_nodes or 0) networks.connection_walk(start_pos, outdir, Cable, function(pos, indir, node)
tbl[6] = "" local distance = vector.distance(start_pos, pos)
return table.concat(tbl, "\n") if distance < 50 then
techage.mark_position(player_name, pos, "check", "#ff0000", 6)
end
end)
end end
local function read_state(itemstack, user, pointed_thing) local function read_state(itemstack, user, pointed_thing)
@ -46,21 +46,22 @@ local function read_state(itemstack, user, pointed_thing)
if data then if data then
local name = minetest.get_biome_name(data.biome) local name = minetest.get_biome_name(data.biome)
minetest.chat_send_player(user:get_player_name(), S("Biome")..": "..name..", "..S("Position temperature")..": "..math.floor(data.heat).." ") minetest.chat_send_player(user:get_player_name(), S("Biome")..": "..name..", "..S("Position temperature")..": "..math.floor(data.heat).." ")
if techage.OceanIdTbl[data.biome] then
minetest.chat_send_player(user:get_player_name(), "Suitable for wind turbines")
end
end end
local number = techage.get_node_number(pos) local number = techage.get_node_number(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if Nodes2Convert[node.name] then
if minetest.is_protected(pos, user:get_player_name()) then
return
end
node.name = Nodes2Convert[node.name]
minetest.swap_node(pos, node)
return
end
local ndef = minetest.registered_nodes[node.name] local ndef = minetest.registered_nodes[node.name]
if ndef.networks then
local player_name = user:get_player_name()
if ndef.networks.ele1 then
network_check(pos, Cable1, player_name)
elseif ndef.networks.ele2 then
network_check(pos, Cable2, player_name)
elseif ndef.networks.pipe2 then
network_check(pos, Pipe2, player_name)
end
end
if number then if number then
if ndef and ndef.description then if ndef and ndef.description then
local info = techage.send_single("0", number, "info", nil) local info = techage.send_single("0", number, "info", nil)
@ -102,13 +103,7 @@ local function read_state(itemstack, user, pointed_thing)
return itemstack return itemstack
end end
elseif ndef and ndef.description then elseif ndef and ndef.description then
if ndef.is_power_available then if ndef.techage_info then
techage.power.mark_nodes(user:get_player_name(), pos)
local power = ndef.is_power_available(pos)
if power then
minetest.chat_send_player(user:get_player_name(), ndef.description..":\n"..power_data(power))
end
elseif ndef.techage_info then
local info = ndef.techage_info(pos) or "" local info = ndef.techage_info(pos) or ""
minetest.chat_send_player(user:get_player_name(), ndef.description..":\n"..info) minetest.chat_send_player(user:get_player_name(), ndef.description..":\n"..info)
end end