From caacc2a2613706c53b7ee27b04b5a4d7584a83f7 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 17:24:39 +0100 Subject: devices.lua: create local variables for device node names in preparation for flow logic registration --- devices.lua | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 3b7fc78..26df862 100644 --- a/devices.lua +++ b/devices.lua @@ -129,7 +129,8 @@ for s in ipairs(states) do dgroups = {snappy=3, pipe=1, not_in_creative_inventory=1} end - minetest.register_node("pipeworks:pump_"..states[s], { + local pumpname = "pipeworks:pump_"..states[s] + minetest.register_node(pumpname, { description = "Pump/Intake Module", drawtype = "mesh", mesh = "pipeworks_pump.obj", @@ -162,8 +163,9 @@ for s in ipairs(states) do -- FIXME - does this preserve metadata? need to look at this on_rotate = screwdriver.rotate_simple }) - - minetest.register_node("pipeworks:valve_"..states[s].."_empty", { + + local nodename_valve_empty = "pipeworks:valve_"..states[s].."_empty" + minetest.register_node(nodename_valve_empty, { description = "Valve", drawtype = "mesh", mesh = "pipeworks_valve_"..states[s]..".obj", @@ -203,7 +205,8 @@ for s in ipairs(states) do }) end -minetest.register_node("pipeworks:valve_on_loaded", { +local nodename_valve_loaded = "pipeworks:valve_on_loaded" +minetest.register_node(nodename_valve_loaded, { description = "Valve", drawtype = "mesh", mesh = "pipeworks_valve_on.obj", @@ -244,6 +247,7 @@ minetest.register_node("pipeworks:valve_on_loaded", { -- grating +-- FIXME: should this do anything useful in the new flow logic? minetest.register_node("pipeworks:grating", { description = "Decorative grating", tiles = { @@ -276,7 +280,8 @@ minetest.register_node("pipeworks:grating", { -- outlet spigot -minetest.register_node("pipeworks:spigot", { +local nodename_spigot_empty = "pipeworks:spigot" +minetest.register_node(nodename_spigot_empty, { description = "Spigot outlet", drawtype = "mesh", mesh = "pipeworks_spigot.obj", @@ -306,7 +311,8 @@ minetest.register_node("pipeworks:spigot", { on_rotate = pipeworks.fix_after_rotation }) -minetest.register_node("pipeworks:spigot_pouring", { +local nodename_spigot_loaded = "pipeworks:spigot_pouring" +minetest.register_node(nodename_spigot_loaded, { description = "Spigot outlet", drawtype = "mesh", mesh = "pipeworks_spigot_pouring.obj", @@ -360,7 +366,8 @@ local panel_cbox = { } } -minetest.register_node("pipeworks:entry_panel_empty", { +local nodename_panel_empty = "pipeworks:entry_panel_empty" +minetest.register_node(nodename_panel_empty, { description = "Airtight Pipe entry/exit", drawtype = "mesh", mesh = "pipeworks_entry_panel.obj", @@ -379,7 +386,8 @@ minetest.register_node("pipeworks:entry_panel_empty", { on_rotate = pipeworks.fix_after_rotation }) -minetest.register_node("pipeworks:entry_panel_loaded", { +local nodename_panel_loaded = "pipeworks:entry_panel_loaded" +minetest.register_node(nodename_panel_loaded, { description = "Airtight Pipe entry/exit", drawtype = "mesh", mesh = "pipeworks_entry_panel.obj", @@ -399,7 +407,8 @@ minetest.register_node("pipeworks:entry_panel_loaded", { on_rotate = pipeworks.fix_after_rotation }) -minetest.register_node("pipeworks:flow_sensor_empty", { +local nodename_sensor_empty = "pipeworks:flow_sensor_empty" +minetest.register_node(nodename_sensor_empty, { description = "Flow Sensor", drawtype = "mesh", mesh = "pipeworks_flow_sensor.obj", @@ -437,7 +446,8 @@ minetest.register_node("pipeworks:flow_sensor_empty", { on_rotate = pipeworks.fix_after_rotation }) -minetest.register_node("pipeworks:flow_sensor_loaded", { +local nodename_sensor_loaded = "pipeworks:flow_sensor_loaded" +minetest.register_node(nodename_sensor_loaded, { description = "Flow sensor (on)", drawtype = "mesh", mesh = "pipeworks_flow_sensor.obj", @@ -478,6 +488,7 @@ minetest.register_node("pipeworks:flow_sensor_loaded", { -- tanks +-- TODO: these don't currently do anything under the new flow logic. for fill = 0, 10 do local filldesc="empty" local sgroups = {snappy=3, pipe=1, tankfill=fill+1} @@ -548,7 +559,8 @@ end -- fountainhead -minetest.register_node("pipeworks:fountainhead", { +local nodename_fountain_empty = "pipeworks:fountainhead" +minetest.register_node(nodename_fountain_empty, { description = "Fountainhead", drawtype = "mesh", mesh = "pipeworks_fountainhead.obj", @@ -581,7 +593,8 @@ minetest.register_node("pipeworks:fountainhead", { on_rotate = false }) -minetest.register_node("pipeworks:fountainhead_pouring", { +local nodename_fountain_loaded = "pipeworks:fountainhead_pouring" +minetest.register_node(nodename_fountain_loaded, { description = "Fountainhead", drawtype = "mesh", mesh = "pipeworks_fountainhead.obj", -- cgit v1.2.3 From e6b55028fc9b6a50ecd6c28c2af1ee94e041edcd Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 17:36:03 +0100 Subject: move pump flow logic registration to devices.lua --- devices.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 26df862..670ed6c 100644 --- a/devices.lua +++ b/devices.lua @@ -1,3 +1,4 @@ +local new_flow_logic_register = pipeworks.flowables.register -- rotation handlers @@ -163,6 +164,10 @@ for s in ipairs(states) do -- FIXME - does this preserve metadata? need to look at this on_rotate = screwdriver.rotate_simple }) + new_flow_logic_register.simple(pumpname) + if states[s] ~= "off" then + new_flow_logic_register.intake_simple(pumpname, 2) + end local nodename_valve_empty = "pipeworks:valve_"..states[s].."_empty" minetest.register_node(nodename_valve_empty, { -- cgit v1.2.3 From a1fc493de18bebd41e8d285ef610c0f8209fb609 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 18:05:44 +0100 Subject: migrate flowable registration for valve nodes to devices.lua --- devices.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 670ed6c..8b1725b 100644 --- a/devices.lua +++ b/devices.lua @@ -164,6 +164,7 @@ for s in ipairs(states) do -- FIXME - does this preserve metadata? need to look at this on_rotate = screwdriver.rotate_simple }) + -- FIXME: currently a simple flow device, but needs directionality checking new_flow_logic_register.simple(pumpname) if states[s] ~= "off" then new_flow_logic_register.intake_simple(pumpname, 2) @@ -208,6 +209,12 @@ for s in ipairs(states) do end, on_rotate = pipeworks.fix_after_rotation }) + -- only register flow logic for the "on" ABM. + -- this means that the off state automatically blocks flow by not participating in the balancing operation. + if states[s] ~= "off" then + -- FIXME: this still a simple device, directionality not honoured + new_flow_logic_register.simple(nodename_valve_empty) + end end local nodename_valve_loaded = "pipeworks:valve_on_loaded" @@ -249,6 +256,12 @@ minetest.register_node(nodename_valve_loaded, { end, on_rotate = pipeworks.fix_after_rotation }) +-- register this the same as the on-but-empty variant, so existing nodes of this type work also. +-- note that as new_flow_logic code does not distinguish empty/full in node states, +-- right-clicking a "loaded" valve (becoming an off valve) then turning it on again will yield a on-but-empty valve, +-- but the flow logic will still function. +-- thus under new_flow_logic this serves as a kind of migration. +new_flow_logic_register.simple(nodename_valve_loaded) -- grating -- cgit v1.2.3 From 13383770ef61d93899ad272586daeb0d8d3b4072 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 18:18:47 +0100 Subject: move spigot behaviour registration to devices.lua --- devices.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 8b1725b..fd48033 100644 --- a/devices.lua +++ b/devices.lua @@ -372,6 +372,15 @@ minetest.register_node(nodename_spigot_loaded, { drop = "pipeworks:spigot", on_rotate = pipeworks.fix_after_rotation }) +-- new flow logic does not currently distinguish between these two visual states. +-- register both so existing flowing spigots continue to work (even if the visual doesn't match the spigot's behaviour). +new_flow_logic_register.simple(nodename_spigot_empty) +new_flow_logic_register.simple(nodename_spigot_loaded) +local spigot_min = 1 +new_flow_logic_register.output(nodename_spigot_empty, spigot_min, pipeworks.flowlogic.helpers.output_spigot) +new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, pipeworks.flowlogic.helpers.output_spigot) + + -- sealed pipe entry/exit (horizontal pipe passing through a metal -- wall, for use in places where walls should look like they're airtight) -- cgit v1.2.3 From de44593b414cf024d70027297236f582309daa09 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 18:30:32 +0100 Subject: move flowable registration for airtight entry panel to devices.lua near node definition --- devices.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index fd48033..4344c83 100644 --- a/devices.lua +++ b/devices.lua @@ -433,6 +433,12 @@ minetest.register_node(nodename_panel_loaded, { drop = "pipeworks:entry_panel_empty", on_rotate = pipeworks.fix_after_rotation }) +-- FIXME requires-directionality +-- TODO: AFAIK the two panels have no visual difference, so are redundant under new flow logic - alias? +new_flow_logic_register.simple(nodename_panel_empty) +new_flow_logic_register.simple(nodename_panel_loaded) + + local nodename_sensor_empty = "pipeworks:flow_sensor_empty" minetest.register_node(nodename_sensor_empty, { -- cgit v1.2.3 From df3d54f58a7b00880f6631e309fba08fb769cd33 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 18:34:55 +0100 Subject: move flowable registration for flow sensor to devices.lua near node definition --- devices.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 4344c83..f4f2150 100644 --- a/devices.lua +++ b/devices.lua @@ -518,10 +518,15 @@ minetest.register_node(nodename_sensor_loaded, { mesecons = pipereceptor_on, on_rotate = pipeworks.fix_after_rotation }) +-- FIXME requires-directionality +new_flow_logic_register.simple(nodename_sensor_empty) +new_flow_logic_register.simple(nodename_sensor_loaded) + + -- tanks --- TODO: these don't currently do anything under the new flow logic. +-- TODO flow-logic-stub: these don't currently do anything under the new flow logic. for fill = 0, 10 do local filldesc="empty" local sgroups = {snappy=3, pipe=1, tankfill=fill+1} @@ -592,6 +597,7 @@ end -- fountainhead +-- TODO flow-logic-stub: fountainheads currently non-functional under new flow logic local nodename_fountain_empty = "pipeworks:fountainhead" minetest.register_node(nodename_fountain_empty, { description = "Fountainhead", -- cgit v1.2.3 From 667eeb7d095f12d5c7e560d161697878ea485433 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 21:04:07 +0100 Subject: new flow logic: abms.lua: generalise spigot output code to support arbitary neighbour lists --- devices.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index f4f2150..d12c84a 100644 --- a/devices.lua +++ b/devices.lua @@ -377,8 +377,9 @@ minetest.register_node(nodename_spigot_loaded, { new_flow_logic_register.simple(nodename_spigot_empty) new_flow_logic_register.simple(nodename_spigot_loaded) local spigot_min = 1 -new_flow_logic_register.output(nodename_spigot_empty, spigot_min, pipeworks.flowlogic.helpers.output_spigot) -new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, pipeworks.flowlogic.helpers.output_spigot) +local outputfn = pipeworks.flowlogic.helpers.make_neighbour_output({{x=0, y=-1, z=0}}) +new_flow_logic_register.output(nodename_spigot_empty, spigot_min, outputfn) +new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, outputfn) -- cgit v1.2.3 From 76ebd0a0e1552e0b519716deca3d77e03d1b6b94 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 21:17:05 +0100 Subject: devices.lua: make fountains functional under new flow logic using new neighbour output helper --- devices.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index d12c84a..995f1da 100644 --- a/devices.lua +++ b/devices.lua @@ -598,7 +598,6 @@ end -- fountainhead --- TODO flow-logic-stub: fountainheads currently non-functional under new flow logic local nodename_fountain_empty = "pipeworks:fountainhead" minetest.register_node(nodename_fountain_empty, { description = "Fountainhead", @@ -668,6 +667,14 @@ minetest.register_node(nodename_fountain_loaded, { drop = "pipeworks:fountainhead", on_rotate = false }) +new_flow_logic_register.simple(nodename_fountain_empty) +new_flow_logic_register.simple(nodename_fountain_loaded) +local fountain_min = 1 +local fountainfn = pipeworks.flowlogic.helpers.make_neighbour_output({{x=0, y=1, z=0}}) +new_flow_logic_register.output(nodename_fountain_empty, fountain_min, fountainfn) +new_flow_logic_register.output(nodename_fountain_loaded, fountain_min, fountainfn) + + minetest.register_alias("pipeworks:valve_off_loaded", "pipeworks:valve_off_empty") minetest.register_alias("pipeworks:entry_panel", "pipeworks:entry_panel_empty") -- cgit v1.2.3 From 8e53526b545e2dc0a05066fb18f064a394e20740 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 1 Oct 2017 21:20:30 +0100 Subject: new flow logic: abms.lua: rename neighbour output helper to better indicate lack of rotation support --- devices.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 995f1da..1eb18be 100644 --- a/devices.lua +++ b/devices.lua @@ -377,7 +377,7 @@ minetest.register_node(nodename_spigot_loaded, { new_flow_logic_register.simple(nodename_spigot_empty) new_flow_logic_register.simple(nodename_spigot_loaded) local spigot_min = 1 -local outputfn = pipeworks.flowlogic.helpers.make_neighbour_output({{x=0, y=-1, z=0}}) +local outputfn = pipeworks.flowlogic.helpers.make_neighbour_output_fixed({{x=0, y=-1, z=0}}) new_flow_logic_register.output(nodename_spigot_empty, spigot_min, outputfn) new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, outputfn) @@ -670,7 +670,7 @@ minetest.register_node(nodename_fountain_loaded, { new_flow_logic_register.simple(nodename_fountain_empty) new_flow_logic_register.simple(nodename_fountain_loaded) local fountain_min = 1 -local fountainfn = pipeworks.flowlogic.helpers.make_neighbour_output({{x=0, y=1, z=0}}) +local fountainfn = pipeworks.flowlogic.helpers.make_neighbour_output_fixed({{x=0, y=1, z=0}}) new_flow_logic_register.output(nodename_fountain_empty, fountain_min, fountainfn) new_flow_logic_register.output(nodename_fountain_loaded, fountain_min, fountainfn) -- cgit v1.2.3 From 465e28cbd3e2d176a4ca0429711bc459fe37cf0d Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sat, 7 Oct 2017 12:16:36 +0100 Subject: devices.lua: factor out usage of flowlogic helper into dedicated registry function --- devices.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 1eb18be..61648da 100644 --- a/devices.lua +++ b/devices.lua @@ -377,9 +377,9 @@ minetest.register_node(nodename_spigot_loaded, { new_flow_logic_register.simple(nodename_spigot_empty) new_flow_logic_register.simple(nodename_spigot_loaded) local spigot_min = 1 -local outputfn = pipeworks.flowlogic.helpers.make_neighbour_output_fixed({{x=0, y=-1, z=0}}) -new_flow_logic_register.output(nodename_spigot_empty, spigot_min, outputfn) -new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, outputfn) +local spigot_neighbours={{x=0, y=-1, z=0}} +new_flow_logic_register.output_simple(nodename_spigot_empty, spigot_min, spigot_neighbours) +new_flow_logic_register.output_simple(nodename_spigot_loaded, spigot_min, spigot_neighbours) @@ -670,9 +670,9 @@ minetest.register_node(nodename_fountain_loaded, { new_flow_logic_register.simple(nodename_fountain_empty) new_flow_logic_register.simple(nodename_fountain_loaded) local fountain_min = 1 -local fountainfn = pipeworks.flowlogic.helpers.make_neighbour_output_fixed({{x=0, y=1, z=0}}) -new_flow_logic_register.output(nodename_fountain_empty, fountain_min, fountainfn) -new_flow_logic_register.output(nodename_fountain_loaded, fountain_min, fountainfn) +local fountain_neighbours={{x=0, y=1, z=0}} +new_flow_logic_register.output_simple(nodename_fountain_empty, fountain_min, fountain_neighbours) +new_flow_logic_register.output_simple(nodename_fountain_loaded, fountain_min, fountain_neighbours) -- cgit v1.2.3 From 4f58a3039c55783978d5f85fbf59f06025884384 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sat, 7 Oct 2017 13:05:52 +0100 Subject: new flow logic: flowable_node_registry_install.lua: separate pressure threshold into upper and lower hysteresis values --- devices.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 61648da..26b9275 100644 --- a/devices.lua +++ b/devices.lua @@ -376,10 +376,11 @@ minetest.register_node(nodename_spigot_loaded, { -- register both so existing flowing spigots continue to work (even if the visual doesn't match the spigot's behaviour). new_flow_logic_register.simple(nodename_spigot_empty) new_flow_logic_register.simple(nodename_spigot_loaded) -local spigot_min = 1 +local spigot_upper = 1.5 +local spigot_lower = 1.0 local spigot_neighbours={{x=0, y=-1, z=0}} -new_flow_logic_register.output_simple(nodename_spigot_empty, spigot_min, spigot_neighbours) -new_flow_logic_register.output_simple(nodename_spigot_loaded, spigot_min, spigot_neighbours) +new_flow_logic_register.output_simple(nodename_spigot_empty, spigot_upper, spigot_lower, spigot_neighbours) +new_flow_logic_register.output_simple(nodename_spigot_loaded, spigot_upper, spigot_lower, spigot_neighbours) @@ -669,10 +670,11 @@ minetest.register_node(nodename_fountain_loaded, { }) new_flow_logic_register.simple(nodename_fountain_empty) new_flow_logic_register.simple(nodename_fountain_loaded) -local fountain_min = 1 +local fountain_upper = 1.5 +local fountain_lower = 1.0 local fountain_neighbours={{x=0, y=1, z=0}} -new_flow_logic_register.output_simple(nodename_fountain_empty, fountain_min, fountain_neighbours) -new_flow_logic_register.output_simple(nodename_fountain_loaded, fountain_min, fountain_neighbours) +new_flow_logic_register.output_simple(nodename_fountain_empty, fountain_upper, fountain_lower, fountain_neighbours) +new_flow_logic_register.output_simple(nodename_fountain_loaded, fountain_upper, fountain_lower, fountain_neighbours) -- cgit v1.2.3 From ea92bfe4d321e11955c360fad527e08196fa5841 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sat, 7 Oct 2017 21:36:41 +0100 Subject: devices.lua: raise maximum pressure for pumps --- devices.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 26b9275..8ec3731 100644 --- a/devices.lua +++ b/devices.lua @@ -166,8 +166,9 @@ for s in ipairs(states) do }) -- FIXME: currently a simple flow device, but needs directionality checking new_flow_logic_register.simple(pumpname) + local pump_drive = 4 if states[s] ~= "off" then - new_flow_logic_register.intake_simple(pumpname, 2) + new_flow_logic_register.intake_simple(pumpname, pump_drive) end local nodename_valve_empty = "pipeworks:valve_"..states[s].."_empty" -- cgit v1.2.3 From 6a25e56336f98be7f91d328d6a75674450aa46a4 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 8 Oct 2017 11:32:08 +0100 Subject: new flow logic: algorithmic and value tuning for non-finite mode --- devices.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 8ec3731..44c9d5e 100644 --- a/devices.lua +++ b/devices.lua @@ -377,7 +377,7 @@ minetest.register_node(nodename_spigot_loaded, { -- register both so existing flowing spigots continue to work (even if the visual doesn't match the spigot's behaviour). new_flow_logic_register.simple(nodename_spigot_empty) new_flow_logic_register.simple(nodename_spigot_loaded) -local spigot_upper = 1.5 +local spigot_upper = 1.0 local spigot_lower = 1.0 local spigot_neighbours={{x=0, y=-1, z=0}} new_flow_logic_register.output_simple(nodename_spigot_empty, spigot_upper, spigot_lower, spigot_neighbours) @@ -671,7 +671,7 @@ minetest.register_node(nodename_fountain_loaded, { }) new_flow_logic_register.simple(nodename_fountain_empty) new_flow_logic_register.simple(nodename_fountain_loaded) -local fountain_upper = 1.5 +local fountain_upper = 1.0 local fountain_lower = 1.0 local fountain_neighbours={{x=0, y=1, z=0}} new_flow_logic_register.output_simple(nodename_fountain_empty, fountain_upper, fountain_lower, fountain_neighbours) -- cgit v1.2.3 From 32a24730f1ab8cd596ed2f4cf6eda1a58c877ecb Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 8 Oct 2017 15:07:12 +0100 Subject: new flow logic: change simple transition set logic to take list of key-value pairs, add set registration for flow sensor pipe --- devices.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 44c9d5e..196d660 100644 --- a/devices.lua +++ b/devices.lua @@ -524,6 +524,9 @@ minetest.register_node(nodename_sensor_loaded, { -- FIXME requires-directionality new_flow_logic_register.simple(nodename_sensor_empty) new_flow_logic_register.simple(nodename_sensor_loaded) +-- activate flow sensor at roughly half the pressure pumps drive pipes +local sensor_pressure_set = { { nodename_sensor_empty, 0.0 }, { nodename_sensor_loaded, 2.0 } } +new_flow_logic_register.transition_simple_set(sensor_pressure_set) -- cgit v1.2.3 From ce0983d239c4c855b7f6fd9d96d352c03c5d88b0 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 8 Oct 2017 16:41:00 +0100 Subject: devices.lua: adjust flow sensor threshold to more closely model classic mode --- devices.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 196d660..2a7afc9 100644 --- a/devices.lua +++ b/devices.lua @@ -525,7 +525,7 @@ minetest.register_node(nodename_sensor_loaded, { new_flow_logic_register.simple(nodename_sensor_empty) new_flow_logic_register.simple(nodename_sensor_loaded) -- activate flow sensor at roughly half the pressure pumps drive pipes -local sensor_pressure_set = { { nodename_sensor_empty, 0.0 }, { nodename_sensor_loaded, 2.0 } } +local sensor_pressure_set = { { nodename_sensor_empty, 0.0 }, { nodename_sensor_loaded, 1.0 } } new_flow_logic_register.transition_simple_set(sensor_pressure_set) -- cgit v1.2.3 From d5e3f1cf68a15d7e14cc44eb8e58e49dbb6aa087 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sun, 8 Oct 2017 17:38:28 +0100 Subject: new flow logic: implement post-transition hook with mesecons support, add mesecons transition rules for flow sensor --- devices.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 2a7afc9..5203bf3 100644 --- a/devices.lua +++ b/devices.lua @@ -526,7 +526,7 @@ new_flow_logic_register.simple(nodename_sensor_empty) new_flow_logic_register.simple(nodename_sensor_loaded) -- activate flow sensor at roughly half the pressure pumps drive pipes local sensor_pressure_set = { { nodename_sensor_empty, 0.0 }, { nodename_sensor_loaded, 1.0 } } -new_flow_logic_register.transition_simple_set(sensor_pressure_set) +new_flow_logic_register.transition_simple_set(sensor_pressure_set, { mesecons=pipeworks.mesecons_rules }) -- cgit v1.2.3