Specific train stops / no stops per circuit

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
HansMeiser
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Jul 13, 2022 8:15 pm
Contact:

Specific train stops / no stops per circuit

Post by HansMeiser »

My next question in the topic of trains and circuits.
After learning that train stations can be disabled by circuit conditions, and this works great to an extend, I'm infront of another ... variation.
I have train stations, where a few different trains go through.
My task I want to solve:
Let all trains stop at this station, but tell a specific train "no, here is nothing to do, don't even bother to come here".
Quasi the functionallity of "disabled station" but only for a specific train. I thought the "send to train" would be the solution but honestly, I don't get it how this really works ... :(

I hope someone can lend a hand to push me in the right direction. Thanks in advance. :)

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Specific train stops / no stops per circuit

Post by robot256 »

To make the train leave early because it is a particular train at a particular time, you can set the Train Stop to "Read stopped train". This will provide the unique Train ID to the circuit network (and it equals zero when no train is present). This will always stay the same as long as you don't couple/uncouple/destroy/teleport any part of the train. You can detect a particular train id and send a circuit signal to the train based on it.

(Trains can only receive circuit signals when they are stopped at the station.)

To have a train conditionally *skip* a schedule entry, you will need one of the many schedule -modifying mods. "Dispatcher", "Simple Circuit Trains", and "Stringy Train Stops" all have the potential to do what you want. Typically that will involve setting the destination as the train leaves the previous stop, so your "skip next stop" signal needs to be received by the train at the previous stop in its schedule.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Specific train stops / no stops per circuit

Post by Pi-C »

robot256 wrote:
Sun Jul 17, 2022 2:43 am
To make the train leave early because it is a particular train at a particular time, you can set the Train Stop to "Read stopped train". This will provide the unique Train ID to the circuit network (and it equals zero when no train is present). This will always stay the same as long as you don't couple/uncouple/destroy/teleport any part of the train. You can detect a particular train id and send a circuit signal to the train based on it.
While it may be tempting to filter out trains by specifying their ID, it really doesn't make much sense to hardcode the train ID into combinators as it is likely to change over the course of the game (e.g. if biters kill a wagon, if another train crashes into it, or if wagons/locos are added/removed by the player). It may be safer to read what's loaded onto the train and filter by that.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

HansMeiser
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Jul 13, 2022 8:15 pm
Contact:

Re: Specific train stops / no stops per circuit

Post by HansMeiser »

To have a train conditionally *skip* a schedule entry, you will need one of the many schedule -modifying mods. "Dispatcher", "Simple Circuit Trains", and "Stringy Train Stops" all have the potential to do what you want.
Many thanks for those suggestions. I will look into it.
In my search, I came to the "Smarter Trains" mod in hope to do what I want, but either it isn't able to do it or (more likely) I did not understand the mod very well on how to set it up.

Thanks all for your ideas so far. :)

HansMeiser
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Jul 13, 2022 8:15 pm
Contact:

Re: Specific train stops / no stops per circuit

Post by HansMeiser »

UPDATE:
I tried "Dispatcher" and "Simple Circuit Trains", but none of them does "the right thing". :roll:
As far I can tell from this short review, all mods lack the same problem: the supply train always uses the depot station in the circle. That's not really wanted.
Also, it doesn't solve the problem of multiple unload items at a single station, like I want to have .

To illustrate:
I have an outpost O where batteries should be produced. So I need iron plates, copper plates and coal (for electricity). I set up O so that all stuff unloaded there (on a single station) get sortet into iron, copper and coal. Iron and copper will be delivered from 2 seperate trains and they go continously.
Coal gets delivered from a third train (name it CT), that delivers coal to several places in a circle elsewhere.
Because coal isn't needed so much at O, I want to only get coal when O sends a signal (to CT).

Now the tricky part: I need to let iron and copper come continously (as there is never a holdup), but coal only when needed at the same station. That means, if O sends a signal, the station should be come available to train CT and O should be included in the circuit.

So, if the circle schedule of train CT is like A -> B -> C -> A -> B -> C -> A [...], when O sends a signal, the schedule should be like A -> B -> C -> O -> A -> B -> C -> O -> A [...] till the signal is disabled again and the schedule is again A -> B -> C -> A -> B -> C -> A [...]

Essentially a "temporary stop" of the station controlled by a signal. I don't know if that exists or is even possible. Anyone knows maybe ... ? :?:

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Specific train stops / no stops per circuit

Post by robot256 »

The behavior you are looking for (a single stop that requests different trains with different resources only when they are needed) is closest to what LTN does.

The only way to do that without LTN is to either a) have a dedicated coal train that waits at the depot/loader until it receives a "coal empty at outpost" signa causing it to depart, or b) use a different stop that enables separately.

To do the second one, you don't need a separate unloading track. You can put the coal stop on the same track right next to the iron-copper stop, and add some more inserters to unload the slightly-offset wagons. That's a trick I often use to get different trains to do different things along the same track, so they each have their own stop names.

Edit: I forgot the third way: have a "coal waypoint" stop at the entrance to the common unloading station. When there is enough coal, set the coal waypoint train limit to 0, and when it needs coal set the limit to 1. In the coal train schedule, put the coal waypoint right before the unloading station. The coal train will not leave the previous station unless the coal waypoint has a "slot" open. Once the train arrives at the waypoint, it will always path to the closest "unloading" stop that is next in its schedule, which will be the shared stop at the outpost.

HansMeiser
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Jul 13, 2022 8:15 pm
Contact:

Re: Specific train stops / no stops per circuit

Post by HansMeiser »

@robot256
Thanls for this valuable suggestions. I will look into this as it looks very interesting to experiment with. Many thanks for that! :D

UPDATE:
After playing with LTN for a while, I must say, what a gread MOD! :) This makes scheduling and transport so much more easier, I love it. Many thanks again for this hint. :D

Post Reply

Return to “Gameplay Help”