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
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.
Author_MapName
For example:
Info.lua
This is a much more simple version of the mod's info.lua
function data() return {
description = "The area from Bohus to Kungsbacka",
name = "Sweden's west coast",
range = { 25, 1000 },
seed = 'A working map seed'
} end
description
This is obviously a description of the map, but doesn't support localization at all.
name
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.
range
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).
seed
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.
heightmap.png
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.
Package a map mod for use with a mod manager
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.
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.
Archive.zip
+-- gwinda_west_sweden
+-- info.lua
+-- strings.lua
+-- image_00.tga
+-- heightmap.png
Info.lua
This is pretty much the same as a mod's info.lua
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
Display More
name
Note that the name can be localized with the strings.lua file. This localization only works in the mod manager.
description
Note that the description can be localized with the strings.lua file. This localization only works in the mod manager.
minGameVersion
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.
tags
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.
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:
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
}
}
Display More
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 5 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.
Strings.lua
This works exactly in the save way as the mods do.
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'
}
}
Image_00.tga
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