Help with filter inserter

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
gigilal
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Jan 09, 2025 7:19 pm
Contact:

Help with filter inserter

Post by gigilal »

Hi,

I am really new to SpaceAge or Factorio in general.
But I am trying to learn more within the wire \ Filter \ Read belt content.

I am trying to achive that my belt only have 1 of each item going on the sushi belt I have made.
Basically if I remove 1 wall from the belt the inserter will load one new wall onto the belt.

And here comes the problem - Since In my Requester Box I have

Gun Turrets, Laser Turrets, Flamethrower Turrets, Wall, Repair Pack.
I only want one of each of these items being at the belt at the time.

Is this possible? Could someone show with picture or explain how this is done?
wizcreations
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Fri Aug 30, 2019 6:19 pm
Contact:

Re: Help with filter inserter

Post by wizcreations »

I have not done this myself but I think I understand in principle how it could work.

Check out FF405 that talks about counting all items on a belt. You need a circuit connection to read belt contents with the "Hold (all belts)" option.
https://factorio.com/blog/post/fff-405

Then set an enable condition on each inserter arm that adds items to the belt to only enable if the count of the item is 0.
Tertius
Smart Inserter
Smart Inserter
Posts: 1084
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Help with filter inserter

Post by Tertius »

If you connect a red or green wire to one belt piece and configure it to read belt content (all belts), you're able to determine how many items are on the belt.
You want to add one item if there is none of this item on the belt, and to add none if there is one of this item on the belt.
You want not only do this for one specific item but for a bunch of items in the chest an inserter is accessing.

There is a generic solution for this. I'm showing a generic approach, because such "compare and set a filter" challenges are all over the game, and it's not more complex than a direct and specific solution.

Assume you don't want just 1 item, you want to configure how many items. For example 10 walls, 1 gun turret, 5 repair packs.

Start with a constant combinator and configure it with this list of item: 10 walls, 1 gun turret, 5 repair packs.
Next is a decider combinator. It will compare signals from the constant combinator (this is what you want) with the belt (this is what currently is).
The decider combinator is able to compare the signal from one wire with the signals of the other wire and output the result. The result can be used as filter for the inserter. As long as a signal from the constant combinator has a higher value than the same signal from reading the belt, the combinator outputs the corresponding signal, and the inserter can use this as filter. As soon as there are equal than or more items on the belt, the combinator removes the signal, so it vanishes from the filter, and the item isn't moved any more. Notice I set the stack size of the inserter to 1, so it will never move more than 1 item with one swing. You can increase this again, but then items are added in batches of 3 (or 12 for a bulk inserter) to the belt.
I preloaded the belt with some items to show what the decider will do with these. Repair packs are already satisfied, and the power pole is an extra item that must be ignored.
Consult the wiki to see what the * (EACH) wildcard does: https://wiki.factorio.com/Decider_combinator
and https://wiki.factorio.com/Circuit_network#Logic_signals

Example with settings:
01-09-2025, 21-24-44.png
01-09-2025, 21-24-44.png (236.94 KiB) Viewed 288 times
01-09-2025, 21-26-43.png
01-09-2025, 21-26-43.png (211.62 KiB) Viewed 288 times
gigilal
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Jan 09, 2025 7:19 pm
Contact:

Re: Help with filter inserter

Post by gigilal »

This is exactly what I was looking for, thank you so much – I got it working right away.

Previously, I was using the Decider Combinator, and now I see that I was only missing a Constant Combinator!

Question:

You connect the Constant Combinator with a red wire to the Decider Combinator, then a green wire to the belt and the inserter – does it matter which color is used here?
Tertius wrote: Thu Jan 09, 2025 8:28 pm If you connect a red or green wire to one belt piece and configure it to read belt content (all belts), you're able to determine how many items are on the belt.
You want to add one item if there is none of this item on the belt, and to add none if there is one of this item on the belt.
You want not only do this for one specific item but for a bunch of items in the chest an inserter is accessing.

There is a generic solution for this. I'm showing a generic approach, because such "compare and set a filter" challenges are all over the game, and it's not more complex than a direct and specific solution.

Assume you don't want just 1 item, you want to configure how many items. For example 10 walls, 1 gun turret, 5 repair packs.

Start with a constant combinator and configure it with this list of item: 10 walls, 1 gun turret, 5 repair packs.
Next is a decider combinator. It will compare signals from the constant combinator (this is what you want) with the belt (this is what currently is).
The decider combinator is able to compare the signal from one wire with the signals of the other wire and output the result. The result can be used as filter for the inserter. As long as a signal from the constant combinator has a higher value than the same signal from reading the belt, the combinator outputs the corresponding signal, and the inserter can use this as filter. As soon as there are equal than or more items on the belt, the combinator removes the signal, so it vanishes from the filter, and the item isn't moved any more. Notice I set the stack size of the inserter to 1, so it will never move more than 1 item with one swing. You can increase this again, but then items are added in batches of 3 (or 12 for a bulk inserter) to the belt.
I preloaded the belt with some items to show what the decider will do with these. Repair packs are already satisfied, and the power pole is an extra item that must be ignored.
Consult the wiki to see what the * (EACH) wildcard does: https://wiki.factorio.com/Decider_combinator
and https://wiki.factorio.com/Circuit_network#Logic_signals

Example with settings:

01-09-2025, 21-24-44.png
01-09-2025, 21-26-43.png
This is ex
wizcreations
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Fri Aug 30, 2019 6:19 pm
Contact:

Re: Help with filter inserter

Post by wizcreations »

I am glad Tertius gave you a much better answer than I did. I'm sorry mine wasn't so helpful! Hopefully I can be more helpful here.

The two inputs to the Decider Combinator must be different colors because they are different inputs to the combinator, but it does not matter which one is red and which one is green. However, the Conditions formula on the Decider Combinator would need to change if you swapped the green and red. Tertius's screenshot shows the formula as looking for Red > Green, indicating if your desired (red) is higher than what is on the belt (green), then output 1 of that item.
Muche
Filter Inserter
Filter Inserter
Posts: 731
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: Help with filter inserter

Post by Muche »

Wire colors don't matter, as long as the decider combinator is configured appropriately (wire coming from CC is greater than wire coming from belt).

Switching them around (wire from belt is greater than wire from CC) would change the meaning of the circuitry - activate the inserter when the amount on belt is above a specified maximum.
Also useful, just might be not what you want.
Post Reply

Return to “Gameplay Help”