Moon Logic deprecated

by mk-fg

Adds Lua-programmable circuit network combinator. Based on Sandboxed LuaCombinator and LuaCombinator2 mods. Probably won't work in multiplayer games.

Content
2 years ago
1.0 - 1.1
4.97K
Circuit network

b [fixed] signal-anything and signal-everything

4 years ago

signal-anything and signal-everything

Value is always 0
red['signal-anything']
red['signal-everything']

Will cause the game to crash
out['signal-anything'] =1
out['signal-everything'] =1
...

Error while running event Moon_Logic::on_tick (ID 0)
Constant combinator: invalid signal in parameters: signal-everything
stack traceback:
Moon_Logic/control.lua:191: in function 'mlc_update_output'
Moon_Logic/control.lua:529: in function 'run_moon_logic_tick'
Moon_Logic/control.lua:462: in function <Moon_Logic/control.lua:444>
stack traceback:
[C]: in function 'newindex'
__Moon_Logic
/control.lua:191: in function 'mlc_update_output'
Moon_Logic/control.lua:529: in function 'run_moon_logic_tick'
Moon_Logic/control.lua:462: in function <Moon_Logic/control.lua:444>

Error while running event Moon_Logic::on_tick (ID 0)
Constant combinator: invalid signal in parameters: signal-anything
stack traceback:
Moon_Logic/control.lua:191: in function 'mlc_update_output'
Moon_Logic/control.lua:529: in function 'run_moon_logic_tick'
Moon_Logic/control.lua:462: in function <Moon_Logic/control.lua:444>
stack traceback:
[C]: in function 'newindex'
__Moon_Logic
/control.lua:191: in function 'mlc_update_output'
Moon_Logic/control.lua:529: in function 'run_moon_logic_tick'
Moon_Logic/control.lua:462: in function <Moon_Logic/control.lua:444>

...

4 years ago

Didn't think about these myself, but yeah, they definitely don't work for the output, and wrt input they don't really make any sense either.
You can check same thing in lua code easily, e.g. next(red) or next(green) can be an "anything" check, and a loop over these two should be same as "everything".
Though if you want something simple like "multiply everything by 5 on each tick", it's of course best to use arithmetic combinators for that.

Should be fixed in 0.0.36. Thanks for reporting.

4 years ago

Value is always 0
red['signal-anything']

I also realized that this kind of thing should raise an error on the combinator instead of just returning 0, and changed that in 0.0.37.
I.e. now if you do local v = red.xyz, you'd get error on that line, instead of v set to 0.
This is to avoid errors and typos in signal names being silently ignored.

4 years ago

Efficient work
thank you!
😀

New response