RefuelStations:
In the ST-Settings ui you can define the name of refueling station. If you want to use auto refueling, your actuall refueling station(s) must be named depending on the Train they can refuel. SmartTrains creates a type depending on how your train is set up. E.g. a single headed train with 4 cargo-wagons is of type L-CCCC, a double headed train might be L-CCCC-L. So if you use L-CCCC trains, your station needs to be "Refuel L-CCCC", "Refuel L-CCCC-L", etc.
When a train needs refueling, the station will be added to the end of the schedule. So plan for that by making the last station in the schedule close to a reachable refuelstation. (I tend to have the station at the Factory last and the refueling stations between the base stations and the mainline, so they can refuel after delivering their cargo and before going to outposts)
A quick howto on trainlines:
Creating a line: Stop the train, change the schedule as you wish, click "Read from UI", name the line, hit "Save as line", start the train. Done. The train is then automatically assigned to this line.
Changing a line: Like creating a line, when hiting "Read from UI" the train is unassigned from it's current line. The train your saving the line on get's updated right away, all other trains update at the next station they are going to
When you delete a line which has trains assigned, the trains delete their line and just keep the schedule
Renaming a line: If you rename a line, the trains stay assigned to the new name, so no need to reassign them
Rules: To set the "leave Station when empty/full" rule, click on "Rules" in the trainlines window, set it for the stations, click save. Done. The first check for the rule will happen 4 seconds after arriving at a station, the next ones every 2 seconds. If the normal waiting time is passed the train will still leave. You can change the time in ST-Settings ("Min. waiting time" and "Interval for autodepart")
Screenshots will follow, with explanation of what setting does what etc.
add/remove rules after copying a line with changed # of stations
0.3.79
fixed "full rule" never being true
0.3.78
fixed upgrading saves that had lines without rules
0.3.77
change trains waiting forever to wait 2^32-1 ticks instead of going into manual mode
check for full/empty only if needed
better rules display in Traininfo window
minimal Factorio version is 0.12.27
added virtual signal for line number
0.3.76
change default update interval for signal to 12
cache calls to game.item_prototypes
only search exact signal value if necessary
0.3.75
hardReset readds SmartTrain stops
new command to findStations again: /c remote.call("st", "findStations")
add signal for lowest fuel amount (in MJ) in locomotives
0.3.73
fixed crash when picking up cargo wagon/locomotive, using FatController (0.3.22+)
new virtual signal at smart train sops: outputs # of passengers for trains in auto mode
0.3.72
don't update line when waiting at a signal (can lead to "No path" errors)
Smart Trainstops should keep the signal condition when blueprinted/blueprint is placed
pagination for rules window
saving a line under a different name should copy existing rules correctly
minor ui tweaks and fixes
0.3.7
updated for Factorio 0.12.12
alphanumeric sorting for trainlines
0.3.69
updated for Factorio 0.12.11
added interface for de-/activating SmartTrains without removing it
0.3.68
fix SmartTrains not loading with 5dims_trains
0.3.67
change refuel min/max to fuel value (in MJ)
removed optional dependency for dolor coding (still uses the green lamp if available)
added missing locales
0.3.66
skip updating line when autorefuel added the refuel station
update for RailTanker 1.1.0 (increased max Volume)
0.3.65
fix errors with invalid trains due to wagon/locomotive being destroyed
fix error with renaming stations when trainlines without rules are present
fix errors being swallowed in MP games/saves due to error in displaying errors
fix autorefuel when wait forever is set at the last station
0.3.64
go to station # defined by circuit signal (see demo save)
rules stick to the station name, when overwriting/changing a line
0.3.63
fix error when dis-/connecting wagons via V/G
0.3.62
update trainline when train is not moving, regardless of state
added virtual signal for "train at station" (1 when train is at station, 0 when not)
reset signals when train is put into manual mode
0.3.61
fix proxies not being removed when robots remove the stop
0.3.6
added signal output for cargo to smart train stop, with special signals for # of locomotives,cargowagons
locomotive signal is set to -1 when no train at a stop
every train at a smart stop updates signal, even if not on a line
setting for signal updates (every 30 ticks (0.5s) by default)
combine (AND) full/empty rule with circuit rule when both are set
optional dependency for color-coding, if installed uses the green lamp for smart train stops
0.3.5
added Smart train stops
fix toggleFlyingText having no effect
0.3.4
Autorefuel adds "Refuel" as station if actual station not found
added option for trains to wait until full/empty, ignoring time
0.3.3
fixed crash when saving/renaming lines
0.3.2
fixed error with - in trainlines (letters, numbers, space, -,#,!,$ allowed)
added info in ST-Settings about stations: uniquely named stations/total stations
prevent previous/next page button showing when invalid
trainline stations behave like vanilla when multiple stations with same name exist (renaming)
0.3.1
added "leave when full/empty" rules to trainlines
minor fixes
0.3.0
initial release for 0.12.2
Re: [0.12.2+] SmartTrains 0.3
Posted: Mon Aug 03, 2015 12:54 am
by OBAMA MCLAMA
YUS! been waiting for this for a longgg time.
EDIT:
After testing it with 24 trains in the network. It has worked flawlessly. (3 hour test)
When the trains update their schedule on the next station, i love the bright yellow text notifying me of it
Re: [0.12.2+] SmartTrains 0.3
Posted: Mon Aug 03, 2015 9:40 am
by Choumiko
OBAMA MCLAMA wrote:YUS! been waiting for this for a longgg time.
EDIT:
After testing it with 24 trains in the network. It has worked flawlessly. (3 hour test)
When the trains update their schedule on the next station, i love the bright yellow text notifying me of it
Glad to hear that, i'm watching the recording right now I'll probably watch the beginning again (where you are a bit confused about Read from UI and stuff) and update the first post to make it clearer.
Re: [0.12.2+] SmartTrains 0.3
Posted: Wed Aug 05, 2015 5:16 am
by nosferato
Been waiting patiently for this, Many Thanks for updating
Re: [0.12.2+] SmartTrains 0.3.1
Posted: Wed Aug 05, 2015 5:49 pm
by Choumiko
Updated to 0.3.1
Added "leave station when empty/full" as an option to trainlines.
Quote from the updated first post:
Rules: To set the "leave Station when empty/full" rule, click on "Rules" in the trainlines window, set it for the stations, click save. Done. The first check for the rule will happen 4 seconds after arriving at a station, the next ones every 2 seconds. If the normal waiting time is passed the train will still leave. You can change the time in ST-Settings ("Min. waiting time" and "Interval for autodepart")
nosferato wrote:Been waiting patiently for this, Many Thanks for updating
You're welcome. Throw some thanks to Obama Mclama too, He wasn't as patient, i remember the first thing hearing when watching his stream: "I need trainlines", might have been a coincidence
Re: [0.12.2+] SmartTrains 0.3.1
Posted: Wed Aug 05, 2015 10:32 pm
by delassa
Checking or unchecking the "active" checkbox for a train on the Iron w-2-1 line gives the error
the latest update with the leave on full/empty is magnificent. I am able to tell trains to stay at a un/loading for 60-120 seconds, And leave when full. Which has opened up tons of new methods of building my yards.
For example, I run a steam powered world. I need lots of coal. I have 7 trains unloading coal that stop by for 10-15 seconds and only unload... 400-800 coal each trip. I now have them set up to stay for a long time, so they leave when they fully unload all of their cargo. Meaning more trains waiting to enter the station. (in my stacker)
Because of this, i now have less trains on the network driving, which in the end increases throughput on the network!
Re: [0.12.2+] SmartTrains 0.3.2
Posted: Thu Aug 06, 2015 1:03 pm
by Choumiko
Updated to 0.3.2
Changes
fixed error with - in trainlines (letters, numbers, space, -,#,!,$ allowed)
added info in ST-Settings about stations: uniquely named stations/total stations
prevent previous/next page button showing when invalid
trainline stations behave like vanilla when multiple stations with same name exist (renaming)
Your errors should be fixed delassa, all lines in the save can be de-/activated, deleted, renamed etc.
About the trainline stations behaving like vanilla stations: This was mostly a display error, now whenever you rename a station that is in a trainline, that trainlines station gets renamed if there isn't a station with the old name left. That's how vanilla behaves.
Re: [0.12.2+] SmartTrains 0.3.2
Posted: Thu Aug 06, 2015 4:47 pm
by BeltRunner
Choumiko wrote:
Rules: To set the "leave Station when empty/full" rule, click on "Rules" in the trainlines window, set it for the stations, click save. Done. The first check for the rule will happen 4 seconds after arriving at a station, the next ones every 2 seconds. If the normal waiting time is passed the train will still leave.
Is it possible to change that?
It makes more sense for train to wait indefinitely if conditions aren't met.
Re: [0.12.2+] SmartTrains 0.3.2
Posted: Thu Aug 06, 2015 10:14 pm
by OBAMA MCLAMA
SmartTrains v 0.3.2
I'm coming across an error while trying to create and/or update an existing station name.
gui.lua ln.365 bad argument #2 http://puu.sh/js2O9/c9222ded92.jpg
error occurs with normal station names also.
Edit: downgrading to v0.3.1 fixed this issue.
Re: [0.12.2+] SmartTrains 0.3.3
Posted: Fri Aug 07, 2015 10:27 am
by Choumiko
Updated to 0.3.3
fixed crash when saving/renaming lines
OBAMA MCLAMA wrote:I'm coming across an error while trying to create and/or update an existing station name.
gui.lua ln.365 bad argument #2 http://puu.sh/js2O9/c9222ded92.jpg
. instead of : was all
BeltRunner wrote:It makes more sense for train to wait indefinitely if conditions aren't met.
I would say it makes as much sense. Depends on the exact use. I'll see what i can do
Re: [0.12.2+] SmartTrains 0.3.3
Posted: Fri Aug 07, 2015 12:52 pm
by jeroon
Choumiko wrote:
BeltRunner wrote:It makes more sense for train to wait indefinitely if conditions aren't met.
I would say it makes as much sense. Depends on the exact use. I'll see what i can do
If your outpost is depleted the train would wait there forever. Another option would be to create a "parking" station and send it there after a certain amount of time and retire, but still keep it's schedule. That way it's easy to see what outposts are depleted, from the safety of your main base. Might be complicating things a bit too much though
Re: [0.12.2+] SmartTrains 0.3.3
Posted: Fri Aug 07, 2015 4:03 pm
by Vin
jeroon wrote:
Choumiko wrote:
BeltRunner wrote:It makes more sense for train to wait indefinitely if conditions aren't met.
I would say it makes as much sense. Depends on the exact use. I'll see what i can do
If your outpost is depleted the train would wait there forever. Another option would be to create a "parking" station and send it there after a certain amount of time and retire, but still keep it's schedule. That way it's easy to see what outposts are depleted, from the safety of your main base. Might be complicating things a bit too much though
Resource Monitor has warnings for when outposts become depleted. I know it's an additional mod, but I find it to be a much more elegant solution than looking to see if trains are empty.
Re: [0.12.2+] SmartTrains 0.3.3
Posted: Fri Aug 07, 2015 4:10 pm
by OBAMA MCLAMA
I just look at the map and see the outpost being depleted.
A solution is.... if a train leaves a station marked leave on full.... with empty cargo.
Re: [0.12.2+] SmartTrains 0.3.4
Posted: Fri Aug 07, 2015 5:14 pm
by Choumiko
Updated to 0.3.4
Changes:
Autorefuel adds "Refuel" as station if actual station not found
added option for trains to wait until full/empty, ignoring time
Note: Wait forever doesn't work with stations where waiting time is set to 0
jeroon wrote:If your outpost is depleted the train would wait there forever.
For outposts i would probably use wait until full with a time that is slightly longer than the time needed to fill the wagons when the chests are full. At unloading stations i can now (0.3.4 ) suggest wait until empty with wait forever set.
jeroon wrote:Another option would be to create a "parking" station and send it there after a certain amount of time and retire, but still keep it's schedule. That way it's easy to see what outposts are depleted, from the safety of your main base. Might be complicating things a bit too much though
Not going to do that
Next up: Hooking the circuit network to train-stops, most likely in the form of "if signal euqals something, goto station X, else continue schedule". This should make a lot of things possible (clever use of signals/combinators and chaining of "smart-stops" assumed)
Re: [0.12.2+] SmartTrains 0.3.4
Posted: Sat Aug 08, 2015 10:07 am
by Vin
Using version 0.3.4 - toggleFlyingText seems to have no effect on the actual text displayed on the trains at stations. I'm assuming this is what it's supposed to affect? The UI gives me a true/false toggle when I enter the console command, but nothing seems to change.
Re: [0.12.2+] SmartTrains 0.3.4
Posted: Sat Aug 08, 2015 11:30 am
by Choumiko
Um yeah.. actually it didn't work since the first release for 0.12, i forced it to be always on and forgot about it