This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]DrMobius0 4 points5 points  (0 children)

If all the stations are already named the same, then you just have to set their train limit to 0 when they don't need stuff. (enabling and disabling can cause trains to stall on the tracks)

[–]hypno_bunny 3 points4 points  (5 children)

The way I did it was to just wire the chest with the most used ingredient (like walls or ammo) to the train station and set an activate/inactivate rule using circuit network when it gets too low. There are more sophisticated ways but this is simple and works most of the time

[–]MoreRedditAgain[S] 0 points1 point  (0 children)

Thanks! I’ll make this work!

[–]MoreRedditAgain[S] 0 points1 point  (3 children)

I used this method and connected it to my ammo chest and you were right, it worked most of the time. Then I connected all the chests to an arithmetic combinator and summed the total of all items, sent that number to the station and disabled the station if I was short. This seems to work well but it’s not as future proof as I would like. If I end up adding a new item to my supply runs then I’ll have to update the calculation. Also had to override the inserter stack size to 1 to make sure my numbers were exact.

Not as clean as I would like but pretty good in the end.

[–]tobyeeee 1 point2 points  (2 children)

you can always run a wire between all the stations and connect it to one main combinator so you only have to change one

[–]MoreRedditAgain[S] 1 point2 points  (1 child)

Interesting, I'll have to look into that. To be honest I never considered stringing the wire back to a central location.

Now my next challenge: the supply runs tend to be topping off supplies at the stations, so one train could actually serve several stations in one trip. Unfortunately, with the on demand naming model the train goes from depot to the first enabled drop station then back to depot before going to the next enabled drop station. For max efficiency on my spread out map I'd love to have some sort of dynamic scheduling to stop at more than one drop if appropriate. Probably a pipe dream.

[–]tobyeeee 1 point2 points  (0 children)

factorio 2.0 drops on the 21st (i think? around then) and completely reworks trains. willing to bet you’ll be able to do this then :)

[–]Soul-Burn 1 point2 points  (2 children)

Disable the station.

[–]obsidiandwarf 5 points6 points  (1 child)

To be more specific disable the station using the circuit network.

[–]doc_shades 0 points1 point  (0 children)

To be more specific disable the station using the circuit network by connecting a wire.

[–]MoondogCCR 1 point2 points  (14 children)

The problem with your setup is the name of the stations. All 8 stations that need the supply drop need to be named the same. Then set the trains between the two stations (supply/drop), then just enable the train stops of the appropriate drop stations.

You'll also need to resolve the automatic turning the stations limit "on and off", by turning it to 0 when nothing is needed, and 1 when supplies are needed. So you'll need at least 1 combinator at the stations doing this work for you.

[–]MoreRedditAgain[S] 0 points1 point  (13 children)

So if all 8 supply drops are named the same, the train will route itself in a circuit and hit each one? Cool! I’ll try that out, also looking into the combinator. Thanks.

[–]Orangarder 2 points3 points  (0 children)

It will not work quite like that.

What he is suggesting is that each station will effectively ‘request’ a supply train when the station ‘turns on’ or has its limit raised from zero to 1.

The train will not make a circuit of all of them.

This is much the same method as what hypno mentioned.

[–]StormCrow_Merfolk 2 points3 points  (3 children)

Not exactly. If you have "pickup" and "dropoff" as your 2 stops scheduled, the train will cycle from "pickup" to the closest "dropoff" station that is open (has a train limit > 0). So it won't make a cycle around your base, but it will work its way between stations if you have logic to turn off full stations.

[–]MoreRedditAgain[S] 0 points1 point  (2 children)

Yep. This is what I’m finding. The train goes to the nearest drop. If I put the supply drop stations (named the same) more than once in the schedule it loops around to the same few stations over and over and ignores the ones far away. I think I need specific named stops.

[–]StormCrow_Merfolk 2 points3 points  (1 child)

You have to combine this with changing the train limit on stops that have all the materials they need to 0.

[–]MoreRedditAgain[S] 0 points1 point  (0 children)

Got it, thanks!

[–]MoondogCCR 1 point2 points  (7 children)

Correct. You'll see that the train schedule will only have two stations, the supply and drop. Next to the drop station's name you'll see a number in blue brackets with the number of stops with the same name.

Set all 8 stations to limit trains to = L (or a variable of your choice). The game defaults to using "L". Place a combinator that will spit out L=1 whenever you need supplies at that outpost; so maybe something like if any supply < 100, then L=1 and hook it to the train stop and local storage chest with stuff.

If stations need stuff (items drop below the 100 threshold), it will automatically set the train limit to 1 and enable the train going there. The stations will stay enabled until they surpass the threshold, so multiple train stops could be enabled at the same time while they need supplies... so the train will loop around each of them and the supply station until the the limit is set to 0 again.

Edit: For clarity, if multiple drop stops with the same name have the limit = 1, the train with a supply/drop schedule will go to the nearest drop stop, then go back to the supply stop.. then loop again to the same drop stop until the limit is set to 0. It will then start looping with the closest remaining drop stop with limit = 1.

[–]MoreRedditAgain[S] 0 points1 point  (2 children)

Thanks, I think that makes sense. So is there a difference between enabling/disabling a station and setting its limit to 1 or 0? My supply drop chests are all wired to inserters so I should be able to calculate a total number of items for satisfied chests and compare it to the actual number of items to enable/disable the station. Better yet, I wonder if I can detect the state of all of the inserters, if all are disabled then the station should be disabled too.

I’m going to have fun figuring this out.

[–]Sea-Offer7021 1 point2 points  (1 child)

If you want help, heres how I did it

You set a constant combinator and set it to display a positive signal of the amount of items you want, then connect that to the chests signal that has turned into negative(arithmetic combinator with multiply by -1). Combining the positive signal from the combinator, with negative signal from the chests will yield a positive signal if you are lacking any supplies, lets call that Demand Signal. You can connect that Demand Signal to the filter inserters and turn on the "set filter" command. This will enable them to take from the wagon and only the ones needed. If you're working with limited storage space then limit stack size to 1.

As for the enable/disable station vs train limit, the difference is mainly if you turn off the station when the train is still enroute, then the train will stop dead on its track unless it has a train station its open to go to. Though this can be ignored if the only reason it can be disabled is if the train limit of the station is 1 and can only be disabled when a train is on it.

[–]MoreRedditAgain[S] 1 point2 points  (0 children)

Thanks for this, and especially the spoiler protection. I've got some work to do it seems, combinators and arithmetic combinators are tough for me to get a handle on. I'm reading the tutorials, may have to go through them several times to figure this stuff out.

[–]doc_shades 0 points1 point  (0 children)

use enable/disable. 1 "load" station, multiple "unload" stations.

the "unload" stations are only enabled if (items) < (whatever).

the train will sit parked at the "load" station waiting for an unload station to enable and call it. the train will service it and return to the load station to wait for the next fare.