[MOD 0.15+] Automatic train deployment

Topics and discussion about specific mods
aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

[MOD 0.15+] Automatic train deployment

Post by aaargha »

Info Important changes made in 0.1.1
Source trains should no longer be parked at the input stop, it is enough that they are roughly in position to make them recognizable. This means that the source schedule should no longer contain the input stop. There is migration code included with 0.1.1 that should upgrade any setup working in 0.1.0 to the new system. However if anything is broken this is probably what has caused it.

As parts of the details are no longer relevant I'll strike those to make it clearer what has changed, this also means that the images in the examples are not 100% correct.
Details and usage
Mod settings
Changelog
Feedback/bug reports/questions welcome!

Enjoy!
Last edited by aaargha on Wed Jan 22, 2020 7:55 pm, edited 9 times in total.

waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by waduk »

Wow, didn't aware of this. Thanks !
Such a huge help....

Also...
"Theme song for this project is Queen: I'm going slight mad"
Lol, definitely gonna listen to the song when testing.
Long live Freddie !

Mobius1
Fast Inserter
Fast Inserter
Posts: 191
Joined: Thu Feb 09, 2017 12:05 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by Mobius1 »

Can't make the mod to work and it doesn't work with modded trains.

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

Mobius1 wrote:Can't make the mod to work and it doesn't work with modded trains.
I'm going to need a bit more information to help you with that. What are you trying to do? What result are you expecting? What happens instead? Does the save file attached in the OP work?

For the modded trains it would also be great to know in what way it does not work and what mod you're having problems with.

Mobius1
Fast Inserter
Fast Inserter
Posts: 191
Joined: Thu Feb 09, 2017 12:05 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by Mobius1 »

aaargha wrote:I'm going to need a bit more information to help you with that. What are you trying to do? What result are you expecting? What happens instead? Does the save file attached in the OP work?

For the modded trains it would also be great to know in what way it does not work and what mod you're having problems with.
I took your blueprint string, placed down the stops, the default train to be copied but no trains spawned. Added a requester chest requesting the train pieces and fuel, attached that requester chest with "read contents" to the train stop, no trains spawned.
Modded trains that I'm using are Bob's locomotives, MK2, MK3, cargo wagon MK2, MK3. Angel's locomotives from Angel's Logistics (Beta) "crawler" wagons and locos. Also tried spawning some Armoured Locomotives from bob's mods, no luck either.

I want to make an automatic train deployment system that will spawn 13 trains on my stations as that's the max limit of trains allowed on them, so I would place the "spawner" station somewhere along the track network and as long as the number of trains deployed is below 13, it would deploy trains to the station, once it reaches 13, it would disable the "spawner". But I don't know how to feed those infos to the station or the pieces of the trains, I'm working with LCL trains.

What am I doing wrong?

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

Mobius1 wrote:I took your blueprint string, placed down the stops, the default train to be copied but no trains spawned. Added a requester chest requesting the train pieces and fuel, attached that requester chest with "read contents" to the train stop, no trains spawned.
Modded trains that I'm using are Bob's locomotives, MK2, MK3, cargo wagon MK2, MK3. Angel's locomotives from Angel's Logistics (Beta) "crawler" wagons and locos. Also tried spawning some Armoured Locomotives from bob's mods, no luck either.

I want to make an automatic train deployment system that will spawn 13 trains on my stations as that's the max limit of trains allowed on them, so I would place the "spawner" station somewhere along the track network and as long as the number of trains deployed is below 13, it would deploy trains to the station, once it reaches 13, it would disable the "spawner". But I don't know how to feed those infos to the station or the pieces of the trains, I'm working with LCL trains.

What am I doing wrong?
Thank you for clarifying and apologies for the delay, I've been out of town.

From your description it does not wound like you're using it correctly, as there is currently no cost for spawning trains other than setting up the template train, but I'm not really sure. I'd recommend taking a look at the savefile in the OP as that one includes a functional (as least it was when I left but that was a few versions ago) setup.

I will take a look to make sure that the modded locos/wagons work, but it may take a while as a lot of stuff seems to have happened while I was away.

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

Added a new version that should make setting things up easier, details are in the OP.

@Mobius1: Modded trains seems to work fine as far as I can see (tested some of bobs and angels, not the crawler though), unless you're getting crashes it's likely that you're doing something wrong, try getting regular trains working first to make sure you've set it up correctly, just to be sure.

User avatar
infinitysimplex
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Jul 28, 2017 8:26 pm
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by infinitysimplex »

Mobius1 wrote:
aaargha wrote:I'm going to need a bit more information to help you with that. What are you trying to do? What result are you expecting? What happens instead? Does the save file attached in the OP work?

For the modded trains it would also be great to know in what way it does not work and what mod you're having problems with.
I took your blueprint string, placed down the stops, the default train to be copied but no trains spawned. Added a requester chest requesting the train pieces and fuel, attached that requester chest with "read contents" to the train stop, no trains spawned.
Modded trains that I'm using are Bob's locomotives, MK2, MK3, cargo wagon MK2, MK3. Angel's locomotives from Angel's Logistics (Beta) "crawler" wagons and locos. Also tried spawning some Armoured Locomotives from bob's mods, no luck either.

I want to make an automatic train deployment system that will spawn 13 trains on my stations as that's the max limit of trains allowed on them, so I would place the "spawner" station somewhere along the track network and as long as the number of trains deployed is below 13, it would deploy trains to the station, once it reaches 13, it would disable the "spawner". But I don't know how to feed those infos to the station or the pieces of the trains, I'm working with LCL trains.

What am I doing wrong?
Sounds to me like you got the wrong mod... or rather, you read the wrong description?
https://mods.factorio.com/mods/cooky173 ... ainBuilder

User avatar
infinitysimplex
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Jul 28, 2017 8:26 pm
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by infinitysimplex »

@Mobius1
Also note that this mod's deconstruction will conflict with the "Automatic Train Deconstruction" mod:
https://mods.factorio.com/mods/hopewell ... nstruction
Automatic Train Deployment (this thread's mod) both creates and deletes trains, "for free", without chests. The other two mods use chests to pick up or store locomotives & wagons.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by vanatteveldt »

I love this mod! It makes it so much easier to test rail setups, and it is just fascinating sometimes to see the trains going about there business :)

One ease-of-living request: can you make the train destruction station emit a signal for every train deleted (for counting throughput)? I now read a signal, enable an inserter, and count pulses.

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

Maybe, I'm not really sure how hard it would be to set up, it's probably better for performance to just use a regular train counter though. I'll take a look but if I have to start registering on_tick handlers to make it work I'll probably leave it as it is.

Below should be all the parts you need for a simple train counter, I hope, it is currently set to reset if it receives the "Rail signal" signal, it's basically what I use for the 4-way throughput testing.
Train counter

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by vanatteveldt »

aaargha wrote:Maybe, I'm not really sure how hard it would be to set up, it's probably better for performance to just use a regular train counter though. I'll take a look but if I have to start registering on_tick handlers to make it work I'll probably leave it as it is.
A ok, I hoped it would be trivial because you evidently run some sort of code anyway to make the train disappear. Never mind if it's not trivial :)
aaargha wrote:Below should be all the parts you need for a simple train counter, I hope, it is currently set to reset if it receives the "Rail signal" signal, it's basically what I use for the 4-way throughput testing.
Train counter
Ha, smart use of the 1 tick time difference to only get a single count per train, never thought of that.

For reference, this is my clumsy counter, which probably only works because of the deletion stop:
Image

Red signal -> inserter moves the train and generates a single signal pulse. By the time the train token is back in the starting position the actual train has been deleted, so it generates only one pulse per train.

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

Hey, as long as it works :)

Using a inserter on pulse mode is actually a really useful trick, especially for building reset buttons.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by vanatteveldt »

OK, now you get the complete screenshot ;-)

Image

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by vanatteveldt »

Another request if completely trivial: can you copy train colours from the source? It would be nice to differentiate trains from multiple sources to understand network flow better.

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

That should be no problem, I'll try to get a new version out pretty soon.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by vanatteveldt »

aaargha wrote:That should be no problem, I'll try to get a new version out pretty soon.
Cool. BTW, here is a nice gif of the mod in action: viewtopic.php?f=194&t=51891

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

OK, the new version should be up as soon as the mod portal stops being slooooooow. I've added support for locomotive colour, cargo wagon filters, fluid wagon tank settings, fluid wagon contents, and cargo wagon contents (not slot for slot but as a whole, I hope at least).

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by aaargha »

Added a new version that should fix a possible crash if you rename the train stop a train is stopping at the same frame as it arrives. The new version should also be a bit more resilient if other mods also change things with trains. It also includes a minor code clean-up enabled by the 0.15.32 API changes.

Unless you're having problems, sticking with the old version should be fine.

FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Re: [MOD 0.15] Automatic train deployment

Post by FrodoOf9Fingers »

I'm having some difficulty getting the Copying Train Output to work, namely, the train spawns, but its not set to automatically go. Not sure what could be wrong, The Random Train Output stops seems to work.

Post Reply

Return to “Mods”