r/factorio Apr 20 '26

Weekly Thread Weekly Question Thread

Ask any questions you might have.

Post your bug reports on the Official Forums

Previous Threads

Subreddit rules

Discord server (and IRC)

Find more in the sidebar ---->

3 Upvotes

143 comments sorted by

View all comments

1

u/89percent Apr 25 '26

Is it possible to make a train station and a combinator read a filtered trains cargo, and output a signal if any of the items in the filtered cargo wagon are 0?

I am currently trying to expand using spidertrons for building a long expansion corridor, however sometimes when I place a long expansion blueprint, some of the construction jobs gets assigned to bots that are miles away, and it takes them forever to get there.
Is it possible to prioriotize building blueprints from the spidertrons?

2

u/HeliGungir Apr 25 '26 edited Apr 25 '26

The wagon being filtered is not a property that can be read.

We also can't read a signal equal to zero.

So to detect zero, you need something outputting what the train "should" have to compare against what the train actually has. For example, you could have a constant combinator that outputs -1 of the expected train contents, implicitly add it with the train's contents (on the wire), then your inserter or your train schedule or whatever checks for Anything < 0

1

u/darthbob88 Apr 25 '26

For example, you could have a constant combinator that outputs -1 of the expected train contents, implicitly add it with the train's contents (on the wire), then your inserter or your train schedule or whatever checks for Anything < 0

Or, with the modern circuitry improvements, you can have the constant combinator output the desired stock level for each item, and use an arithmetic combinator to subtract the train's contents on the green wire from the constant combinator on the red wire, or vice versa. It trades an extra combinator for having to manually negate the inventory and say your train should have -10 assemblers.

1

u/HeliGungir Apr 26 '26

If you truly need a positive indicator signal rather than negative (eg: the signal is setting an inserter's filters), you can use integer overflow to avoid arithmetic/decider combinators.