[MOD 0.15] SmartTrains 2.0.5

Topics and discussion about specific mods
Neemys
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sat Apr 09, 2016 6:16 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Neemys »

Little text problem when displaying the rule fluid count.
fluid train.jpg
fluid train.jpg (57.75 KiB) Viewed 12241 times
I enjoyed your mod so far, the only thing that is bothering me is the automatic refuelling not working when you set yourself where a train should go as it will never go to the end of the schedule. Maybe an option to change the automatic refuelling to force a train to go there then continue where it headed before ?
Want more space restriction ? Or maybe you want to be forced to use train for other thing than ore and oil ? Try Building Platform Mod !
User avatar
Zombiee
Fast Inserter
Fast Inserter
Posts: 151
Joined: Mon Nov 07, 2016 8:50 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Zombiee »

Any plans to update this for 0.16? I expect it's probably going to be a headache with the changes so I'm very much NOT asking for an eta, just a note that you do plan on updating it or not. Merry Xmas.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

Somewhat updated to 0.16,
Didn't get much testing in, besides a simple 2 station trainline, and clicking all buttons :D
Hoefnix
Inserter
Inserter
Posts: 31
Joined: Thu Apr 28, 2016 12:59 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Hoefnix »

I did a quick stress test on my train controller map, my main line is 308 stations and has 180 trains and I'm glad to announce: It all works by the looks of it! I'll have to play the map a bunch more to see if anything obscure fails, but it looks good so far. Tnx for the update!
Hoefnix
Inserter
Inserter
Posts: 31
Joined: Thu Apr 28, 2016 12:59 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Hoefnix »

I may have found something Choumiko. I noticed some of my trains were going to the wrong stations. After a lot of testing I found out that when two trains are sent at the same time (or close to it) the second one will ignore ST rules and just go to the next station instead of the station mapped according to the circuit signal. I tested it and I found that the error occurs when the second train is sent within about 110 ticks.

In the link i included a minimal working save. Destination signal is sent when flipping the constant combinator with the "D" value from off to on. The constant combinator with the green signal is for setting the delay in ticks. If both trains go to station "right", everything worked. If one goes to "Right" and the other to "Wrong" then something went wrong. Both trains are on the same line and both smart stops are set up identically.

https://www.dropbox.com/s/e28tpntuieoby ... g.zip?dl=0
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

Awesome testsave, and not that hard of a fix actually :D

Should work in the latest update

In case you're interested: SmartTrains checks rules when a train leaves a station, meaning when the api tells that the state changed from wait_station to on_the_path, in your setup with the signal directly after the station the state went from wait_station to arrive_signal immediately.
Since SmartTrains didn't recognize it as leaving the station it never checked the rules. So that's why it was sensitive to the delay. If the first train already left the block after the station it would work, if not then not.
JarJarBinks
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jan 16, 2018 5:53 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by JarJarBinks »

Hey Choumiko,

i recently started experimenting with your mod, and i have a small question

i have it set up so a station can send a signal for 1 tick, if there is no train present and it has enough resources to fill one train.
At my Yard station i have it set up so the signal gets converted and the number of the station that it comes from gets sent to the signal light. Then the train should start moving to that station, since it reacts to the signal light which gets enabled when it gets hit with the signal.
However: my train does start driving when i trigger him with the signal, but he just ignores the station number specified in the signal.
So he always just moves to the first station in his schedule instead of the one he is supposed to go.

Any help is appreciated

Greetings from Germany
Xerkus
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat Oct 22, 2016 7:34 am
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Xerkus »

Refueling seems to be broken in 0.16.20. Refuel checkbox in train settings is not remembered and resets to unchecked on closing train ui.
Refueling setting for trainline does work.
shock
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Nov 19, 2014 4:28 am
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by shock »

Can confirm refueling checkbox no longer stays marked in .16
Sworn
Filter Inserter
Filter Inserter
Posts: 327
Joined: Sun Apr 03, 2016 8:10 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Sworn »

Mine doesn't work to, I was trying to find what was wrong but looks like it is not working.

Does the owner still working on it?

So the alternative version (https://mods.factorio.com/mod/SmartTrains-016) is working, so I compare it with WinMerge, and found that comment this line

control.lua

Code: Select all

script.on_event(defines.events.on_gui_checked_state_changed, on_gui_click.on_gui_click)
will make the "CheckBox" in the Refuel work, and the train work as well.
I have no idea if this will cause problems.

You can download the lastest version of the SmartTrain and commnet that line, or you could use the "alternative" version while the owner can't fix it, for whatever reason.

Don't blame me if your game crash, make a backup of your game first.
cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by cid0rz »

hello all, I'm playing 0.16 but I'm doing a new factory so still didn't try smart-trains functionality with my circuit network system, but I will. I found this apparently non fatal bug, when i right-click my equipped power armor I see these error messages. They stop when I close it and nothing seems broken:
20180503191408_1.jpg
20180503191408_1.jpg (1.07 MiB) Viewed 11529 times
I'd swear the first time I put it on and load it they didn't appear. So maybe one of the recen hotfixes broke this?

Yours sincerely from a lonely Alien planet
* i have some other mods installed but i'd say is unrelated at first
Timmiej93
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Jan 30, 2017 9:15 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Timmiej93 »

First of all, sorry if this is not the most up to date topic for this mod, I couldn't find anything more recent.

I've updated the Automatic Coupler mod a while back, to work in 0.16, and I'd love for it to work with Smarter trains (de-coupling, sending the locomotives to refuel, send them back, re-couple, and continue on). Unfortunately, when de-coupling (or coupling I think), the line assignment is lost. Is there any way this can be prevented? I'm very new to Factorio modding, otherwise I would have attempted to do this myself.

Thinking about it, automatic coupling and decoupling woud be a great addition to the Smarter Trains mod. That would give you pretty much all the flexibility you could ever want, train-wise. Merely a suggestion of course.
User avatar
jockeril
Filter Inserter
Filter Inserter
Posts: 382
Joined: Sun Feb 08, 2015 11:04 am
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by jockeril »

So I ordered my PAX train to take me to a temp location and closed the train GUI. When I re-opened it (by pressing on the train) it started showing this error about every second:

smart trains tmp station error.JPG
smart trains tmp station error.JPG (139.09 KiB) Viewed 9466 times

List of mods:

0.258 Loading mod core 0.0.0 (data.lua)
0.344 Loading mod base 0.17.59 (data.lua)
0.588 Loading mod SmartTrains 4.0.4 (data.lua)
0.670 Loading mod what-is-it-really-used-for 1.4.3 (data.lua)
0.750 Loading mod BlueprintExtensions 0.4.5 (data.lua)
0.828 Loading mod Bottleneck 0.10.4 (data.lua)
0.906 Loading mod even-distribution 0.3.10 (data.lua)
0.983 Loading mod EvoGUI 0.4.401 (data.lua)
1.064 Loading mod helmod 0.8.12 (data.lua)
1.148 Loading mod LSlib 2019.7.22 (data.lua)
1.234 Loading mod MoreLogisticsSlots 1.4.1 (data.lua)
1.313 Loading mod nicefill 0.1.16 (data.lua)
1.392 Loading mod QoL-TempStations 0.3.3 (data.lua)
1.472 Loading mod TrainDriver_A16_fix 0.17.0 (data.lua)
1.552 Loading mod VehicleSnap 1.17.3 (data.lua)
1.632 Loading mod trainConstructionSite 0.1.9 (data.lua)

The Factorio log says:
"Script @__SmartTrains__/Train.lua:351: state is wait_station but no trainstation found
Script @__SmartTrains__/Train.lua:352: Temporary station?!"
My mods

Formerly Hebrew translator for FARL & EvoGUI - two mods I highly recommend for anyone to check-out

join me on
- Twitter[@jockeril],
- Twitch.tv/jockeril,
- Youtube/jocker-il (or JoCKeR-iL)
- and steam !
Image
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

Thanks for the report, should be fixed in the latest version.

Temporary stations are still not supported, so best is to not save them in a line, there might be more errors lurking. Vanilla use of them should be fine now i think.
Hoefnix
Inserter
Inserter
Posts: 31
Joined: Thu Apr 28, 2016 12:59 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Hoefnix »

Hey Choumiko,

Last week I decided to load up ye olde stupidly big train map with the line with over 300 stations again and found some stations acting weird.

Image

In the picture you can see two instances of the Copper 28 station in the schedule(I renamed 27 to 28 to get the schedule like it so I could use the same trainstop). If the train is waiting at the first instance and I flip the combinator on to tell it to go to a certain station it does so as intended. If it is waiting at the second instance then it will try to path to Copper 29 instead, ignoring the destination signal...

It's the same train at the same trainstop with the same destination signal and they are set up identically in the line rules, yet they behave differently. Any thoughts on what might cause this?

Kind regards, Hoefnix
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

Hoefnix wrote: Sun Sep 15, 2019 10:26 pm Any thoughts on what might cause this?
My first thought: What does "use station mapping" mean again? :D (i think i remember now, it doesn't use the number from the schedule but the number you provide in the gui that opens with a train stop right?)

In theory the only way for it to go to Copper 29 with the settings shown is if either the signal it reads is the mapping for Copper 29 or it's a value that isn't assigned to any station (then SmartTrains goes to the next station in the list). I assume you use the same circuit setup for both/all stations and have checked that they output a valid mapping?

There are a few things that could have gone wrong;
  • something in my code is wrong somewhere (very specific, right? :) )
  • station mapping got messed up when renaming the station
  • order of (train) events changed since the last Factorio version it worked (unlikely, since then it wouldn't work for all stations)
  • the circuit for the second Copper 28 station gives a wrong value (unlikely, i guess you double checked that)
Can you upload the save somewhere and share the link? (pm here or via discord is fine if you don't want it public)
Ideally a save at the station shortly before the train goes to the wrong station.
User avatar
planetmaker
Fast Inserter
Fast Inserter
Posts: 188
Joined: Mon Jan 21, 2019 9:30 am
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by planetmaker »

Excuse my ignorance: what is the advantage of this mod over what I can do in vanilla? I read the description and this thread, but I'm somewhat puzzled:

What I see, reading this thread and the feature list I see mostly one point:
* order lists to which I can assign trains (as such: one set of orders for multiple trains - and all assigned trains change orders when I change this one list).

Anything beyond this? What's so special about indicating a station as "refuel station"?
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Choumiko »

planetmaker wrote: Mon Sep 16, 2019 9:03 am Anything beyond this? What's so special about indicating a station as "refuel station"?
Most of the stuff you can't do in vanilla is listed on the mods portal page https://mods.factorio.com/mod/SmartTrains under "Line rules" (most notably: go to a specific station depending on a circuit signal). I have actually not played in a very long time, and forgot a lot of stuff that is possible. But in theory (and in Hoefnixs case in practice, i think) you can create some sort of logistics network with trains (given you are willing to get really crazy with combinators)

The Refuel station gets added to a trains schedule when it needs refueling. This allows your other stations not have to provide fuel.
What most people that use the feature do (just guessing here) is: create refuel stations after the unload stations in the main base and only supply these with fuel.
So most of the time the train goes only from Outpost to the base. Once the train is low on fuel the refuel station gets added to the end of the schedule and after refueling gets removed again.
The main point really is that you can have a few specialized stations in one area instead of having to run belts/connect logistics networks to every station in your base.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Optera »

Choumiko wrote: Mon Sep 16, 2019 3:04 pm But in theory (and in Hoefnixs case in practice, i think) you can create some sort of logistics network with trains (given you are willing to get really crazy with combinators)
I believe Siggboy was the first to make a working logistic train network with combinators and SmartTrains. viewtopic.php?t=25311

PS: Siggboys creation was the inspiration for LTN.
Hoefnix
Inserter
Inserter
Posts: 31
Joined: Thu Apr 28, 2016 12:59 pm
Contact:

Re: [MOD 0.15] SmartTrains 2.0.5

Post by Hoefnix »

Choumiko wrote: Mon Sep 16, 2019 5:41 am My first thought: What does "use station mapping" mean again? :D (i think i remember now, it doesn't use the number from the schedule but the number you provide in the gui that opens with a train stop right?)
Correct!
Choumiko wrote: Mon Sep 16, 2019 5:41 am In theory the only way for it to go to Copper 29 with the settings shown is if either the signal it reads is the mapping for Copper 29 or it's a value that isn't assigned to any station (then SmartTrains goes to the next station in the list). I assume you use the same circuit setup for both/all stations and have checked that they output a valid mapping?
I've even gone as far as just use the same trainstop for it and all I did was flip the constant combinator on and off to trigger the train.
Choumiko wrote: Mon Sep 16, 2019 5:41 am Can you upload the save somewhere and share the link? (pm here or via discord is fine if you don't want it public)
Ideally a save at the station shortly before the train goes to the wrong station.
I'll get you a save when I'm home again this evening, was away for work a bit.
planetmaker wrote: Mon Sep 16, 2019 9:03 am Excuse my ignorance: what is the advantage of this mod over what I can do in vanilla? I read the description and this thread, but I'm somewhat puzzled:
The refuelling is a neat feature where the train adds a refueling station to the end of its schedule automatically if it's fuel levels drop below a level you can set, it's even smart enough that you can have different refueling stations for different trains formats and it will automatically go to the correct one.

Another feature is that at the train stop it reads more information about the train than vanilla does. Number of locomotives, number of wagons, remaining fuel in MJ, number of players present, position of train stop in the schedule OR assigned number to the train stop and as the train leaves it will give a 1 tick signal to indicate which station it is going to.

The feature I use the most is where you can tell a train which train stop in its schedule to go to, a thing you can't reasonable do in vanilla. I use this to dynamically assign trains to pickup resources and drop the of at the builds that need them. A basic example would be a train that first stops at a sorting station before moving to the correct unloading station of a build.

As Optera mentioned other people have done this as well, I wasn't aware and developed mine in parallel. Currently I'm on version 3 of my train controller and each version used a order of magnitude less of combinators. Having combinators be a significant power drain on your network really isn't healthy :P

Of course SmartTrains used to be a musthave back in the good ol' days before 0.15 when the only wait condition trains had was time passed and if you wanted any other condition you praised Choumiko for this awesome mod and the ability to save lines since copy pasting settings wasn't a thing either.
Post Reply

Return to “Mods”