Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
It's something many people playing with trains end up thinking about (not necessarily exactly like your idea but close enough), a decent amount even attempt it and a few manage to make something that works for their specific situation.
It's pretty complex and very prone to errors and signal pollution so good luck to you if you want to try your hand at it.
https://mods.factorio.com/mod/LogisticTrainNetwork
It does take a bit of learning to get started but it's definitely worth a look when you want to do logistics stuff with trains.
It doesn't exactly work like you described, the trains stay at the parking unless an unloading station asks for something but it reduces the amount of required trains since it re-writes the schedules on its own and can support several networks at the same time if you don't want a single network taking care of all.
Don't disable any stations but simply set the train limit to however many trainloads are available/needed. If there are no available stations then trains will wait at the "wait empty/full X" station, otherwise they will just drive through at full speed on their way to their next stop.
The downside is that waiting trains will keep flashing the "destination full" warning which is why I personally would still use circuits to make them wait but that's up to you.
For each dropoff station where you calculate the condition put it in the same signal (e.g. D). Link it not only to the station, but also to your data-bus along the railnetwork. Do the same with your pickup stations, but use a different signal name (e.g. P). Now the signals D and P on your data-bus will show how many dropoff or pickup stations are currently available.
Now create two waiting stations - one to be scheduled on the way from the pickup to the dropoff, one in the other direction. You can put a signal directly after these stations with a conditon to lock it if D respective P is 0, i.e. no dropoff or pickup stations are currently available.
This should work fine with one train serving several pickup and dropoff stations. You might run into issues if you try to use several trains on the same schedule, as you might end up with the "thundering herd" problem if you don't use the station limits introduced in the last version, though.
Pretty similar to other suggestions, but maybe some pictures will help.
https://steamcommunity.com/sharedfiles/filedetails/?id=2381416217
Wait Empty, Loading, Wait Full, Unloading. They need to go in that order.
Wait Empty and Wait Full would be no wait condition set at all. Loading, wait until full. Unloading, wait until empty.
At the loading stations :
Use a belt balancer to ensure that each 6 chest set for each cargo wagon gets the same amount of material. It does not matter how balanced or unbalanced the chests within each 6 chest set gets, so long as the entire set remains balanced with its brethren, thus the use of the balancer as opposed to a MadZuri. Wire all the chests together to an Arithmetic Combinator (Each / total capacity of train, output Each). Wire the output of the AC to the train stop. Enable when the contents of the station are >= 1. Set limit to that content signal.
Example : a 4 cargo wagon train is picking up Green Circuits. Each Cargo Wagon can hold 8000 circuits, so 32000 circuits is the train capacity. AC : Each / 32000, output Each. Train stop : Enable if Green Circuit >= 1; Limit Green Circuit.
At the unloading stations :
Use a belt balancer to ensure that each 6 chest set unloads evenly. Wire the chests together and go to an Arithmetic Combinator. Also add a Constant Combinator, set to the negative amount that the station can hold. Have the AC take Each / negative capacity of train, output Each. Send the output of the AC to the train stop, again enabling and setting the limit based on the station's unloading item.
Example :
That same 4 cargo wagon train gets to the unloading station. 4 wagons * 6 chests * 9600 = 230400 station capacity. Set the Constant Combinator to -230400. Wire this to the chests/Arithmetic Combinator. The AC takes Each / -32000, output Each. This result is sent to the train stop, where Enable if Green Circuit >= 1, Limit Green Circuit.
This works because the CC outputs the negative of the station at maximum capacity. The chests are then added to it by the circuit network, resulting in the total signal being how short of full the station is, but as a negative number. Dividing that by the negative gives a positive result, so we divide the space left by the capacity of one train to see how many trains are needed to fill the station.
The maximum station limit using this method will be 7. So plan your stackers accordingly. you can use a combination of Arithmetic Combinators and Decider Combinators to limit the number of trains if you want a max under 7.
This, of course, only works with homogenous trains, trains only carrying one cargo type. If you are mixing trains (such as a wall repair/resupply train carrying walls, repair packs, extra laser turrets and flamethrower turrets, as well as extra construction bots, pipes, and pipe to grounds, this method won't work.
Just make sure that the Wait Loaded and Wait Empty areas have enough capacity for all of your trains using this system.