Moon Logic 2


Adds programmable Lua combinator. Based on Sandboxed LuaCombinator and LuaCombinator2 mods.

Content
10 months ago
2.0
1.31K
Circuit network

g Help needed

10 months ago
(updated 10 months ago)

Hello,

I cannot get started with the mod, seems like there is some issue with the input dict. I am trying this simple line:

out['wood'] = red['stone-wall']

but getting this error

2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: --- debug-run start [tick=268881] ---
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: env-before :: {delay = 1, var = {}}
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: out-before :: {}
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: used-inputs :: {}
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: env-after :: {debug = true, delay = 1, var = {}}
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: out-after :: {}
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: out-sync=true out-diff :: {}
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: error :: RuntimeError: __Moon_Logic_2__/control.lua:153: attempt to concatenate local 'q_name' (a nil value)
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: --- debug-run end [tick=268881] ---

Could you please take a look?

10 months ago
(updated 10 months ago)
2492.422 Script @__Moon_Logic_2__/control.lua:415:  -- moon-logic [803]: error :: RuntimeError: __Moon_Logic_2__/control.lua:153: attempt to concatenate local 'q_name' (a nil value)

I'm having this issue as well. I looked up the code and tried adding "normal/" to the item names as a prefix, it doesn't give such an error anymore but reports 0. Other qualities report correctly.

As a workaround, using two selector combinators with quality transfer setting and connecting all red/green inputs first to these combinators and outputting each signal on higher qualities works. Need two selectors for this, one for each wire, otherwise it'll combine the values.

10 months ago

Yeah, good catch, something with quality higher than normal works, however, "normal/" prefix doesn't work for normal quality

This works:
out["red/epic/stone-wall"] = green["rare/stone-wall"]

This doesn't work:
out["red/epic/stone-wall"] = green["normal/stone-wall"]

10 months ago

Actually, outputting normal quality signal works without prefix

out["red/stone-wall"] = green["rare/stone-wall"]

10 months ago
(updated 10 months ago)

I found another bug, related to quality as well

The following works for signals of normal quality, but throws an error with anything above normal

for key, value in pairs(red) do
  game.print(key .. ' - ' .. value)
end

Error:

5998.849 Script @__Moon_Logic_2__/control.lua:415: -- moon-logic [816]: error :: RuntimeError: __Moon_Logic_2__/control.lua:95: MOD BUG - abbreviation for invalid signal string: rare/#fast-transport-belt

10 months ago
(updated 10 months ago)

Actually, outputting normal quality signal works without prefix

out["red/stone-wall"] = green["rare/stone-wall"]

Not in my case. Working with fluids, maybe it's fluid related somehow but tested with other signals as well. A green signal with thousand normal lubricant for example, writing game.print(green["lubricant"]) or game.print(green["=lubricant"] throws that q_name = nil error. When I use "normal/lubricant" it outputs 0.

This mod is so cool I'd love to see it fully functional! Having precise control over the network logic from one place is awesome.

10 months ago
(updated 10 months ago)

Not in my case. Working with fluids, maybe it's fluid related somehow but tested with other signals as well. A green signal with thousand normal lubricant for example, writing game.print(green["lubricant"]) or game.print(green["=lubricant"] throws that q_name = nil error. When I use "normal/lubricant" it outputs 0.

Oh you are reading from a wire, but I mentioned that writing to a wire works without prefix

https://imgur.com/SrEebfj

10 months ago
(updated 10 months ago)

I created a github issue for this: https://github.com/chilla55/Moon-Logic-2/issues/3

10 months ago

it's fixed now

10 months ago

Thank you!

New response