Crafting Combinator


Includes combinators that allow you to set or read the recipe of any crafting machine, get ingredients or products of a recipe and more!

Content
2 years ago
0.14 - 1.1
18.8K
Manufacturing

i Freeing the result

3 years ago
(updated 3 years ago)

Hi and thanks a lot for the great mod.
I ran into a rather unpleasant problem while using the crafting combinator with the Spaсe Exploration mod, namely the Delivery Cannon. During a recipe change, if the cannon is not yet loaded and is not ready to fire, the combinator moves not only the ingredients into the box, but also the result - a capsule with materials. However, the only way to use this capsule is to fire it with a cannon, which results in a stack of useless capsules. Could you add an option to the settings, or point to a place in the code where I can disable moving the result when changing the recipe?

3 years ago

I haven't checked properly, but you can probably implement that logic here. If you simply remove the output inventory from that line, it should just destroy those items when changing recipes. If you don't want to lose them, you can add a check into that function that just returns false if there's anything in the output inventory. That should halt the combinator until the items get cleared out by other means. It will probably also make the "Not enough space in chest" error pop up, but that's just cosmetic and can be solved by returning something other than a boolean and then checking if the message should be shown or not based on that.

I would probably just add the option, but I've been pretty busy lately and already have a bunch of other stuff in the backlog for this mod, so don't hold your breath...

3 years ago

Removing self.inventories.assembler.input worked fine, but the thought of lost results now haunts me.
Please advise the correct code to stop in case the result is filled. I tried this, but it seems to me that it does not work:
if self.inventories.assembler.output then return false; end

3 years ago

output is a LuaInventory, so you wanna use something like is_empty for the check.

3 years ago

Thanks for the advice, it worked.
I have one more suggestion - could you modify the "Find uses" mode by adding a mode that uses all input signals? Now, if you send several signals to the combinator, he will choose the first recipe that comes across, for the first available ingredient, but I would like to select a recipe that uses all the ingredients provided. In some cases, this limitation can be bypassed, but I have not yet figured out how to elegantly do this in a situation with alternative recipes (such as a bunch of Krastorio 2 and Space Exploration).

New response