Transport Fever 2

Transport Fever 2

Create your own game world!
Give your game a personal touch and change it to your liking. Create, share and install mods. Customize the game with new landscapes, vehicles, stations, assets and more.
How difficult is it to duplicate a track for adding different speeds?
I have some amazing looking German tracks that I want to use for a map, but they only come with the speed limits of 120 km/h and above. I want to have lower speed limits for stations, junctions etc. I figured it would not be super difficult to add more speed variations, but while I know how to code I am not familiar with the TF2 files, so I want to ask the experts here before breaking anything. Is there a specific file where I can just add the speed limits I want or do I need to make copies of the same track and add different speed limits to each?
< >
Showing 1-1 of 1 comments
Hi, the Modding Manual is a good start:
https://www.transportfever2.com/wiki/doku.php?id=modding

Creating completely separate copies is the correct approach, because modifying existing vanilla or mod files causes conflicts/crashes.

Tracks usually exist as .lua files in the res/config/tracks folders of the vanilla game and the individual mods.

Make your own mod in the staging_area folder. Give it copies of the original track .lua files with new unique names. (Usually authornameorinitials_modname_filename.lua or something.) Then modify the contents of the .lua files the way you want. Be sure to update the name/description fields too so they will be easier to identify in the game menus (because they will have the same icons if you don't make new ones).

Don't duplicate any other files into your mod. Both mods must be loaded in your game because your mod is dependent on the original mod's model, material, and textures files. You can enable them both in any order and there should be no conflicts.


An even better method is to script it in mod.lua postRunFn to create dynamic copies of the original tracks when the game loads, but depending on your knowledge/experience level you might find the above easier.
< >
Showing 1-1 of 1 comments
Per page: 1530 50