mod.lua and strings.lua - Explaining the content and requirements

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


  • Based on examples, all required and optional field for the mod.lua and strings.lua files are explained in this article.

    [Blockierte Grafik: https://ftp.train-fever.net/flaggen/de.png] Die Deutsche Version gibt es hier: mod.lua und strings.lua - Erklärung und Inhalt


    1 Official Format by Urban Games (mod.lua)


    The basic format of the mod.lua file that is required for each mod in the root directory


    2 Additional Information for TPFMM


    Basic Information

    Code
    tfnetId = 0,                 -- optional, transportfever.net entry id
    steamId = 0,                 -- optional, steam workshop file id
    url = "https://transportfever.net"  -- optional, url to mod homepage

    Authors

    Code
    authors = {              -- optional, information about authors
      {                      -- add one or multiple authors
        name = "Author 1",   -- author name
        role = "CREATOR",    -- CREATOR, CO_CREATOR, TESTER, BASED_ON, OTHER
        tfnetId = 00000,     -- optional, id at transportfever.net
        steamId = 0000,      -- optional, steam id
      },                     -- optional, add more authors
    },

    Tags

    Code
    tags = { "tag1", "tag2", "tag3" },    --optional, list of tags

    Dependencies
    Define dependencies to other mods that are required in order for the mod to function as desired, not evaluated by the game but informs mod managers which other mods to download. For the download, at least one online source has to be defined


    Code
    dependencies = { "other_mod_1", "another_mod_1", "third_mod_1" },

    3 Translations (strings.lua)


    All strings put in _("") will be translated based on the strings.lua file:


    [box]Note:
    If a variable is passed to the _() function, the content of the variable, not the variable name itself is passed to the function. This, in combination with global variables in lua lead to the scenario in which description and name of multiple mods where overwritten by each other in a beta patch of Transport Fever. Although this is fixed by now, Urban Games and strongly advises to only use local variables. Pesonally, I advice to not use variables for the translation function.[/box]


    4 Example Files


    Very simple file with single author


    A repaint mod, that requires the mod defined above

Teilen