so i made a "thing" that controls the routing of Trains by their contents and is easy to setup in a Constant Combinator:
In the Screenshot you can see the Trains on the left before they passed the Station on Top. On the right they were sorted according to the Settings in the Constant Combinator. In general, this is done by reading the trains content and only allowing a single rail-signal to open up and let the train pass.
The Signals/Lanes are numbered as the yellow numbers indicate. Lane 0 is used as a overflow, for all the items that are not set in the Constant Combinator. It's also possible to give different Lanes the same number i.e. Lane 7.
The Routing can be programmed in the Constant Combinator
Constant Combinator Settings
Simplified overview on how this works:
The Controller
The Rails
The Trains
The train is held in the station until it receives the check-signal from the Decider Combinator.
Blueprint so you can get your trains sorted and routed:
Notice: make sure you have your filtered-inserters installed at your unloading-sites, just saying, in the very unlikely case something goes wrong
Notes:
- This could be much smaller if i didn't made that offset-value adjustable (completely useless, just use a fix number)
- Lanes could also be hardcoded (instead of using Constant Combinators)
- There are some signals that need to be tick-perfect, which adds even more combinators/complexity to this (...well i tried to get rid of them but that broke everything... again...)
- I didn't wanted to go too deep in explaining every single combinator, but if you would like to know more specifics feel free to ask.
- There's allready a post called "Routing of Trains by their contents", so sorry for my bad title here.