Making mods work with the in-game mod manager

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.

 

Registration and use is of course free for you.

 

We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • A guide on how to make your existing or new mods work with the in-game mod manager.

    FORUM THREAD FOR DISCUSSIONS HERE


    I'm sure a lot of you modders have asked yourself how to get your (or your favorite) mod working from the get go.
    I politely asked for guidance, and got some info on it.


    Your mod need its own folder. The folder needs to be named like this: yourmodidentifier_majorVersionNumber
    In this folder it's the same hierarchy as before, with a res folder, config (needed for multiple units), models, textures and so on.


    Example
    The mod identifier must be unique among all mods but can basically be anything that is as valid directory name. When choosing a mod identifier, keep in mind that this is also the folder name when the mod has been installed. Using a GUID will guarantee uniqueness but will be very hard to identify in the mod folder.


    cfc0ff51-fe03-42b9-b831-68d189acebd1_1


    When selecting a mod identifier it is good praxis to use an identifier that makes it easy to spot the mod.

    nsb_stadlerflirt_mod_1


    Keep in mind that this is an identifier for the mod and shouldn't be changed. This identifier may be used to check for updates etc.


    When TFGM and TFMM converts older mods to the new system, they use the following algorithm to generate a mod identifier.
    1. Concatenate author _ mod name _ major version
    2. Convert to lowercase.
    3. remove all characters that isn't a 0..9 and a..z


    olahaldor_nsbstadlerflirt_1


    If you make a major version of your mod, and it's become version 2.1, you should name the folder like this


    olahaldor_nsbstadlerflirt_2



    Preview image
    To make the user experience better you should make a screenshot of your mod, so it's easier to see what mod the user is about to activate. This screenshot must be 320x180 pixels, and saved as uncompressed TARGA (.tga) and be named image_00.tga


    If you have more than one image they are just named image_01.tga image_02.tga etc... For the time being TF only use the image_00.tga
    This image file(s) needs to be placed in the root of your mod folder. So it'll be something like this


    Code
    olahaldor_nsbstadlerflirt_1
      |-- res
      |-- image_00.tga


    Documents
    Documentation such as manuals or screenshots should be placed in the documents folder. This folder is optional and can be excluded if you have no additional files to include.


    Code
    olahaldor_nsbstadlerflirt_1
      |-- res
      |-- documents        (optional)
      |-- image_00.tga


    Mod configurations
    If your mod use a configuration file, this file should be placed in the config folder located in the mod root. This folder is optional and can be excluded if you don't have a mod configuration.


    Code
    olahaldor_nsbstadlerflirt_1
      |-- res
      |-- documents        (optional)
      |-- config           (optional)
      |     |-- config.lua (optional)
      |
      |-- image_00.tga


    Mod translation
    All strings within _(...) are looked up in the strings.lua file. If no strings.lua is found or the string isn't defined inside it, the original string is used. Therefore it is recommended to write this string in English so as many users as possible can understand it if their own language isn't included.


    Code
    olahaldor_nsbstadlerflirt_1
      |-- res
      |-- documents        (optional)
      |-- config           (optional)
      |     |-- config.lua (optional)
      |
      |-- image_00.tga 
      |-- info.lua
      |-- strings.lua      (optional but highly recommended)


    Getting the mod to show up in the menus
    In order to get the mod to appear in the list of possible mods to activate, you will need another file, info.lua. The file will be placed in the root folder of your mod.
    Any unused variables can be removed completely.


    Code
    olahaldor_nsbstadlerflirt_1
      |-- res
      |-- documents        (optional)
      |-- config           (optional)
      |     |-- config.lua (optional)
      |
      |-- image_00.tga
      |-- info.lua


    Here's an example of what the info.lua file looks like in my NSB Stadler Flirt mod.



    Not all of the variables are used or even set in stone yet.
    Train Fever only use the following variables.

    minorVersion
    This is the fraction part of the mod's version number.
    A new version that doesn't break saved games should increase the minor version because it will replace the previous mod with the same major version.
    This variable is mandatory and must be included.


    Example 1:
    Your mod is v2.3 and you decide to do a minor update that won't break game saves. The major version, the number at the end of your mod folder, stays the same; 2
    The minorVersion number is incremented to 4 resulting in mod version 2.4


    Example 2:
    Your mod is v2.3 and you decide to do a major update that will break game saves. The major version, the number at the end of your mod folder, increments to 3
    The minorVersion number is reset to 0 resulting in mod version 3.0


    This will allow several versions of the same mod to co-exists so game saves prior to the major changes still can load (using the older version).

    severityAdd
    This tells Train Fever the impact of adding this mod to a saved game. There are currently 3 levels.
    The variable is optional and can be excluded.


    "NONE"
    This mod can be added without any side effects.


    "WARNING"
    There may side effects but the game shouldn't crash.


    "CRITICAL"
    There is a high risk that the saved game will crash or be unplayable.

    severityRemove
    This tells Train Fever the impact of removing this mod from a saved game. There are currently 3 levels.
    The variable is optional and can be excluded.


    "NONE"
    This mod can be removed without any side effects.


    "WARNING"
    There may side effects but the game shouldn't crash if removed.


    "CRITICAL"
    There is a high risk that the saved game will crash or be unplayable if removed.

    name
    The name of the mod, not to be confused with the mod identifier. The name is what you see in Train Fever's internal mod manager, TFGM and TFMM.
    The name can be localized with the strings.lua translation file.
    The variable is optional and can be excluded.

    description
    The mod's description. This is shown in Train Fever's internal mod manager, TFGM and TFMM.
    The name can be localized with the strings.lua translation file.
    The variable is optional and can be excluded.


    minGameVersion
    This is the minimum Train Fever version this mod requires to run. In practice, set this to the Train Fever version you tested the mod against.
    The variable is optional and can be excluded.



    Variables used by TFGM
    These additional variables are used by TFGM to extend the mod information.


    tags
    This is a table with tags so the mod can be categorized/grouped/sorted etc.
    The tag name itself serves as the tag identifier and should therefore be in English, preferable one word.


    Example:
    tags = { "station", "building", "passenger", "MyTag" }


    TFGM have the capability to localize tags so you can search for a tag in any of the localized tag versions and still find it. A list of built in tag definitions are shown in gray while user defined tags are shown in white to indicate that the tag likely don't have localization.
    There is no need to put the authors or mod name as a tag, these are included automatically in TFGM searches.



    Built in tag definitions in TFGM.


    AgeVehicle ageing
    BuildingGeneric building
    BusA bus model for passenger transport
    CostDetails concerning costs
    DecorationDecoration model without any practical use
    DepotDepot model
    DieselDiesel Engine
    ElectricElectric engine
    EngineEngine as in train engine
    GoodsGoods components
    HUDHead UP Display elements in the 3D view, icons for trains, stops, trucks, depots etc.
    IndustryIndustry chains
    MaintenanceDetails concerning maintenance
    MusicBackground music in game and menus
    NameIn game name related
    PackageA package is an archived mod with several mods/changes
    PassengerPassenger related
    PriceAlteration of prices
    RailcarA rail carriage in general
    ScriptA file containing Lua code
    SignalA signal model for controlling traffic
    SoundA sound effect such as engine sounds, door sounds, click sounds etc.
    StationStation model
    SteamSteam Engine
    StreetStreet or road related
    TextureA texture for a 3D model
    TimeAlteration of timeline or ageing
    ToolTools and utilities for Train Fever
    TownA town related in general
    TramTram model
    TrainA train in general
    TruckTruck model
    UIUser Interface elements such as menu buttons
    VehicleA vehicle in general
    WaggonWaggon model



    authors
    This is a table with one or more authors to the mod. An author can have a role indicating his contribution to the mod.


    Example with 3 author:

    name
    The name of the author, displayed on the author card and in list view.


    steamProfile
    This is the numerical Steam profile ID. You can retrieve it from TFGM's Preferences dialog.
    The ID is used to fetch your Steam avatar image and link to your Steam Profile Page.


    role
    There are currently 4 roles.


    "CREATOR"
    This is a lead creator of the mod.
    The text field have at this point no meaning and can be freely used. You can put it inside a _(...) for translation.


    "CO_CREATOR"
    This is a Co-Creator contributing to the mod.
    The text variable specifies what he/she contributed with. You can put it inside a _(...) for translation.


    "BASED_ON"
    This mod was based on the work of this author.
    The text variable specifies the mod(s) this mod was based on.


    "TESTER"
    This author did mod testing.
    The text variable specifies what was tested. For example "Windows 7", "Linux", "Mac" etc...


    "TRANSLATOR"
    This creator contributed with a localization (translation) of the mod.
    The text variable specifies what language he/she contributed with.
    The language is specified with it's ISO639-1 language code (not to be confused with a country code).


    text
    This field has different meaning depending on the role, see each role for an explanation.


    tfnetId
    This might have been a typo and should probably be the tfnet_author_id found in tfmm.ini and should probably be named/renamed to tfnetAuthorId
    This isn't at this point used by TFGM at all.



    Other variables not used by Train Fever or TFGM (TFMM?)
    These variables are not used by TFGM or Train Fever at the moment. I'm not even sure TFMM use them.


    dependencies
    A list of mods this mods depends on to run properly. I'm not sure if the latest TFMM uses it either.


    url
    A fully qualified URL to the mod's official home page. Not


    The strings.lus would look something like this in English and Google translated to German and Swedish:



    In the end, here's what it will look like in the Train Fever mod activation. Notice how the major and minor version names appear next to the name tag from the info.lua file while the description appears below the preview image.
    [Blocked Image: http://puu.sh/ggdaU/1662bcfb8e.jpg]



    I hope this will get you going to update your mods!

Share