All text files (models, meshes, scripts etc.) should be encoded in UTF-8. Also, it is recommended to use lower-case file names to avoid problems on case-sensitive OSes / file systems.
The game’s installation folder (usually C:\Program Files (x86)\Steam\SteamApps\common\Transport Fever
on Windows) looks something like this:
Transport Fever\ dlcs\ ... mods\ ... res\ ... ...
All mods must be installed in the mods\
sub-directory. The directory structure is as follows:
Transport Fever\ mods\ urbangames_sample_mod_1 (1) config\ (2) (optional) ... documents\ (3) (optional) ... res\ (4) (optional) ... mod.lua (5) image_00.tga (6) (optional) strings.lua (7) (optional) workshop_preview.jpg (8) (optional) filesystem.lua (9) (optional)
<id>_<version>
. The ID should be as specific as possible, so it should definitely contain the author’s name (or organization) and the mod name. The version number is an integer starting at one.res/
folder.Different versions of the same mod are independent of each other, but when starting a new game, only the latest version is shown to the user.
The basic structure of the file is as follows. See Scripting for more information.
function data() return { info = { name = _("Sample mod"), -- (1) description = _("modDesc"), minorVersion = 0, -- (2) severityAdd = "WARNING", -- (3) severityRemove = "CRITICAL", }, -- options = .. -- runFn = .. -- checkActiveFn = .. } end
_(“text”)
indicates that the text will be translated (see strings.lua below).NONE
, WARNING
, or CRITICAL
.function data() return { en = { modDesc = "This is a sample mod.", }, de = { ["Sample mod"] = "Beispiel-Mod", modDesc = "Dies ist eine Beispiel-Mod.", } } end
This file contains translations for strings, specified as a list of key/value pairs for each language. If a key does not exist for a given language, the English text is used. If this isn’t defined neither, the key itself is displayed. For a list of possible language codes, see the directory res\strings\
.
function data() return { hiddenDirs = { "res/models/model/vehicle/truck/" }, hiddenFiles = { "res/models/model/vehicle/train/borsig_1860.mdl", "res/models/model/vehicle/train/br75_4.mdl" } } end
Allows to specify files and directories that are to be hidden from the game, i.e. it has the same effect as deleting the file(s).