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] crash when trying to open combinator created from blueprint

4 years ago
(updated 4 years ago)

I saw in the description it says no blueprint support (although I would like that very much). Just it would probably be better if it didn't crash.

The mod Moon Logic (0.0.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Moon_Logic::on_gui_opened (ID 84)
Moon_Logic/gui.lua:174: attempt to index field '?' (a nil value)
stack traceback:
Moon_Logic/gui.lua:174: in function 'create_gui'
Moon_Logic/gui.lua:73: in function 'open'
Moon_Logic/control.lua:841: in function <Moon_Logic/control.lua:833>

Steps to produce bug: place combinator (even without any connections/code), ctrl -c then ctrl-v, then open gui.

4 years ago

Also can you put some examples somewhere please. I found some on the SandboxedLuaCombinator page but moon logic should have some also.

4 years ago

Yeah, didn't test that at all, likely broke when removing those.
Thanks for reporting. Will fix eventually.

Serialization for blueprints looked overly complex to me, but maybe can be simplified just to base64 of the code snippet, instead of bunch of other state.
Especially as I want to get rid of weird separate input lamps and output combinator-clones anyway, and I think they are part of the problem there too.

4 years ago

Also can you put some examples somewhere please.
I found some on the SandboxedLuaCombinator page but moon logic should have some also.

Yeah, would be nice to have, along with stuff like screenshots, but later, as mod code itself needs a bit more work first.

4 years ago

There also seems to be two moon logic combinators. A black constant and a normal looking arithmetic. Both have guis than can be opened.

4 years ago
(updated 4 years ago)

Yup. I think these all were added in the Sandboxed version, so maybe I should've started with simplier LuaCombinator2 anyway, but oh well.

2x1 version has separated inputs and outputs, but then red/green wire kinda does same on constant combinator already, and you can convert, aggregate or shift/encode signals in various ways, so I don't seem to understand the point of going to rather extreme lengths for having many separated wire inputs and outputs.

I think lamp/clone ones can maybe be copy-pasted via blueprint retaining their connection, so point of them is to have a kind of long-range signal transmission via hacks, but then there're like 10 mods doing that thing with nice animated radio towers, and code for this thing is in rather complicated metatable moon logic like https://github.com/mk-fg/games/blob/84473f6/factorio/Moon_Logic/control.lua#L270-L467 all over the place, so I think they all have to go :)

4 years ago

Issue with blueprints should be fixed.
Also removed aforementioned addon entities and complicated logic associated with these, cutting length of control.lua down in half.
Did pretty much a rewrite of the main logic in the process, so it might have new bugs, though given that current code has few corner-cases, should likely trip them myself too after playing with it (later).

New response