More information for train state

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

More information for train state

Post by d3x0r »

re viewtopic.php?f=28&t=27024 and viewtopic.php?f=28&t=51175

It woudl be nice to be able to get. in script, whether a train is accelerating, cruising, stopping, or stopped. I don't know if the engine internally uses cruising, or just always is accelerating along a long path, and if it uses a passive deceleration curve before hard braking....
Really the only state I'd really require is if it is accelerating. THis would greatly simplify the guessing I do in https://mods.factorio.com/mods/d3x0r/tr ... ed-limiter and the accuracy ( found while further tweaking train paramteers that there were certain deceleration rates/transitions between tracks that could make the train far exceed its regular acceleration, and even when decelerating the guess would be that it was still accelerating and the train could not stop.
On the deceleration side, I really don't want to apply the track speed penalty, or the train can end up crawling to a stop long before is intended stop.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: More information for train state

Post by quyxkh »

Unless I'm misinterpreting the request you can already get enroute, stopping and stopped directly from train_changed_state monitors, the only thing kindahard to distinguish is whether an enroute train still accelerating or cruising, but you can check its current speed against its top speed (you'd need maybe a hand-coded table of top speed by fuel, and check its fuel loadout when it changes from a waiting state?).
Rseding91
Factorio Staff
Factorio Staff
Posts: 14247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: More information for train state

Post by Rseding91 »

I've added support to read the train riding state for 0.16 which lets you check if the train is accelerating, braking, or just coasting.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Implemented mod requests”