Trainz/Config.txt Files

Some General Rules For config.txt FilesEdit

All asset must have a config.txt file to be placed in Trainz. The config.txt file contains essential information about the asset, including its name, kuid number, creator, version, region, era, type, etc.

Many of the problems with faulty assets are caused by simple mistakes in their config.txt files.

config.txt files are plain text (ASCII) files. They should be edited with a non-formatting program such as Notepad. They must not be edited with a word processor program such as Microsoft Works, Word or Open Office. One such text program is ConTEXT, which provides syntax highlighting when used with Wulf's [1] syntax files. You will need to register at the above link to be able to download the syntax files. ConTEXT will also show matching brackets, which is very helpful when troubleshooting.

Tag keywords must be spelt correctly, and the correct syntax must be used when specifying the parameters of each tag. Since a computer program will be interpreting the contents, precise accuracy is required.

Curly braces { and } are used to designate the starting and ending points of the contents of those tags which require multiple lines. Every open curly brace must have a corresponding closed curly brace. Some tags can be nested in which case structures such as { { } } are permitted.

kuid's must be specified using one of the following formats:

  • <kuid:nnnn:nnnn>
  • <kuid2:nnnn:nnnn:nn>

(where the number of digits may vary) A kuid specification can optionally be enclosed in a pair of double-quotes, for example: "<kuid:nnnn:nnnn>"

The following tags are mandatory:

  • kind
  • kuid
  • username

(any more?)

In TRS2004 and earlier versions of Trainz, after editing a config.txt file it is necessary to delete the Cache\world_cache_Dispatcher.chump file, otherwise Trainz will use the old version of the file. This is only required if the config.txt file being modified is in the World\Dispacher\ hierarchy. If you are editing files in the World\Custom\ hierarchy, the .chump file does not need to be deleted.

For TRS2004 users, the Trainz Objectz free third-party utility can be used for scan installed assets for common errors in their config.txt files, and optionally automatically correct some of the errors.

For TRS2006 and TC users, CMP provides good error-checking but be careful, mess up the brackets and you may find anything following disappears.

Some Common Errors In config.txt FilesEdit

  • Mismatched curly braces.
  • Any non-spacing character immediately followed by an open curly braces.
  • Any non-spacing character immediately followed by an open angle bracket, except in HTML where it is allowed.

For the items in the following table, an error will only occur if the item is used as a keyword. Inside text strings such as descriptions any spelling, spacing and punctuation can be used.

Incorrect Correct
behaviour behavior
colour color
discription description
independent independant (i.e. contrary to correct English spelling)
kuid { kuid-table {
kuid{ kuid-table {
kuid table kuid-table
kuidtable kuid-table
obsolete obsolete-table {
obsolete{ obsolete-table {
obsolete table obsolete-table
obsoletetable obsolete-table
table{ table {
trainz-build "utc" trainz-build 1.5
Last modified on 9 October 2011, at 01:28