John Cletheroe's
Trainz Hintz - A Step-By-Step Guide To Making A Very Simple TRS2004 Scenario


TRS2004 Scenario Creation Tutorial - Part Ten: Editing The Scenario's config.txt File

The information in a scenario's config.txt file is not a GameScript/TrainzScript program. Instead, it is a series of tags with parameters. At least one space or tab character separates the name of the tag from its parameters. The format of the file must be adhered to precisely and this can be discovered by viewing (but not changing) several existing config.txt files. Curly brackets are used to surround a list of parameters.

The scenario's config.txt file is located in its asset folder:

C:\Program Files\Auran\TRS2004\World\Custom\scenarios\name
(where "name" is the name of the scenario)

This file can be edited with a text editor program such as Notepad. When editing a config.txt file, do not disturb its top line which contains some hidden characters.

Before editing the file, look up the kuid of a locomotive. This can be a built-in locomotive, a downloaded locomotive, or a locomotive you have created. However, bear in mind that in a real scenario the user will require copies of all the rolling stock it uses, and therefore you may wish to restrict yourself to built-in items especially at first. With TRS2004, the kuid's for all installed assets can be listed in Trainz Objectz, and there is an option in that program to limit the list to rolling stock items. In addition, you may wish to add this line to trainzoptions.txt, which will cause Surveyor to display the kuid of the currently selected asset (of any kind) at the bottom right of the screen.

-ShowKuids

In the kuid-table section of the scenario's config.txt file, after the opening curly bracket and the entry for the layout which has been added automatically, add an entry for each rolling stock item that will appear in the scenario. Each entry should consist of the name by which that rolling stock item will be referred to in the scenario, followed by its kuid. The names by which rolling stock items are referred to in a scenario are probably case sensitive and definitely cannot contain spaces. The only punctuation mark permitted is the underline (_). The names you use need not bear any resemblence to the assets' actual names although normally that would be wise. When entering the rolling stock entries be sure to follow the same format as for the layout. There must be at least one space or tab character between the name of the vehicle and the open angle bracket for its kuid. Also ensure that all the rolling stock entries come before the closing curly bracket for the kuid-table.

Example (with only one rolling stock item added, namely an AN 830 Class locomotive):

kuid-table {
	layout01		<kuid:154110:5702762>
	AN830			<kuid:-1:100737>
}
The name of your layout may differ from the above example. The kuid number of your layout will definitely differ. Your choice of locomotive and the name you choose to give it may differ. If you choose a different locomotive then it will have a different kuid number.

Make a note of the precise name you give to each rolling stock item (in this example AN830). You will need this information later. Be sure to note whether each character is upper case or lower case.

DO NOT CHANGE THE LAYOUT'S config.txt FILE.


Index

Part Nine: Files And Folders

Part Eleven: Editing The Scenario's gs File


Overall Site Home Page
About this personal web site JohnCletheroe

EMail me

Most recently modified 16-Apr-10