Train Fever can be modified and extended by Mods. From a file system perspective, a Mod is simply a directory containing all the necessary data and script files. The directory name serves as the Mod’s unique identifier and also contains a version number (see Directory structure for details).
Basically, there are two ways to modify game functionality and content:
- File-based: Allows to add, replace or remove (hide) content on the file level. The general idea is that the files in a Mod directory are seen by the game just like the game’s own files. If there are two files with the same name, the file from the Mod directory takes precedence.
- Script-based: Allows to modify the game’s configuration and content by means of a Lua script. This way, it’s e.g. possible to adjust the capacities of all vehicles without copying all the files and changing the values individually.
In Train Fever, Mods are not enabled globally, but on a per-game basis. In other words, every savegame remembers which Mods are active. This has the advantage that multiple games with different sets of active Mods can be played without hassle. However, it also means that content that is loaded outside of the actual game (e.g. main menu backgrounds) can’t be modded at this time.
The best way to learn is probably to study existing Mods.
urbangames_no_costs_1: sets all cost related variables to zero (script-based)
urbangames_no_main_conns_1: disables “main connections” (one line of script)
urbangames_vehicles_no_end_year_1: sets the “end year” of each vehicle to zero, making them available forever (script-based)
- Get more Mods on http://www.train-fever.net or http://transport-games.ru