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] Error when setting signal to string

4 years ago

I wanted to see what would happen if I set a signal to string...

out["signal-red"] = "for science"

causes this:

Error while running event Moon_Logic::on_tick (ID 0)
Moon_Logic/control.lua:380: attempt to compare number with string
stack traceback:
Moon_Logic/control.lua:380: in function 'update_signals_in_guis'
Moon_Logic/control.lua:410: in function <Moon_Logic/control.lua:408>

4 years ago

Oh, right, that gui display uses outputs before processing, and can run into such type issues, need to fix that, thanks for testing.

4 years ago

I was trying to get this mod (https://mods.factorio.com/mods/justarandomgeek/signalstrings) to work. Is there any way it could be supported?

4 years ago
(updated 4 years ago)

Yeah, totally. Just need to add game.remote = remote to sandbox env table, and lua code there will be able to use any such interfaces.
Goes a bit counter to the whole "sandboxing" thing though, and people can abuse this stuff and break other mods and their game completely, so guess I'll just leave it undocumented in the help window :)

4 years ago
(updated 4 years ago)

Hm, actually, I seem to remember sandboxed luacombinator mod exposing that particular mod interface in a safer way - not just whole "remote", but only a subset for that one mod. But it'd be easier to just expose whole thing for any such mod, and let people who know what they're doing use it, I guess.

4 years ago

Added game.remote = remote in 0.0.19 as a "secret feature".
Should be perfectly fine to use with signalstrings, but as mentioned, probably a bad idea to mess with other mod configuration interfaces that are only intended for other mods through that.

4 years ago
(updated 4 years ago)

Fixed in 0.0.19 - now output values are printed from the actual combinator (well, not really, the hidden one), instead of any kind of internal tables.

New response