Transport Fever

Transport Fever

View Stats:
Tracks & Stations
Dear fellow modders,

I have made myself a set of tracks and now I want to add them to the stations so I can choose those tracks with the stations. The game currently only has two track types you can select from in the parameters of a train station, but I want to add more track types. I am a rookie when it comes to modding in Lua language and modding Transport Fever in general, so some ideas would be appreciated. For more information, do not hesitate to ask for that.

Cheers,
< >
Showing 1-5 of 5 comments
SoftwareSimian Dec 28, 2017 @ 12:28pm 
In the res\construction\station\rail\<type>.con file you have the line:
trackTypes = { "standard.lua", "high_speed.lua" },
which lets you select the track type. Putting your new track in the appropriate model/mesh folders and listing the name there should let you select it.
At least if you're modding a specific station. If you want a general-purpose mod to expand the selection of tracks to all stations, I'm sure that's possible but I'm also a new modder and can't help you much further.
Gregory_TheGamer Dec 28, 2017 @ 9:38pm 
First of all, let's welcome each other into the modding world of Transport Fever.

So it is that file? I tried that already but in-game it still shows Standard and High-Speed under the track type... Oh yeah, I meant for all train stations by the way. I also took a look into the scripts folder and found an interesting file. Unfortunately, that file didn't have that much to do with track selection on the stations. :/
Dirkels Dec 29, 2017 @ 2:51am 
Welcome too :-)

To my knowledge (not really that experianced I must admit) SoftwareSimian's way is the only way to do it (that is for the standard game supplied stations and the curved stations if you have that mod active). Other stations that modders have made might use different way of selecting the track type.

In addition you wil have to change the function makeTrackTypeParam in the paramsutil.lua to add your track to the option window. Warning adding your track here will crash the game if you try to select your track type for a station that uses this function but does not have it's trackTypes field (or simular construction) extended with your track.

It would have been better if the libary functions that select and lay tracks would scan the res/config/track folder and include all tracks found (might give a long list in the option windows though). However modded stations might not use these library function so will still not have your new track.
Dirkels Dec 29, 2017 @ 5:12am 
Been looking further and found a relative simple way to do it afterall, at least for all standard stations, including curved stations if that mod is installed. For other mods it depends on if they use the changed library functions, it works for SoftwareSimian's flexible train station. What I did was:
  • Added trackTypes and trackTypeNames fields to the object game.config.
  • Copied the res/config/paramsutil.lua and changed the makeTrackTypeParam() function to use the above defined game.confgi.trackTypeNames field instead of local defined values.
  • Copied the res/config/railstationconfigutil.lua and changed the makeTrainStationConfig() function to use the above defined game.config.trackTypes field instead of list from the stationConfig parameter.
Last edited by Dirkels; Dec 29, 2017 @ 5:12am
Gregory_TheGamer Jan 4, 2018 @ 12:09am 
Hey fellow modders,

Does anyone know how other train station length mods alter and add station lengths? I've looked in the files of the ones that use the library that UG uses and I found no differences in the files. So where are the lengths located?

Information is appreciated!
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Dec 28, 2017 @ 2:18am
Posts: 5