Page 1 of 2

[MOD 0.15+] Automatic train deployment

Posted: Mon Jun 12, 2017 7:52 pm
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!

Re: [MOD 0.15] Automatic train deployment

Posted: Fri Jun 23, 2017 5:54 am
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 !

Re: [MOD 0.15] Automatic train deployment

Posted: Sat Jul 01, 2017 12:25 pm
by Mobius1
Can't make the mod to work and it doesn't work with modded trains.

Re: [MOD 0.15] Automatic train deployment

Posted: Sat Jul 01, 2017 2:08 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Jul 05, 2017 5:54 pm
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?

Re: [MOD 0.15] Automatic train deployment

Posted: Sat Jul 22, 2017 2:31 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Mon Jul 24, 2017 6:59 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Thu Aug 03, 2017 1:12 am
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

Re: [MOD 0.15] Automatic train deployment

Posted: Mon Aug 07, 2017 2:55 am
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 09, 2017 7:39 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 09, 2017 7:56 pm
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

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 09, 2017 8:09 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 09, 2017 8:45 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 09, 2017 10:37 pm
by vanatteveldt
OK, now you get the complete screenshot ;-)

Image

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 16, 2017 10:44 am
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 16, 2017 4:46 pm
by aaargha
That should be no problem, I'll try to get a new version out pretty soon.

Re: [MOD 0.15] Automatic train deployment

Posted: Wed Aug 16, 2017 7:21 pm
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

Re: [MOD 0.15] Automatic train deployment

Posted: Fri Aug 18, 2017 2:28 pm
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).

Re: [MOD 0.15] Automatic train deployment

Posted: Fri Oct 27, 2017 7:58 pm
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.

Re: [MOD 0.15] Automatic train deployment

Posted: Sun Oct 29, 2017 11:05 pm
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.