User Tools

Site Tools


modding:developerinfo:start

Mod development

Overview

Transport Fever can be modified and extended by mods. Mods overwrite, add, or manipulate existing resource files. These resource files are kept in a folder named res.

There are many different types of resources:

  • Scripts (models, materials, constructions, configurations, …)
  • Models (meshes and textures)
  • Others (audio files, shaders, strings, …)

Scripts

Scripts are text files written in the Lua scripting language. They can be edited with a simple text editor.

Lua is an easy to learn, fast and powerful language. To find out more about Lua visit https://www.lua.org/.

Models

Model data is stored in mesh and textures files. Models can be created with a variety of modeling software.

A commonly used tool is the free open source software Blender. To find out more about Blender visit https://www.blender.org/.

Plugins or tools for converting models to a format useable in Transport Fever are available from the community, for example:

Others

There are other resource files of various types, including but not limited to:

  • Audio effect and voice in the Waveform Audio File Format (WAV).
  • Music in the Ogg Vorbis (OGG) format.
  • Translations in the common mo/po file format.
  • Vertex and fragment shaders (.vs/.fs), written in GLSL.
  • UI elements stored in the TARGA (TGA) format with an alpha channel.

Modding resources

These resources can be modified and extended in two ways:

  • Add, replace, or remove (hide) content:
    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.
  • Modify the game’s configuration and content:
    This way, it’s e.g. possible to adjust the capacities of all vehicles without copying all the files and changing the values individually.

Changing files directly in the installation folder is possible, but NOT the recommended way of modifying Transport Fever!

Instead, a mod should be created. 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 contains a version number. See Directory structure for details.

In Transport Fever, mods are not enabled globally, but on a per-game basis: Every save game remembers which mods are active. This has the advantage that multiple games with different sets of active mods can be played without hassle.

Content loaded outside of the actual game (e.g. main menu backgrounds) can’t be modded.

Examples

Please refer to the reference page for more information about scripting and examples of the most common resource types.

Publishing mods

Learn more about how to publish mod on the Steam Workshop wiki page.

Discussion

modding/developerinfo/start.txt · Last modified: 2019/03/19 10:18 (external edit)