Map mod format

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.

  • How to package a map mod
    From Train Fever 7554 we can create maps based on height maps, but just adding the height map isn't enough. The first part of this guide is for basic maps without any extra mod manager support. The second part is about how to package the map so it can be handled by a mod manager. First off, if you haven't already a maps folder in your Train Fever root, go ahead and create one. To install a height map you need one folder for the map and then at least two files [code]Maps +-- Arbitrary_folder +-- info.lua +-- heightmap.png[/code] The Arbitrary folder can be named anything you like and is not shown anywhere in TF. However, it servers like a map ID internally in TF to keep track of what map you have selected. Just as with the mod ID, I would recommend to use the same naming convention as for mods, except the version part. [tt]Author_MapName[/tt] For example: [code]Maps +-- gwinda_west_sweden +-- info.lua +-- heightmap.png[/code] [b][font='Verdana, Geneva, sans-serif'][size=12]Info.lua[/size][/font][/b] [size=10][font='Arial, Helvetica, sans-serif']This is a much more simple version of the mod's info.lua[/font][/size] [code]function data() return { description = "The area from Bohus to Kungsbacka", name = "Sweden's west coast", range = { 25, 1000 }, seed = 'A working map seed' } end[/code] [b]description[/b] This is obviously a description of the map, but doesn't support localization at all. [b]name[/b] This is the map name you will find inside Train Fever and has nothing to do with the folder name (map ID). This name doesn't support localization. [b]range[/b] A table specifying min and max height of the map where the water level is fixed at 100. In the example above, pure black will be placed at 25 (-75m below the water level) and pure white at 1000m (900m above water level). [b]seed[/b] If the height map contains a lot of water or other obstacles, there is sometimes not enough space to connect all cities and the map creation will fail. To ensure that the map will work, a tested map seed can be provided. The seed follows the same rules as any map seed in Train Fever. [b][size=12][font='Verdana, Geneva, sans-serif']heightmap.png[/font][/size][/b] This must be a grayscale image saved in .png format. It can be either a 8bit or 16bit image. It can be one of three accepted sizes. Small: 2049×2049 Medium: 3073×3073 Large: 4097×4097 Black is the lowest point and white the highest. The range parameter in info.lua controls the scale and water level. [b][size=18][font='Verdana, Geneva, sans-serif']Package a map mod for use with a mod manager[/font][/size][/b] TFGM can already handle the basic map format described above, but with very little feedback. For example no author information or localization. Just zip or rar the map ID folder and you are ready to go. [code]Archive.zip +-- gwinda_west_sweden +-- info.lua +-- heightmap.png[/code] From TFGM's point of view, a map mod is treated as any ordinary mod and can have additional files, to be used by a mod manager. [code]Archive.zip +-- gwinda_west_sweden +-- info.lua +-- strings.lua +-- image_00.tga +-- heightmap.png[/code] [size=10][font='Arial, Helvetica, sans-serif'][b][size=12]Info.lua[/b][/font][/size] [font='Arial, Helvetica, sans-serif']This is pretty much the same as a mod's info.lua[/font][/size] [code]function data() return { authors = { { name = "Gwinda", role = "CREATOR", steamProfile = '76561198041807425' } }, description = _("The area from Bohus to Kungsbacka"), minGameVersion = 7554, name = _("Sweden's west coast"), range = { 0, 500 }, seed = '7lih3gw34', tags = { "Map", "Sweden" }, } end[/code] [b]name[/b] Note that the name can be localized with the strings.lua file. This localization only works in the mod manager. [b]description[/b] Note that the description can be localized with the strings.lua file. This localization only works in the mod manager. [b]minGameVersion[/b] This is the minimum Train Fever version this map mod requires to run. In practice, set this to the Train Fever version you tested the map mod against. The variable is optional and can be excluded. [b]tags[/b] This is a table with tags so the map 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 = { "Map", "Sweden" } 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. There is no need to put the authors or map mod name as a tag, these are included automatically in TFGM searches. [b]authors[/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 3 author: [code]authors = { { name = "Gwinda", role = "CREATOR", steamProfile = "76561198041807425", tfnetId = 18570 }, { name = "Ola Haldor Voll", role = "CO-CREATOR", steamProfile = "76561197961659177", text = _("Map data conversion"), tfnetId = 18378 }, { name = "Gurra Aktersnurra", role = "BASED_ON", text = "example map", steamProfile = "12345678901234567", tfnetId = 12345 } }[/code] [b]name[/b] The name of the author, displayed on the author card and in list view. [b]steamProfile[/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]role[/b] There are currently 5 roles. "CREATOR" This is a lead creator of the mod. The [b][i]text[/i][/b] 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[b][i] text[/i][/b] 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 [b][i]text[/i][/b] variable specifies the mod(s) this mod was based on. "TESTER" This author did mod testing. The [b][i]text[/i][/b] variable specifies what was tested. For example "Windows 7", "Linux", "Mac" etc... "TRANSLATOR" This creator contributed with a localization (translation) of the mod. The [b][i]text[/i][/b] 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]text[/b] This field has different meaning depending on the role, see each role for an explanation. [font='Verdana, Geneva, sans-serif'][size=14][b]Strings.lua[/b][/size][/font] This works exactly in the save way as the mods do. [code]function data() return { sv = { ["The area from Bohus to Kungsbacka"] = 'Området från Bohus ned till Kungsbacka', ["Sweden's west coast"] = 'Sveriges västkust' } }[/code] [size=14][b][font='Verdana, Geneva, sans-serif']Image_00.tga[/font][/b][/size] This is the map mod's image inside the mod manager. If this file is missing, the heightmap.png will be used instead. Since this image isn't used by Train Fever, it can actually be in any of the following formats: .png .tga .bmp .gif .jpg

Teilen