[MOD 0.15] SmartTrains 2.0.5

Topics and discussion about specific mods
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.3

Post by siggboy »

Yes, trainlines in 0.13 might not be as usefull for smaller/vanilla ressource maps. Back in 0.12 trainlines offered the conditions that are now vanilla.
Train lines are not useful until suddenly they become extremely powerful. It's really just a matter of base size.

As soon as you have several trains taking the same route, it's already nice to have the grouping visible in the UI. It shows you the number of trains, and makes it easier to add a new train to an existing line, without having to copy-paste the settings from another train.

The real power comes when you use the signal to go to a station directly. That's the killer feature of Smart Trains that Vanilla Factorio does not provide.
Lol: Everyone is doing all these fancy things, and here I sit, just using it to make sure my trains have enough fuel :|
You can also read cargo of a train, another feature that is still missing in Vanilla and is requested ALL THE TIME by players.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Aes Sedai
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri Jan 08, 2016 12:37 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.3

Post by Aes Sedai »

Choumiko wrote:Updated to SmartTrains 0.4.4
  • fix adding a new line
  • fix hardReset to properly initialize
Seems like i should not only try changing lines but also adding new ones :D
Bizobinator wrote:I'm a little bit confused what the purpose of lines is? I usually only produce enough resources at a mine-site to warrant a single, 2-container train.

Lol: Everyone is doing all these fancy things, and here I sit, just using it to make sure my trains have enough fuel :|
Yes, trainlines in 0.13 might not be as usefull for smaller/vanilla ressource maps. Back in 0.12 trainlines offered the conditions that are now vanilla.
Loaded up 0.4.4, things seem to be working properly. Thanks for the quick fix!
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by siggboy »

I'm getting

control.lua:826: attempt to index field "?" (a nil value)
control.lua:1004: attempt to compare number with boolean

when I send a train around two Vanilla stations.

I did have a smart train line on the map but removed it. The bug still triggers.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Bizobinator
Fast Inserter
Fast Inserter
Posts: 193
Joined: Fri May 06, 2016 10:35 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.3

Post by Bizobinator »

Aes Sedai wrote:
Bizobinator wrote:I'm a little bit confused what the purpose of lines is? I usually only produce enough resources at a mine-site to warrant a single, 2-container train.

Lol: Everyone is doing all these fancy things, and here I sit, just using it to make sure my trains have enough fuel :|
Using the RSO mod to spread resources out makes trains much more useful. I have an iron patch that's a two minute train ride away, and it's much easier to simply add more trains to get a lower Load Station to Unload Station lag time, which means I can usually employ my furnaces more often instead of having them work in bursts. If you don't have a need for more than a couple of trains per route, then lines won't be as useful. I don't want to have to setup and modify the schedule for six trains and hope I don't mess up a wait condition somewhere haha.

Yeah, I've got RSO too. I usually still just go with one, but make enough to create a buffer: drop-off station --> chests --> lanes --> warehouse(s) --> lanes --> foundaries.
Bizobinator
Fast Inserter
Fast Inserter
Posts: 193
Joined: Fri May 06, 2016 10:35 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.3

Post by Bizobinator »

siggboy wrote:
Yes, trainlines in 0.13 might not be as usefull for smaller/vanilla ressource maps. Back in 0.12 trainlines offered the conditions that are now vanilla.
Train lines are not useful until suddenly they become extremely powerful. It's really just a matter of base size.

As soon as you have several trains taking the same route, it's already nice to have the grouping visible in the UI. It shows you the number of trains, and makes it easier to add a new train to an existing line, without having to copy-paste the settings from another train.

The real power comes when you use the signal to go to a station directly. That's the killer feature of Smart Trains that Vanilla Factorio does not provide.
Lol: Everyone is doing all these fancy things, and here I sit, just using it to make sure my trains have enough fuel :|
You can also read cargo of a train, another feature that is still missing in Vanilla and is requested ALL THE TIME by players.
Use the signal to go to a station directly? What do you mean?

Also: How do I set up the read cargo of a train? That sounds REALLY useful!
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by Nexela »

Bizobinator wrote: How do I set up the read cargo of a train? That sounds REALLY useful!
When you build a smart station if you connect to the combinator on the station you can read from the train. Make sure to connect to the combinator and not the lamp or station itself

Use the signal to go to a station directly? What do you mean?
Doing this off the top of my head.
Set up your line and in the options have it set to go to station number, then connect to the lamp on the station to a signal wire outputing the station number you want it to go to.
set up your route in factorio then create a line in smart trains.

So for this simple example:
IRON unload - wait till empty
iron load - goto station #
iron load 2 - goto station #
iron load 3 - goto station #

you could have a circuit at each station that outputs either 1, if the train is full or (2 or 3 or 4) if it is not using the station combinator to get cargo, some arith and deciders on site, and finally the lamp
Bizobinator
Fast Inserter
Fast Inserter
Posts: 193
Joined: Fri May 06, 2016 10:35 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by Bizobinator »

Set up your line and in the options have it set to go to station number, then connect to the lamp on the station to a signal wire outputing the station number you want it to go to.
set up your route in factorio then create a line in smart trains.

So for this simple example:
IRON unload - wait till empty
iron load - goto station #
iron load 2 - goto station #
iron load 3 - goto station #

you could have a circuit at each station that outputs either 1, if the train is full or (2 or 3 or 4) if it is not using the station combinator to get cargo, some arith and deciders on site, and finally the lamp
Wut?

Wait, I'm a little confused by what you mean by go to the station directly.... Like, it only goes out to the mines if there is stuff to pick up? Or,if it isn't already full? Or, it'll go back to base if it's already full?
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by siggboy »

Bizobinator wrote:Wait, I'm a little confused by what you mean by go to the station directly.... Like, it only goes out to the mines if there is stuff to pick up? Or,if it isn't already full? Or, it'll go back to base if it's already full?
If you have a train line with several stations in it, they all get assigned a number (by the SmartTrains mod).

So if you set up a train schedule (with the Factorio user interface), you can then save it into a SmartTrains train line. And if you look at that train line, you'll see that every station has a number (#1, #2, #3, ...)

Let's make an example, and assume you've stored the following train line:

#1 Main Base
#2 Iron Outpost 1
#3 Iron Outpost 2
#4 Iron Outpost 3

Now, the train will start at the main base, and then visit the three outposts in turn, then go back to the main base.

However, with SmartTrains you can also send the train to any of the stations on the line directly. It will then not use the usual order of "#1 -> #2 -> #3 ..."

You do this by setting the signal on the lamp at the train station to the number of the station where you want the train to go next (you also have to set the condition on the lamp). In the SmartTrains user interface you set the checkbox "Signal #". Now, when the train leaves the station, it does not go to the next station in the sequence, but it will go to the station number of the signal.

You should try it out yourself in a game, then you will understand it much better. It's not really difficult at all.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by Nexela »

What Siggboy said :). This is one of those mods that could use an expanded spotlight/how-to video for .13 but once you get the hang of it you will never want to be without it. Just the lines management portion alone is still 100x better than vanilla
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by Choumiko »

Updated to SmartTrains 0.4.6 (a.k.a. "The Last Release Before Going On The Portal" Number 4 (or how ever often i said that.. :mrgreen: ))
  • fixed trainstops near curves not being detected
  • fixed trainstops not being detected when the train was already at a station and stoped/started manually
  • rewrote traintracking to use unit_numbers/ better detect de/coupling of trains
The new traintracking might proof useful for train id's. The unit_number is unique across all entities in Factorio which have a owner. SmartTrains right now uses the number of the first locomotive. It will always be the same until you change the setup of the train (remove/add a locomotive/cargo-wagon, de/couple parts of the train), and even then, if the first locomotive stays the first locomotive it will not change. Does this sound like a good candidate for the ID?
The numbers are a bit random (i.e. the first loco you place will probably have a fairly high unit_number, depending on how many other stuff you have built) but outputting it is a no issue since SmartTrains keeps track of it anyways.

@Bizobinator : SInce you seem to be new to SmartTrains, let me know if https://github.com/Choumiko/SmartTrains ... /README.md is helpfull in any way or what is confusing. Having a hard time writing a manual since i know all of it :)
Bizobinator
Fast Inserter
Fast Inserter
Posts: 193
Joined: Fri May 06, 2016 10:35 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by Bizobinator »

siggboy wrote:
Bizobinator wrote:Wait, I'm a little confused by what you mean by go to the station directly.... Like, it only goes out to the mines if there is stuff to pick up? Or,if it isn't already full? Or, it'll go back to base if it's already full?
If you have a train line with several stations in it, they all get assigned a number (by the SmartTrains mod).

So if you set up a train schedule (with the Factorio user interface), you can then save it into a SmartTrains train line. And if you look at that train line, you'll see that every station has a number (#1, #2, #3, ...)

Let's make an example, and assume you've stored the following train line:

#1 Main Base
#2 Iron Outpost 1
#3 Iron Outpost 2
#4 Iron Outpost 3

Now, the train will start at the main base, and then visit the three outposts in turn, then go back to the main base.

However, with SmartTrains you can also send the train to any of the stations on the line directly. It will then not use the usual order of "#1 -> #2 -> #3 ..."

You do this by setting the signal on the lamp at the train station to the number of the station where you want the train to go next (you also have to set the condition on the lamp). In the SmartTrains user interface you set the checkbox "Signal #". Now, when the train leaves the station, it does not go to the next station in the sequence, but it will go to the station number of the signal.

You should try it out yourself in a game, then you will understand it much better. It's not really difficult at all.

I think I follow what it is, although I doubt I'll use it :P. I usually only have 1 mine running at a time (at least ~2/5 of the way into the game. Trying desperately to control pollution...).
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.4

Post by siggboy »

Bizobinator wrote:I think I follow what it is, although I doubt I'll use it :P. I usually only have 1 mine running at a time (at least ~2/5 of the way into the game. Trying desperately to control pollution...).
It's not useful for small bases. The elaborate setups are only pulling their weight in large to very large end-game factories, where train throughput can become an actual problem -- then it helps to reduce the amount of required trains.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Aes Sedai
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri Jan 08, 2016 12:37 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.6

Post by Aes Sedai »

Just ran into another error in SmartTrains, __SmartTrains__/gui.lua:949: attempt to index field '?' (a nil value). I had a train line previously, removed the station and line, and was in the process of updating the schedule for the train to make a new line. When I tried to save the new line, it had the old schedule in the ST window still, though the schedule on the train window itself was the updated schedule. Closing and opening it again showed the line was created, even though it errored. I've attached the error report.
Attachments
errorReportSmartTrains.txt
(20.79 KiB) Downloaded 102 times
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.6

Post by Choumiko »

Updated to SmartTrains 0.4.7
  • some fixes for errors when creating/changing lines
Aes Sedai wrote:Just ran into another error in SmartTrains, __SmartTrains__/gui.lua:949: attempt to index field '?' (a nil value). I had a train line previously, removed the station and line, and was in the process of updating the schedule for the train to make a new line. When I tried to save the new line, it had the old schedule in the ST window still, though the schedule on the train window itself was the updated schedule. Closing and opening it again showed the line was created, even though it errored. I've attached the error report.
I couldn't reproduce the error (and the line didn't make much sense for 0.4.6) but i think it should still be fixed in the latest version :D
doxsroxs
Fast Inserter
Fast Inserter
Posts: 160
Joined: Mon Aug 01, 2016 4:19 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.6

Post by doxsroxs »

Choumiko wrote:Updated to SmartTrains 0.4.7
  • some fixes for errors when creating/changing lines
Aes Sedai wrote:Just ran into another error in SmartTrains, __SmartTrains__/gui.lua:949: attempt to index field '?' (a nil value). I had a train line previously, removed the station and line, and was in the process of updating the schedule for the train to make a new line. When I tried to save the new line, it had the old schedule in the ST window still, though the schedule on the train window itself was the updated schedule. Closing and opening it again showed the line was created, even though it errored. I've attached the error report.
I couldn't reproduce the error (and the line didn't make much sense for 0.4.6) but i think it should still be fixed in the latest version :D
Hi, thanks this resolved some of my errors I was getting.
I have not checked yet, but did you also fix the errors that came in the following situations?
Removing a locomotive that is part of a trainline (also triggers when removing a locomotive from a consist that is part of a trainline)
Driving manually and accidentally disconnecting a wagon while at speed. This triggered an error that said, "You should never see this, look away" or something similar
Destroying a locomotive part of a trainline
Destroying a locomotive with a player inside it

Can probably provide screenshots if needed, but thought Id just ask first since I think they are easy to reproduce.
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663
doxsroxs
Fast Inserter
Fast Inserter
Posts: 160
Joined: Mon Aug 01, 2016 4:19 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.7

Post by doxsroxs »

Hi again, here is one error I get when I remove a train that is assigned to a line from the track.

Image
Attachments
errorReportSmartTrains.txt
Error report
(40.13 KiB) Downloaded 95 times
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663
Spongeloaf
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Aug 18, 2016 2:57 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.7

Post by Spongeloaf »

I am very confused.

I don't understand the difference between the "Signal #" checkbox and the "station # textbox in the line rules window. Also, how does this relate to the station mapping? I'm missing some part of the core concept here.

My test train is not going to a station I have specified, but rather to the next one in the line. I have four stations, numbered 0 to 3, with 0 being the departure point at which the train is set to wait for a signal > 0 on "station #". I'm using a constant combinator to output a value of 3 on the signal "station #" to the smart station lamp, and have set the "station #" to 3 in the line rules, but the train always goes to the next station in line, no matter what.

The readme clearly states what each checkbox does, but never does it say under what circumstances, or for what purpose, which is just as important. Please help!
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.7

Post by siggboy »

If you want to use the lamp as the station number, you have to set a condition on the lamp, too. Let's say you want to use the "D" signal as the destination number. Then you input "D=n" to the lamp an on the lamp you need to set the condition "D > 0".

If you don't set a condition on the lamp, then SmartTrains does not know which signal to use (there could be more than one signal on the lamp).

The "signal #" checkbox means: if there's a signal on the lamp, then use that signal to find your next stop.

The "station #" input is to explicitely give a station number in case there is no signal on the lamp or the signal # checkbox is not used at all. You do not use that input field if you always use the lamp. The input field is very useful if you always want to return the train to a certain (fixed) location after a stop.
You could, for example, collect all your ore outposts and the ore unload (smelting) on the same line, and then set the number of the unload in the "station #" input field of each outpost. That means that the train will go to an outpost, and then to the unload (and not to the next outpost, which is quite useless if the train is full). From the unload you send the train to one of the outposts that currently have ore; for this you use the lamp, because this number is not fixed.

The station # mapping is for convenience, and you usually do not need it. If you reorder and change the stations often, then it helps to have a stable station numbering, which is especially useful if you use the input fields, too.

A typical, easy use case for the lamp signal is this: your unload station has a fixed number (you can use the station # mapping to keep it fixed, or you put the station first in the schedule then it will always be number "1"). You let your train take a round-trip, loading ore along the way. When the train is full, you output the station number of the unload to the lamp. Otherwise you output nothing (the train will then go to the next hop in the schedule). The result is that the train returns to the unload as soon as it's full.

You can also make a smart oil delivery with barrels that way (dump empty barrels at the pumping station, load full barrels into the train, and have it return to the refinery as soon as it is out of empty barrels or there's no more space for full barrels; usually you use a dedicated wagon for empty and full barrels, respectively).

In short:
  • If your destination is known, and fixed, use the "signal #" input field. Do not use the "signal #" checkbox.
  • If your destination is dynamic, then use the checkbox, and don't use the input field (unless you want it as a fall back).
  • In all other cases (no checkbox, no input field, and/or no signal on the lamp) the train will simply go to the next station in the sequence.
If you want to see a (very) complex setup, then go to the link in my signature and download the version 3 of my setup (link is in the first post of that thread, at the very top). It's for 0.13 and you need to have the latest versions of everything (SmartTrains and Factorio).
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Spongeloaf
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Aug 18, 2016 2:57 am
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.7

Post by Spongeloaf »

Thanks siggboy! It makes much more sense now. I'll try it out after work tonight.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.12.35|0.13] SmartTrains 0.3.95|0.4.6

Post by Choumiko »

Updated to SmartTrains 1.0.0
  • requires Factorio >= 0.13.13
  • fix errors related to mining/destroying trains
THe big version jump is only because i finally felt brave enough to release it on the portal :D
Last edited by Choumiko on Sat Sep 10, 2016 3:37 pm, edited 1 time in total.
Post Reply

Return to “Mods”