Making mods work with the in-game mod manager

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


Sie betrachten gerade eine ältere Version des Eintrags. Klicken Sie hier, um zur aktuellen Version zu gelangen.

  • A guide on how to make your existing or new mods work with the new in-game mod manager that came with the USA DLC patch.
    [url='http://www.train-fever.net/index.php/Thread/2793-Prepare-your-mod-for-the-new-in-game-mod-manager/'][b]FORUM THREAD FOR DISCUSSIONS HERE[/b][/url] 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: [font='courier new,courier,monospace'][color=#0099ff][b]yourmodidentifier_majorVersionNumber [/b][/color][/font]In this folder it's the same hierarchy as before, with a res folder, config (needed for multiple units), models, textures and so on.[font='courier new,courier,monospace'][color=#0099ff][b][/b][/color][/font] [b]Example[/b] 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. [font='courier new,courier,monospace']cfc0ff51-fe03-42b9-b831-68d189acebd1_1[/font] When selecting a mod identifier it is good praxis to use an identifier that makes it easy to spot the mod. [font='courier new,courier,monospace'] nsb_stadlerflirt_mod_1[/font] Keep in mind that this is an [i]identifier[/i] 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 [font='courier new,courier,monospace']olahaldor_nsbstadlerflirt_1[/font] If you make a major version of your mod, and it's become version 2.1, you should name the folder like this [font='courier new,courier,monospace']olahaldor_nsbstadlerflirt_2[/font] [b]Preview image[/b] 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 [b]320x180 pixels[/b], and saved as uncompressed TARGA (.tga) and be named [font='courier new,courier,monospace'][color=#0099ff][b]image_00.tga [/b][/color][/font] If you have more than one image they are just named [font='courier new,courier,monospace'][color=#0099ff][b]image_01.tga image_02.tga [/b][/color][/font]etc... For the time being TF only use the [color=#0099ff][b][font='courier new,courier,monospace']image_00.tga[/color][/b][/font] 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 [/code] [b]Getting the mod to show up in the menus [/b]In order to get the mod to appear in the list of possible mods to activate, you will need another file, [b][color=#0099ff][font='courier new,courier,monospace']info.lua[/color][/font][/b]. The file will be placed in the root folder of your mod. Any unused variables can be removed completely. [code]olahaldor_nsbstadlerflirt_1 \-- res \-- image_00.tga \-- info.lua[/code] Here's an example of what the [color=#0099ff][b][font='courier new,courier,monospace']info.lua[/color][/b][/font] file looks like in my NSB Stadler Flirt mod. [code] function data() return { minorVersion = 61, -- minor version, count up from 0 severityAdd = "WARNING", -- OPTIONAL "NONE", "WARNING" or "CRITICAL" severityRemove = "CRITICAL", -- OPTIONAL "NONE", "WARNING" or "CRITICAL" name = _("NSB Stadler Flirt"), -- OPTIONAL mod name description = _("NSB Stadler Flirt v1.6.1"), -- OPTIONAL description authors = { -- OPTIONAL one or multiple authors { name = "Ola Haldor Voll", -- author name role = "CREATOR", -- OPTIONAL "CREATOR", "CO_CREATOR", "TESTER" or "BASED_ON" or "OTHER" text = "I made this", -- OPTIONAL contribution description steamProfile = "76561197961659177", -- OPTIONAL steam profile ID number tfnetId = 18378 -- OPTIONAL train-fever-net author id } }, tags = { "vehicle", "train" }, -- OPTIONAL "vehicle", "bus", "tram", "train", "steam", "diesel", "electric", "railcar", "wagon", "passenger", "goods", "building", "station", "deco", "town", "depot", "signal", "tool", "pack" or similar tags tfnetId = 0, -- OPTIONAL train-fever.net download id minGameVersion = 5112, -- OPTIONAL minimal required train fever game version dependencies = { }, -- OPTIONAL list of dependent mod ids url = "http://www.train-fever.net/filebase/index.php/Entry/74-NSB-Stadler-Flirt" -- OPTIONAL mod url } end [/code] Not all of the variables are used or even set in stone yet. Train Fever only use the following variables. [b][font='courier new,courier,monospace'][color=#0099ff] minorVersion [/color][/font][/b]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 [i]replace[/i] the previous mod with the same [i]major[/i] version. [b][i]This variable is mandatory and must be included.[/i][/b] 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 [font='courier new,courier,monospace']minorVersion[/font] 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 [font='courier new,courier,monospace']minorVersion[/font] 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). [b][font='courier new,courier,monospace'][color=#0099ff] severityAdd [/color][/font][/b]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. [font='courier new,courier,monospace']"NONE"[/font] This mod can be added without any side effects. [font='courier new,courier,monospace']"WARNING"[/font] There may side effects but the game shouldn't crash. [font='courier new,courier,monospace']"CRITICAL"[/font] There is a high risk that the saved game will crash or be unplayable.[b][font='courier new,courier,monospace'][color=#0099ff] severityRemove [/color][/font][/b]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. [font='courier new,courier,monospace']"NONE"[/font] This mod can be removed without any side effects. [font='courier new,courier,monospace']"WARNING"[/font] There may side effects but the game shouldn't crash if removed. [font='courier new,courier,monospace']"CRITICAL"[/font] There is a high risk that the saved game will crash or be unplayable if removed.[b][font='courier new,courier,monospace'][color=#0099ff] name [/color][/font][/b]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 [font='courier new,courier,monospace'][b][color=#0099ff]strings.lua[/color][/b][/font] translation file.[b][font='courier new,courier,monospace'][color=#0099ff] [/color][/font][/b]The variable is optional and can be excluded. [b][font='courier new,courier,monospace'][color=#0099ff] description [/color][/font][/b]The mod's description. This is shown in Train Fever's internal mod manager, TFGM and TFMM. The name can be localized with the [font='courier new,courier,monospace'][b][color=#0099ff]strings.lua[/color][/b][/font] translation file. The variable is optional and can be excluded. [b][font='courier new,courier,monospace'][color=#0099ff]minGameVersion[/color][/font][/b] 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. [b]Variables used by TFGM[/b] These additional variables are used by TFGM to extend the mod information. [b][font='courier new,courier,monospace'][color=#0099ff]tags[/color][/font][/b] 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: [font='courier new,courier,monospace']tags = { "station", "building", "passenger", "MyTag" }[/font] 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. [b]Built in tag definitions in TFGM.[/b] [table][tr][td]Age[/td][td]Vehicle ageing[/td][/tr][tr][td]Building[/td][td]Generic building[/td][/tr][tr][td]Bus[/td][td]A bus model for passenger transport[/td][/tr][tr][td]Cost[/td][td]Details concerning costs[/td][/tr][tr][td]Decoration[/td][td]Decoration model without any practical use[/td][/tr][tr][td]Depot[/td][td]Depot model[/td][/tr][tr][td]Diesel[/td][td]Diesel Engine[/td][/tr][tr][td]Electric[/td][td]Electric engine[/td][/tr][tr][td]Engine[/td][td]Engine as in train engine[/td][/tr][tr][td]Goods[/td][td]Goods components[/td][/tr][tr][td]HUD[/td][td]Head UP Display elements in the 3D view, icons for trains, stops, trucks, depots etc.[/td][/tr][tr][td]Industry[/td][td]Industry chains[/td][/tr][tr][td]Maintenance[/td][td]Details concerning maintenance[/td][/tr][tr][td]Music[/td][td]Background music in game and menus[/td][/tr][tr][td]Name[/td][td]In game name related[/td][/tr][tr][td]Package[/td][td]A package is an archived mod with several mods/changes[/td][/tr][tr][td]Passenger[/td][td]Passenger related[/td][/tr][tr][td]Price[/td][td]Alteration of prices[/td][/tr][tr][td]Railcar[/td][td]A rail carriage in general[/td][/tr][tr][td]Script[/td][td]A file containing Lua code[/td][/tr][tr][td]Signal[/td][td]A signal model for controlling traffic[/td][/tr][tr][td]Sound[/td][td]A sound effect such as engine sounds, door sounds, click sounds etc.[/td][/tr][tr][td]Station[/td][td]Station model[/td][/tr][tr][td]Steam[/td][td]Steam Engine[/td][/tr][tr][td]Street[/td][td]Street or road related[/td][/tr][tr][td]Texture[/td][td]A texture for a 3D model[/td][/tr][tr][td]Time[/td][td]Alteration of timeline or ageing[/td][/tr][tr][td]Tool[/td][td]Tools and utilities for Train Fever[/td][/tr][tr][td]Town[/td][td]A town related in general[/td][/tr][tr][td]Tram[/td][td]Tram model[/td][/tr][tr][td]Train[/td][td]A train in general[/td][/tr][tr][td]Truck[/td][td]Truck model[/td][/tr][tr][td]UI[/td][td]User Interface elements such as menu buttons[/td][/tr][tr][td]Vehicle[/td][td]A vehicle in general[/td][/tr][tr][td]Waggon[/td][td]Waggon model[/td][/tr][/table] [b][font='courier new,courier,monospace'][color=#0099ff]authors[/color][/font][/b] 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 2 author: [code]authors = { { name = "Ola Haldor Voll", role = "CREATOR", steamProfile = "76561197961659177", tfnetId = 18378 }, { name = "Gurra Aktersnurra", role = "BASED_ON", text = "example mod", steamProfile = "12345678901234567", tfnetId = 12345 } }[/code] [b][font='courier new,courier,monospace'][color=#0099ff]name[/color][/font][/b] The name of the author, displayed on the author card and in list view. [b][font='courier new,courier,monospace'][color=#0099ff]steamProfile[/color][/font][/b] 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. [b][font='courier new,courier,monospace'][color=#0099ff]role[/color][/font][/b] There are currently 4 roles. [font='courier new,courier,monospace']"CREATOR"[/font] This is a lead creator of the mod. [font='courier new,courier,monospace']"CO_CREATOR"[/font] This is a Co-Creator contributing to the mod. The text variable specifies what he/she contributed with. [font='courier new,courier,monospace']"BASED_ON"[/font] This mod was based on the work of this author. The text variable specifies the mod(s) this mod was based on. [font='courier new,courier,monospace']"TESTER"[/font] This author did mod testing. The text variable specifies what was tested. For example "Windows 7" or "Linux" etc... [font='courier new,courier,monospace']"TRANSLATOR"[/font] 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 [url='http://www.w3schools.com/tags/ref_language_codes.asp']ISO639-1 language code[/url] (not to be confused with a country code). [b][font='courier new,courier,monospace'][color=#0099ff]text[/color][/font][/b] This is a free text field displayed underneath the role on the author card. This should specify what the author did in his role. See each role above. [b][font='courier new,courier,monospace'][color=#0099ff]tfnetId[/color][/font][/b] 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. [b]Other variables not used by Train Fever or TFGM (TFMM?)[/b] These variables are not used by TFGM or Train Fever at the moment. I'm not even sure TFMM use them. [b][font='courier new,courier,monospace'][color=#0099ff]dependencies[/color][/font][/b] A list of mods this mods depends on to run properly. [b][font='courier new,courier,monospace'][color=#0099ff]url[/color][/font][/b] A fully qualified URL to the mod's home page. 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 [b][font='courier new,courier,monospace'][color=#0099ff]name[/color][/font][/b] tag from the [font='courier new,courier,monospace'][b][color=#0099ff]info.lua[/color][/b][/font] file while the [font='courier new,courier,monospace'][color=#0099ff][b]description[/b][/color][/font] appears below the preview image. [img]http://puu.sh/ggdaU/1662bcfb8e.jpg[/img] I hope this will get you going to update your mods!

Teilen