Train Network for Players

by leeh

QoL and advanced functionality for players using trains for transport, including improved destination selection dialog and automated train calling.

Content
1 year, 7 months ago
0.17 - 1.1
6.01K
Transportation

g How to keep train at destination?

4 years ago

When I take a train to a station using TNP and get off, the train immediately leaves the station and heads off to the next stop in its schedule. That's often a bit irritating, since the train is frequently carrying stuff I want to use, or I want to put trash into it, or both. I'd love to have a mode where the train stays put until I summon it from somewhere else or get on and explicitly tell it to go somewhere. I've been playing around with the mod and its options, and I haven't been able to find a way to do this -- am I overlooking something, or is this not supported?

I have found that if the train has a completely empty schedule, then the first time I use TNP to go somewhere, the train sits and waits -- but it also adds that stop to its schedule, so I'm back in the situation described above. Further trips result in the train heading back to this new stop.

4 years ago

I'll give you a short answer first which is basically "unfortunately not, but actually sort of yes", then my general thoughts on it below.

There's two situations in which tnfp won't resume its schedule, firstly if its a redispatch to a destination already in the trains schedule (at which point it continues to that station), or if at any point the trains switched to manual mode. Theres an input control under settings (which isn't defined by default) which will switch the current train, or one thats just arrived after dispatch to manual mode.

So whilst there's no option to have it wait, if you bind the manual mode hotkey and use it to switch the train to manual mode before getting out -- the train will then remain there until its next summoned.

The blank station thing is a bug that came through during 0.17. In short tnfp checks its successfully saved the trains previous schedule before it restores it -- but partway through 0.17 an empty schedule changed from an empty array (which passes existence checks) to being "nil" (which does not), and empty schedules then failed the validation check. I can take a look into fixing that by adding some explicit marker for the schedule being saved as blank.

-

Personally its something that bugged me too -- the manual mode switch was a way to solve the problem after a fashion, as I've been thinking through the "right" way to add this kind of functionality.

In my current playthrough its generally about 50/50 whether I want the train to wait or not -- so a mod setting didn't feel granular enough because either default is still likely to be the "wrong" decision sometimes. It'd be possible to add it -- but I'd prefer is to make it more of a dynamic choice if possible.

For a railtool/temporary dispatch, selection tools have a concept of "alt mode" -- at first glance they didn't seem to be exposed to the event api that fires on selection though. For a station select dispatch its do-able, its mainly just a question of what the UI looks like and I'm still mulling that one over.

Any thoughts or suggestions though, feel free!

Cheers, Lee H

4 years ago

I've released v0.8.0, which should fix the issue with restoring a blank schedule, and adds support for using the railtool in alt mode by holding shift -- this changes the arrival behaviour so the train switches to manual mode and waits there instead.

The stationselect dialog needs some more thought as its partially fixed in size, but I'll keep in mind updating that to support something similar in a future update -- in the meantime the workaround as noted is to bind the manual mode hotkey.

4 years ago

Cool, thanks! I meant to reply earlier and say that flipping the train to manual is a good workaround -- and it's only taken me getting hit by a train 3 or 4 times before I've trained my fingers to toggle before hitting enter. :-)

Just installed v0.8; looking forward to trying it out. Thanks again!

4 years ago

Jumping on this also!

I agree that once the train arrives at a station it should switch to manual mode to keep it there, as I may want to re-board that train again shortly or use the contents of said train.

I can see a case for a train staying in auto mode and returning to its schedule if its a "regular" train assigned to some other duty. But in the case for any personal train it should swap to manual mode. While the "Alt Rail Tool" and "Manual mode" keybind are helpful its not a great solution for the player who wants the train to stay in manual mode.

Please let the player choose!?

You can always use the Manual mode keybind to switch the train back Auto as you leave the train. Failing that you can always call the train back to you anyway.

Ideally this "manual mode" option/setting would only apply to personal trains and not regular trains that have been highjacked for transport.

Thanks

4 years ago

I've just released 0.9.2, which includes an updated station selection gui with a switch controlling whether the train will use its default behaviour, or whether it will switch to manual mode on arrival. Screenshot is here: https://leehuk.github.io/factorio-tnfp/docs/images/tnfp-screenshot-stationselect-full.jpg

The switch option is sticky, so once set it will retain its position. Any questions, let me know.

4 years ago

This is a fantastic addition. Thank you so very much for adding it in!!

4 years ago

I have a tendency to jump out of a moving train right before the stop. if I do this, the above (set to manual) doesn't occur and it continues on with a automatic schedule.

Do I just need to retrain myself from jumping from trains like a funky factorio hobo or is this fixable?

btw, I looked at 4 or 5 mods trying to find something I liked and this one was by far the best for passenger trains. I really love it and gonna install this every time I play now. Thanks for doing it!

4 years ago

Thanks, always nice to hear :)

I've had a quick check and the manual mode options working as you expect here -- the train continues to its destination and gets switched to manual mode regardless of when I exit the train, so some more detail would be useful please to try and work out whats going on. Factorio version, mod version, and as many details you can think of around the scenario and actions/steps you're taking.

For reference, my test scenario was factorio 0.18.1, tnfp 0.10.5 on a very simple map with no background train traffic -- board a parked tnfp train without a request active, bring up station select via the keyboard shortcut, pick a station not in its list with the arrival behaviour set to manual. Train departs and if I exit the train at any point from there I get the flying text "Request: Train continuing to <station>" and the train continues as if the player were still on board, then once it arrives theres a console message "Request: Train arrived at <station> and switched to manual mode".

New response