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

i [lua-qiz] Make more information from the game available to read

2 years ago
(updated 2 years ago)

I, personally, don't like to make complex circuits in factorio. This is the main reason I use Moon Logic. Thank you for this great mod.
My desire to reduce the number of combinators even more can be satisfied by making more information from the game available inside the Moon Logic Combinator.
For example, to calculate something which involves item stack size I have to install additional mods, add one more Moon Logic combinator to circuit and split the functional pieces of the code between combinators, because the very limited number of inputs and outputs combinators have in Factorio.
Can we have items and fluids prototypes information available for reading from inside the combinator?

2 years ago

Yeah, item stack sizes seem to be quite popular thing asked in the threads here.
It's already possible if you access full modding API via something like local wood_stack = _api.game.item_prototypes.wood.stack_size.
You can access absolutely everything that's in the game that way, but as FAQ warns, it comes with a risk of breaking game in various ways, obviously.

It's not really a thing I cared about when implementing the mod - only wanted more flexible lua logic on circuit network inputs/outputs, like an easier to use normal combinator, not a in-game modding tool that fits any purpose.
I'd inevitably recommend considering to separate something specific you want to do - for example query map for enemies and send alert signal, or having combinators communicate across the map - into a separate mod (like this one here or that one), not code it on programmable combinators, and maybe even publish it for other folks to use.

But also haven't really played the game for a while myself, and doubt I'll be around much longer to maintain the mod even for trivial bugfixes, much less extending it.
So if you feel like it'd be useful to have a mod with more information in this kind of lua combinators, I'd recommend forking the mod and publishing a better version with all that built-in - you already know lua, and that's all you need for that.
("forking" because it's usually a bad idea to change direction/maintainers on a specific thing people are already subscribed to, for many good reasons, plus there's much more freedom from all legacy implementation/compatibility stuff that way)

2 years ago

It's already possible if you access full modding API via something like local wood_stack = _api.game.item_prototypes.wood.stack_size.
Thank you for the tip!

It's not really a thing I cared about when implementing the mod - only wanted more flexible lua logic on circuit network inputs/outputs, like an easier to use normal combinator, not a in-game modding tool that fits any purpose.

It's also not my intention to mod anything in-game. I think it is fair to have separate entities to operate things in game. I just want to have read only access to the information.

But also haven't really played the game for a while myself, and doubt I'll be around much longer to maintain the mod even for trivial bugfixes, much less extending it.

Alright. Fair enough.

Thank you for doing such great mod!

New response