Selector combinator mode: item ingredients

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

astrangefish
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Dec 28, 2024 12:53 am
Contact:

Selector combinator mode: item ingredients

Post by astrangefish »

Having access to ingredients via parametrized blueprints is nifty, but would it be possible to have a selector combinator mode which outputs the ingredients of a given signal sequentially? Ingredients would be requested like the existing 'select input' mode.

Most items only have one non-recycling crafting recipe, but not all. An incomplete solution would be to ignore alternative recipes and only index the ingredients for the first-unlocked recipe.

To get around this, I suggest all ingredients of each item are listed. e.g. plastic's 'ingredient index' mode would output signals as follows:
0: coal
1: petroleum
2: bioflux
3: yumako mash

Players could then filter ingredients to ignore materials that either don't appear in Gleba recipes, or only appear in Gleba recipes, as required using a further decider combinator, meaning that this solution would be useful on all planets and potentially for modded scenarios.

This mode could also output the quantity per craft, i.e.:
0: coal 1
1: petroleum 20
2: bioflux 1
3: yumako mash 4

An alternative would be to also add a 'recipe index' e.g. 'recipe index' for plastic would output signals as follows:
0: plastic bar (i.e. the item itself, associated with the standard recipe)
1: bioplastic (i.e. the first non-standard recipe)

The 'ingredient index' could then be set up to accept item signals (for the standard recipe) and alternative recipe signals (for non-standard recipes).
Muche
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: Selector combinator mode: item ingredients

Post by Muche »

This can be done even now by sending that signal to a machine with Set recipe and Read ingredients.
DavidEscott
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat Oct 27, 2018 1:15 am
Contact:

Re: Selector combinator mode: item ingredients

Post by DavidEscott »

Muche wrote: Thu Jan 09, 2025 10:40 pm This can be done even now by sending that signal to a machine with Set recipe and Read ingredients.
Except this causes problems with the need for the machine to output other signals, and would seem to cause weird circular issues when you both want to set the recipe AND read the ingredients (for any kind of generic machine). You seem to indicate that it works, but I don't understand how, and think there is some weird blackmagic in the code to cause the machine to not read its own output as an input.

It may be fixable by having the ability to select the wire of the signal (so set the recipe on red and read the ingredients on green), but it would seem even easier to do what shapezio has done and implement something like this suggestion.

If you send to the selector combinator two signals (an item to craft, and a machine to craft it in) then set the mode to "recipe" you can get the recipe entirely within the circuit network and independent of the wiring up the actual machine. Now it is all very clear how things work because circuit elements have clearly defined input and output sides. We know that what we are outputting from the combinator is an output and can only be an output. Nothing circular can happen.
Muche
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: Selector combinator mode: item ingredients

Post by Muche »

Except it does work. Have you even tried it?

Yes, there is "blackmagic" - 123753 Asteroid Collector not counting own contents for "Set Filters".

Yes, having ability to specify reading and writing wire would be more user friendly, has been proposed, and might come in 2.1 - 117481 Please, PLEASE make circuit connection behavior configurable per wire.
DavidEscott
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat Oct 27, 2018 1:15 am
Contact:

Re: Selector combinator mode: item ingredients

Post by DavidEscott »

Muche wrote: Fri Jan 10, 2025 12:25 am Yes, there is "blackmagic"
And I would say that is a problem/symptom of a bad design.
astrangefish
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Dec 28, 2024 12:53 am
Contact:

Re: Selector combinator mode: item ingredients

Post by astrangefish »

Muche wrote: Thu Jan 09, 2025 10:40 pm This can be done even now by sending that signal to a machine with Set recipe and Read ingredients.
Yes, and this use case breaks down immediately if you ever want to connect a couple of machines together with the same wire. In one factory I had a dedicated assembler that didn't actually assemble anything just so I could read the ingredient list from it.
Post Reply

Return to “Ideas and Suggestions”