SmartTrains 0.2.0 [0.11.5+]

Topics and discussion about specific mods
gnz
Inserter
Inserter
Posts: 46
Joined: Wed Jan 14, 2015 5:19 pm
Contact:

Re: SmartTrains 0.1.9 [0.11.5+]

Post by gnz »

Choumiko wrote:
SmartTrains_0.2.0.zip
Changes:
- rename lines
- pagination for train lines, rules, train schedules (for now hardcoded to 5 per page)
- option to make trains wait forever when there are only invalid rules on their line (global setting for all trains, autodepart still has to be on for it to work)
- catching more errors with invalid trains
- global settings /rules close other windows, reopen on save
- train lines can be edited/renamed/deleted when train stop ui is open

This version will not upgrade from versions < 0.1.9, so make a save with 0.1.9 first if you're still using an older one (or disable the mod, save the game, update the mod and enable it)

I need to rewrite big parts before adding anything new, as the code is getting really messy (this mod is the result of me learning modding/lua, so.. yeah ;) )
The "wait forever" feature should really be another rule for lines, but in the way of "leave station when item x above/below/equal y amount".
Thank you, this seems to have fixed a lot of the issues I had. The floating text now shoes "invalid train removing" when adding carts so it doesn't crash factorio anymore. Thanks for the renaming rules!

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: SmartTrains 0.1.9 [0.11.5+]

Post by n9103 »

For a first mod, this is pretty damn impressive, so don't downplay yourself too much ;)
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.

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

Re: SmartTrains 0.1.9 [0.11.5+]

Post by Choumiko »

n9103 wrote:For a first mod, this is pretty damn impressive, so don't downplay yourself too much ;)
Wasn't fishing for compliments, but thanks anyways :D
Just tried to say that it gets increasingely harder to add something new (even little things), as the code is not as decoupled as it should be. But as i'm not a professional sofware developer i guess that's to expected ;) My other mod (FARL) is easier to extend, not perfect but better than this one.

Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by Neotix »

Refueling is working only with coal? If someone are using solid fuel or any kind of fuel to powered trains, it will works as well?

User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by SHiRKiT »

Coal only for now. And keep some autosaves, it crashes your game quite often.

gnz
Inserter
Inserter
Posts: 46
Joined: Wed Jan 14, 2015 5:19 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by gnz »

Neotix wrote:Refueling is working only with coal? If someone are using solid fuel or any kind of fuel to powered trains, it will works as well?
Yes it should, but it will use the global settings minimum as the equivalent in fuel value. So if you set it to refuel when it has less than 10 coal then that means 80MJ, so that is the same as having less than:
  • 133 Wood
    20 Raw wood
    20 Small electric pole
    13 Wooden chests
    10 Coal
    3.2 Solid fuel

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

Re: SmartTrains 0.2.0 [0.11.5+]

Post by Choumiko »

Neotix wrote:Refueling is working only with coal? If someone are using solid fuel or any kind of fuel to powered trains, it will works as well?
As gnz explained very well, it works for whatever fuel item you use. I just decided to use coal for comparison as that's what i assumed most people use and is easier to imagine than 200MJ (at least for me)
SHiRKiT wrote:And keep some autosaves, it crashes your game quite often.
Flat out crash or a notice window? Some more details would be nice, so i can try fixing it.

thatsIch
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Feb 19, 2015 1:17 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by thatsIch »

It crashed for me, when I tried to assign a train to two different lines, not sure if there exists a radio button in Factorio, but this would be handy I guess.

rich_dick_33
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Feb 25, 2015 9:51 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by rich_dick_33 »

Hi this mod looks great but i dont seem to be able to get it working everytime it load up then look in on a train i get this message

Error while running the event handler: __SmartTrains__/control.lua:298: attempt to index field '?' (a nil value)

I have about 40 trains on my network and really would like for this to work as im reaching the limit of my rails without this mod lol

Hope i can get some help

Rich

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

Re: SmartTrains 0.2.0 [0.11.5+]

Post by Choumiko »

rich_dick_33 wrote:Hi this mod looks great but i dont seem to be able to get it working everytime it load up then look in on a train i get this message

Error while running the event handler: __SmartTrains__/control.lua:298: attempt to index field '?' (a nil value)

I have about 40 trains on my network and really would like for this to work as im reaching the limit of my rails without this mod lol

Hope i can get some help

Rich
Try using /c remote.call("st", "hardReset", true) in the console, this should fix one possible cause for the error. The other cause most likely is impossible: The train you try to open would have to be in automatic mode, waiting at a train stop without having a schedule set, i don't know how one could achieve that.
thatsIch wrote:It crashed for me, when I tried to assign a train to two different lines, not sure if there exists a radio button in Factorio, but this would be handy I guess.
That's interesting, for me whenever i click on an unchecked checkbox the old line gets deselected, even if it's on another page. I made the checkboxes for the active line act like radiobuttons, sadly there is no built-in ui element.

rich_dick_33
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Feb 25, 2015 9:51 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by rich_dick_33 »

Thats a shame my whole save file is now gone tits up, im gonna have to start agian, if it happens again i'll report back and help improve.

I love starting again! im so excited im aimming for 50 plus trains!

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by n9103 »

If you hit it, then you must post the save in the "Show your creations" forum, as that would be comparable to the highest amounts yet reported functioning. At least, of those operating on the same rail line.
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.

rich_dick_33
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Feb 25, 2015 9:51 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by rich_dick_33 »

Quick question about the UI and what dose what?

min. wait time?

Interval for autodepart?

Min. flow rate?

What dose the above effect about the trains ruote?

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

Re: SmartTrains 0.2.0 [0.11.5+]

Post by Choumiko »

rich_dick_33 wrote:Quick question about the UI and what dose what?

min. wait time?

Interval for autodepart?

Min. flow rate?

What dose the above effect about the trains ruote?
Whenever a train arrives at a station, it waits for min. wait time at the station even if no items get (un-)loaded.
Interval is the time between checks whether items got (un-loaded). If no item in the wagons changed the train leaves the station.
min flow rate is used with the Railtanker mod, if the liquid in a wagon changed below min flow * interval it is considered no change and the train leaves the station. (mostly because once a tankwagon is nearly full it fills very very slowly, like 0.000001 liquid/s)
Hope that helps

rich_dick_33
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Feb 25, 2015 9:51 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by rich_dick_33 »

Thanks, first few trains up and running and no problems so far.

User avatar
StoneLegion
Filter Inserter
Filter Inserter
Posts: 686
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by StoneLegion »

Sounds like an incredible mod your working on. I was wondering I'm starting to have this issue with my basic train system not using your mod of course.

What you are looking at is my issue. I have 3 stations but the train always decides to pick the closest station and that is fine but a lot of times I have 4-5 trains on the go but it picks the first 2 and very rarely it will pick the third station. Using all 3 of the names.
Image

Just trying get ideas :)

BlaatMekker
Inserter
Inserter
Posts: 29
Joined: Sun Dec 28, 2014 10:01 am
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by BlaatMekker »

Not trying to bust your chops... but are you planning on updating for 0.12?

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

Re: SmartTrains 0.2.0 [0.11.5+]

Post by Choumiko »

Yes, though it's gonna be more like a rewrite. Currently my focus is on FARL for 0.12, then i'll upgrade/rewrite SmartTrains, it's probably going to be quite a while though

BlaatMekker
Inserter
Inserter
Posts: 29
Joined: Sun Dec 28, 2014 10:01 am
Contact:

Re: SmartTrains 0.2.0 [0.11.5+]

Post by BlaatMekker »

Did they make so many incompatible changes?

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

Re: SmartTrains 0.2.0 [0.11.5+]

Post by Choumiko »

Not that many i guess. Mostly it should be just changing names/adding underscores. The reason it could take a while is more time related, and me understanding the code again. A rewrite could be better/quicker, not sure yet.

Post Reply

Return to “Mods”