Configuration File

From OMSIWiki


Definition

Configuration Files (or shorter: config files) are all files which supply OMSI with external data and constants and which do not include executable code like the files of the Scripts. They are plain text files and are following a special syntax developed for OMSI. There are lots of config files:

  • options.cfg, envir.cfg, gamectrl.cfg and keyboard.cfg for global OMSI parameters
  • global.cfg and all associated *.map files of the maps
  • *.sco-, *.sli-, *.bus-, *.ovh- and *.hum-files, which contain the general and physical data of scenery objects, splines, vehicles and humans
  • Model, sound, texture change, cabin and path files with the ending *.cfg, which contains further information about 3D objects

Syntax

The syntax of config files follow a scheme which is quite simple but not very common. The basic rules is:

OMSI reads only lines which are following a key word!

Examples

In the following examples, we imply that [keyword] is a key word of this config file and that OMSI expects three values following:

This is a comment, because there is no key word leading.
So OMSI do not care about this lines until there is no key word.

In the upper example, nothing will happen.

[keyword]
1
2
3

This was a valid command which was introduced by [keyword].
After the three parameters were read, OMSI again searchs for key words and ignores everything else (like these two lines).

Now we had a command which allot the values 1, 2 and 3 to the three parameters. In front of and behind the key word there must not stay any other character, even no tab or space!

Wrong:

    [keyword]
1
2
3

Wrong:

[keyword] Comment
1
2
3

With this knowledge, it is very simple to comment commands out - you just have to add at least one character:

Not commented out:

[keyword]
1
2
3

Commented out:

    [keyword]
1
2
3

... or ...

[keyword]##
1
2
3

Attention! Not every command follows the convention "[...]"! Also these which are not bracked, follow the convention explained.

Some commands / key words expect a quantity of parameters first, so that the count of read lines by OMSI depends of this number. One example of this behaviour is the command to include scripts in a scenery object or vehicle:

[script]
3
script\script1.sco
script\script2.sco
script\script3.sco

Finally, there are some key words which expect an [end] command like e.g. the command [description]:


[description]
Der MAN SD 200 ...

-Technische Daten-

Länge: 11.490 mm
Breite: 2500 mm
Höhe 4060 mm

Motor: MAN D2566MUH, 141 kW bei 2100 U/min
Getriebe: Voith D851
Höchstgeschwindigkeit: 75 km/h

Leergewicht: 10700 kg
Zulässiges Gesamtgewicht: 16.000 kg

Sitzplätze Oberdeck: 53
Sitzplätze Unterdeck: 35
Stehplätze: 8
[end]