Train Depot


Automatically clones trains at new advanced train stations called train depots. The train to clone is set by a circuit network signal sent to the station. It can clone schedule and filter settings as well as the carriages. Also adds a combinator that sends a signal counting the number of trains scheduled for a station it is placed next to. Check the mod portal for details on signals and usage.

Content
5 years ago
0.16
5
Trains

a Slow updates until 0.17

5 years ago
(updated 5 years ago)

Hi all,

I wanted to give some idea why I've stopped making updates recently to bring Train Depot out of beta status.

  1. I experienced an injury that made it difficult/impossible to be at a computer and/or type that I've since recovered from, but it put me out of the mod business for a few weeks.
  2. 0.17 brings many major improvements directly in benefit to the Train Depot mod. The main three are:

[# Trains in block API]
A solution to the most nagging issue with the current implementation of the mod causing mutiple issues where trains accidentally get connected to each other as one fully constructed train leaves the train depot station while another is being constructed: https://forums.factorio.com/viewtopic.php?f=65&t=64118

Now, without implementing an enormously complex scanning mechanism in Lua to detect train clearance, in 0.17 I'll be able to read a single value from the Factorio API to know whether it's safe to place a train carriage on a live rail.

[Train blueprints]
When I first set out to create this mod, my original implementation attempted to have the train depot create ghost carriages with the intention that bots would carry resources from logistic storage and place the actual carriage. This would have solved the need for the train depot (a glorified train station) to have an inventory, which it cannot actually do with the Factorio API. When I discovered that I could not place ghost carriages, I had to hack a solution by placing the awkward chest that currently sits overlapping the train depot so that it could accept inventory.

With 0.17, described by https://www.factorio.com/blog/post/fff-263 , I can now place ghost carriages as was the original design and can remove the awkward overlapping chest. That chest currently causes a couple issues: it's hard to click on without accidentally clicking on the train depot, and blueprints including logistics wiring to the chest is not retained when the blueprint is placed.

[Temporary Stations]
In https://www.factorio.com/blog/post/fff-279 , kovarex describes a new kind of train schedule item called a temporary station. That is, a station at which the train will stop only once and upon leaving the schedule item will be removed from the train's schedule.

In its current implementation, Train Depot actually already does this when it builds a train. It has to add a "temporary stop" at the train depot in order for the train to properly "stop" (meaning, allow loading from adjacent pumps or inserters) at the train depot at which it is built. This is essential because players must make sure the train gets fueled at the time it is built. Once the train leaves the Train Depot, the mod removes the train depot stop from the train's schedule, essentially emulating a temporary stop. The way I implemented it in the mod is kind of klugy, though, and having a game engine-supported way to do this is great!

So, it makes sense to focus effort on finishing the mod when 0.17 lands. I'll continue to try to fix bugs or add small enhancements by request until then. Just post here.

New response