Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
How deep do you want to get into coding this?
This is an older non-modular station mod that pre-dates modular stations. For *modular* stations, they all generally work the same way (at least ones based on the vanilla modular codebase) and will automatically make all tracks types available. A few earlier modular station mods are still limited to "static" tracks only (ie, ones having track .module files), however my mod here unlocks many of those mods to work with any track type:
https://mod.io/g/transportfever2/m/unlock-platform-tracks
*Non-modular* / custom station mods however are a different beast, as there are many ways they can be coded. Some mods have custom script code that use API calls to find all track types loaded in the session and makes them available in a dropdown list in the station Configure options. Others simply hard-code a list of track types to choose from.
Based on the code snippets you posted, this mod appears to be one of the latter, specifically:
So if you just want something quick and dirty, you could try simply adding the .lua name of other track types you want to use to that list:
If it works you'll see the other track types in the station Configure options menu. If not you might get errors and/or a crash. Experimentation is the easiest way to find out. Make a copy of the mod in your staging_area folder so you can edit it without buggering up the official version. Make sure to load the correct version when loading your test map.
A bit more sophisticated would be to create a separate mod that runs an addModifier in runFn on that station mod's .con file to add the extra track types, that way you're not messing in the code of the original mod, which could cause conflicts with other mods out there.
If instead you want to add all track types to that mod, that's a bunch more coding. I'd try attacking it with an addModifier on the .con file options, and using API commands to build the track selection list dynamically, with a bunch of filters in place for all the "hidden" trackTypes created by other mods doing similar (there are quite a few). Plus I'd simply look at how other mods have done it for ideas.
I think it's not overly complicated code, but depending on your current experience with TpF2 modding and coding in general, it may need a little or a lot of learning/experimenting.