summaryrefslogtreecommitdiff
path: root/new_flow_logic
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-07 16:12:36 +0100
committerthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-07 16:12:36 +0100
commit34cfee8a2faaa9366b1a9ae5035eedee3620aa56 (patch)
treecb7eac3ae2760073f340a280c28b0b61912c57de /new_flow_logic
parent1669cfd4510a2dbb2ca3c754b414ae8c976ceca1 (diff)
downloadpipeworks-34cfee8a2faaa9366b1a9ae5035eedee3620aa56.tar
pipeworks-34cfee8a2faaa9366b1a9ae5035eedee3620aa56.tar.gz
pipeworks-34cfee8a2faaa9366b1a9ae5035eedee3620aa56.tar.bz2
pipeworks-34cfee8a2faaa9366b1a9ae5035eedee3620aa56.tar.xz
pipeworks-34cfee8a2faaa9366b1a9ae5035eedee3620aa56.zip
new flow logic: start adding replacement ABM logic
Diffstat (limited to 'new_flow_logic')
-rw-r--r--new_flow_logic/abm_register.lua19
-rw-r--r--new_flow_logic/flowable_node_registry_install.lua4
2 files changed, 23 insertions, 0 deletions
diff --git a/new_flow_logic/abm_register.lua b/new_flow_logic/abm_register.lua
index c1b2d7d..d8bb6cc 100644
--- a/new_flow_logic/abm_register.lua
+++ b/new_flow_logic/abm_register.lua
@@ -12,6 +12,25 @@ local flowlogic = pipeworks.flowlogic
-- DISCUSS: should it be possible later on to raise the the rate of ABMs, or lower the chance?
-- Currently all the intervals and chances are hardcoded below.
+
+
+-- register node list for the main logic function.
+-- see flowlogic.run() in abms.lua.
+--[[
+local register_flowlogic_abm = function(nodename)
+ minetest.register_abm({
+ nodenames = { nodename },
+ interval = 1,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ flowlogic.run(pos, node)
+ end
+ })
+end
+]]
+
+
+
-- register a node name for the pressure balancing ABM.
-- currently this only exists as a per-node function to allow nodes to be registered outside pipeworks.
local register_abm_balance = function(nodename)
diff --git a/new_flow_logic/flowable_node_registry_install.lua b/new_flow_logic/flowable_node_registry_install.lua
index 07001ef..5ebae61 100644
--- a/new_flow_logic/flowable_node_registry_install.lua
+++ b/new_flow_logic/flowable_node_registry_install.lua
@@ -79,6 +79,10 @@ register.output = function(nodename, upper, lower, outputfn)
if pipeworks.toggles.pressure_logic then
abmregister.output(nodename, lower, outputfn)
end
+ -- output ABM now part of main flow logic ABM to preserve ordering.
+ -- note that because outputs have to be a flowable first
+ -- (and the installation of the flow logic ABM is conditional),
+ -- registered output nodes for new_flow_logic is also still conditional on the enable flag.
regwarning("output node", nodename)
end