SmartTrains 0.2.0 [0.11.5+]
Posted: Sun Dec 21, 2014 12:39 pm
Current features:
Credits to:
rk84 (Test mode) code/styles for the dynamic rules are from him. Test mode gui used as a source for learning factorio gui
Kexik (AlphaMod) code for liquid items taken from his source
JamesOFarrell (RailTanker, Fat Controller) also a source for gui learning, some code for tracking trains and stuff
Upgrading should be painless, but i'd advise you to backup the save anyways, you never know
For versions > 0.1.0: If it doesn't work: look into the folder "(Factorio)/script-output/st/" there should be some files named debugGlob*.lua Would be really helpfull if you could post them here.
If you're not worried about loosing your SmartTrains settings look at the console commands
Current issues :
The items you want to set conditions for should be in your hotbar. To set an item put it on your cursor and click in the grey box, to unset it, click with it with no item on the cursor
From left to right:
- Trainlines:
Saving of train schedules as a line, assign trains to lines. Trains update their schedule at a station when it's line changed
Dynamic lines:You can set conditions for stations on a trainline. If the cargo in the train does not match the condition it will skip the station - Autorefuel/Autodepart:
Trains add a refueling station to the schedule when fuel is below a certain value, then leave and remove it when fuel is above a value
Trains leave stations when there is no change in their loaded cargo for a certain time (2s interval as default, cargo difference is checked per item)
maximum time still is the time set in the schedule
minimum waiting time (4s as default, change it in the global settings window) - UI to toggle Autorefuel and Autodepart per train (opens when you open the standard train UI)
- UI for Autorefuel/-depart settings (Button "ST" at the top left corner when train or train-stop gui is open)
- Works with Rail Tanker (Rail Tanker 0.0.8+)
Credits to:
rk84 (Test mode) code/styles for the dynamic rules are from him. Test mode gui used as a source for learning factorio gui
Kexik (AlphaMod) code for liquid items taken from his source
JamesOFarrell (RailTanker, Fat Controller) also a source for gui learning, some code for tracking trains and stuff
Upgrading should be painless, but i'd advise you to backup the save anyways, you never know
For versions > 0.1.0: If it doesn't work: look into the folder "(Factorio)/script-output/st/" there should be some files named debugGlob*.lua Would be really helpfull if you could post them here.
If you're not worried about loosing your SmartTrains settings look at the console commands
Current issues :
- Making changes to the train schedule with the vanilla UI should be done when the train is in manualmode and has no active line, else he could decide that he doesn't like the changes and revert them
I see no way around that for now. Changing the active line, refuel, depart settings while automated works. - "Jumpy" gui: Sometimes the schedule overview changes places, mostly when changing active line, reading from ui.
- There might be some side effects between autorefuel, autodepart and dynamic rules. If something seems strange, please report it, could be working as intended or a bug
- 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
The items you want to set conditions for should be in your hotbar. To set an item put it on your cursor and click in the grey box, to unset it, click with it with no item on the cursor
From left to right:
- Train goes to Ore unload only if it has more than 2k iron ore loaded, else it goes to Mine 1,2,3
- Same as before, but only goes to Mine3 when cargo <= 1500 (e.g. because it's way off)
- This line will have its trains waiting at Ore unload until iron-ore is < 1, ignoring the time that is set in the schedule Edit: I just noticed that this example only makes sense if using only 1 Mining station
- Yes, rules for liquids too (only usefull when using Rail Tanker) Get the items into your inventory by clicking "Liquid items"
Console commands
Changelog