Transport Fever 2

Transport Fever 2

80 ratings
Smart station naming
2
   
Award
Favorite
Favorited
Unfavorite
Misc: Script Mod
File Size
Posted
Updated
253.091 KB
16 Apr, 2023 @ 8:36am
23 Apr, 2023 @ 10:45am
5 Change Notes ( view )

Subscribe to download
Smart station naming

Description
This mod tries to improve the naming of newly created stations and street stops.

1. If a station/stop is placed close to an existing station, it will get the same name as the existing station.
2. Otherwise, if it is placed close to an industry, it will get the name of the industry.
3. For street stops, city names can automatically be removed.

The functionality is configurable. Search areas can be adjusted to your preference, or you could for instance disable the search for existing stations and only use the auto-naming for industries.

The industry catchment area sizes seem to cover a distance of approximately 400. When searching for existing stations, only actual buildings are considered, not street stops.


This is a script mod only, it does not modify any in-game content. It is therefore safe to add and remove at any time.

It should be compatible with all station mods. The only case where it would fail to recognize a modded station (and simply ignore it) is if the other mod does not adhere to the standard naming conventions for buildings.

Source code: https://github.com/Konrad2023/SmartStationNaming

Translations included:
- (from author): english, german, french
- (from contributors): traditional chinese

Pull requests adding new translations or features are welcome.
Popular Discussions View All (1)
7
5 May, 2023 @ 11:20am
(likely not) possible issue with Freestyle Train Station
GordonDry
7 Comments
SteelRodent 10 Nov, 2023 @ 11:52am 
As much as I like what this mod tries to do, the way it deals with bus & truck stops makes it literally pointless for me. Any bus stop remotely near a train station gets named the same as the train station - even with the scanning range turned all the way down, and then I have to rename them anyway or it's impossible to tell them apart.

The other problem, and I consider this a bug, if a truck stop is placed close to a bus stop, the truck stop takes over the ID and name of that bus stop, and that breaks all the bus routes with the "passenger vehicles cannot use cargo stations" because the bus routes suddenly try to use the truck stop instead of their own stop, so I have to edit all the bus routes that use that stop so they work again. It's the same if you put a bus stop near a truck stop - it breaks the truck routes.
Vimes 8 May, 2023 @ 12:48am 
Thanks for creating and sharing this. Most useful.
blackwizard1812 23 Apr, 2023 @ 3:00pm 
thx, it is working as expected
Konrad  [author] 22 Apr, 2023 @ 7:50pm 
OK, just published version 1.1. I have slightly rebalanced the search distances (they are generally a bit smaller now), and added a few more checks in the code.

If you have savegames from a previous version, you may want to revisit the mod settings.
Konrad  [author] 22 Apr, 2023 @ 6:55pm 
@blackwizard1812 thanks a lot for the feedback (and @sapidio too ;-) )

1. Thats weird, because I'm checking the entity right before posting the event. But yes, I'll add a few more checks.

2. That's probably an effect of finding stations. The reason for introducing this was to be able to place stops or stations close to railway stations, and name them correctly (e.g. "Paris Main Station" -> "Main Station"). Did you "start" around a train station which was named after the town?

Anyway, this should only happen for stations, as road stops are excluded from "propagating" their name.

Can you try reducing (or disabling) the station search radius and see if that helps? The default might be too large, so maybe reduce to "S". If that's still too much, I could add an "XS" option.
If all else fails, you can try to add a
debugPrint(reference)
before line 115 and check the console to see which construction it's snapping to.
blackwizard1812 22 Apr, 2023 @ 11:37am 
thx, working great
2 things:
- using track splitter mod triggered a crash unexpectedly related to this mod, in that case `local station = game.interface.getEntity(param.entityId)` was actually nil, then would need just a bit of defensive programming by adding a nil check on `station`.
- is it possible to differentiate (road) stations from bus/truck stop that are snapped to road: because all the new stops I lay down in a city since I enabled the mod have the same name (name of the city)
baerlina 20 Apr, 2023 @ 5:42am 
Vor ein paar Wochen dachte ich noch "wäre toll wenn die Bahnhöfe und Lkw/Bus Stationen die Jeweiligen Namen automatisch übernehmen könnten". Und zack da kommt deine Mod daher.
Klasse funktioniert einwandfrei.
Danke Dir. :steamthumbsup:

A few weeks ago I still thought "it would be great if the train stations and truck/bus stations could take over the respective names automatically". And zack there comes your mod.
class works fine.
Thank you. :steamhumbsup: