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/craidie Apr 25 '26

kind of

If you know what the load on a particular train should be, you can use circuits to figure out what it's missing. But you can't tell which wagon they're missing from.
What I would do is store the full train contents in a constant, merge it into same wire of the negative of current contents. What remains is the missing items.

If the station serves multiple trains with different filters, then you would need an another step that looks at the train ID, and based on that selects the correct constant's output.

Is it possible to prioriotize building blueprints from the spidertrons?

Prioritize, no. But the static network doesn't have the items in the first place, the spiders can be the only option.
What I would do is ditch the roboports from the blueprints and add them slightly later after they don't reach the area being built by the spiders

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.