3D Studio Max Locomotive Interior Tutorial

Chapter 6 Setting up the Config.txt file

Using CCP

Using a text file editor*

In this tutorial you will learn how to create a working Config.txt file for the interior.

*Auran have stated that in future releases configs will not be directly edited.
For editing the text files I use a program called Ultra Edit. Notepad or any other text editor can also be used.

Using CCP

1. Adding containers

Switch back to CCP from 3ds and in the tree view ensure the "default" entry of the "mesh-table" is selected. In the "Tag Space" click on the file selection button and use the "Load Mesh" file explorer to navigate to the folder containing the mesh. Select the mesh and click on OK. The path to the mesh should now be showing up in the mesh tag. While we have the default container selected right click in the tree view and add the following tags.

auto-create

ensure the check box is selected which activates that entry. In the file tree view right click and add the following tags.

company
description

Also add the following container.

cameralist


Once the tags and containers have been added then enter the following values for each tag

Tag name Description and recomended value
kuid This is an uneditable entry and cannot be changed.
trainz-build This is an uneditable entry and cannot be changed.
category-class

Select the required class from the drop down box. In this case we need to select
ZI - Interior

category-region

Select the required regions by clicking in the checkbox next to each item. You can add as many regions as you like. In this case select the following;
CA; US

category-era

Select the required era's by clicking in the checkbox next to each item. You can add as many era as you need. In this case select the following;
1970s; 1980s; 1990s; 2000s

username

Type in a sutiable name for the asset. In this case I have used the following;
Tutorial Interior

kind This tells Trainz that the kind is a Traincar and not a scenery or track item and is an un-editable entry and cannot be changed
company

This is a company name for the item. In this case I have used the following value;
Tutorial


description



This is a description about the locomotive. It can be brief or very detailed. I have used the following text for this tag
Tutorial on how to create a sample locomotive interior

Now that we have the basic tags added and configured and the default mesh located we can begin adding the tags for the lever and gauges. In CCP tree view ensure the mesh-table entry is selected and add the following mesh names;

speedo_needle
bplocomain_needle
throttle_lever
reverser_lever
trainbrake_lever

Now within the first two "needle" mesh conatiners add the following tags

kind
auto-create
att
limits
angles
att-parent

In the other three "lever" mesh conatiners add the following tags

kind
auto-create
att
limits
angles
notches
notchheight
radius
att-parent

Once you have all the tags added then we need to customize each tag to suit our interior.

For each tag of the first speedo_needle container add the following values.

Tag name
Description and recomended value
kind
Select the following from the drop down box
needle
auto-create
ensure checkbox is selected
att
If you have the default mesh's directory path added and the attachment points named correctly then the following attachment name should be selectable from the drop down list.
a.needle0
limits

Type the following in the two setting for the limits

0 50
angles

Type the following in the two setting for the angles

-0.78525 0.78525
att-parent

Ensure the following is entered into this tag
default

 

For each tag of the bplocomain_needle container add the following values.

Tag name
Description and recomended value
kind
Select the following from the drop down box
needle
auto-create
ensure checkbox is selected
att
If you have the default mesh's directory path added and the attachment points named correctly then the following attachment name should be selectable from the drop down list.
a.bplocomain_needle
limits

Type the following in the two setting for the limits

0 50
angles

Type the following in the two setting for the angles

-0.78525 0.78525
att-parent

Ensure the following is entered into this tag
default

 

For each tag of the throttle_lever container add the following values.

Tag name
Description and recomended value
kind
Select the following from the drop down box
lever
auto-create
ensure checkbox is selected
att
If you have the default mesh's directory path added and the attachment points named correctly then the following attachment name should be selectable from the drop down list.
a.throttle_lever
limits

Type the following values in the two setting for the limits

0 8
angles

Type the following values in the two setting for the angles

0.698 -0.698
notches

By default CCP only adds one setting. Click the add button to add the remianing eight settings and type the following values in the nine settings for the notches.

0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1
notchheight

By default CCP only adds one setting. Click the add button to add the remianing eight settings and type the following values in the nine settings for the notchheight. Always ensure the number of notches and notchheights are a match.

1 1 1 1 1 1 1 1 1
radius

Ensure the following is entered into this tag
0.2

att-parent

Ensure the following is entered into this tag
default

For each tag of the reverser _lever container add the following values.

Tag name
Description and recomended value
kind
Select the following from the drop down box
lever
auto-create
ensure checkbox is selected
att
If you have the default mesh's directory path added and the attachment points named correctly then the following attachment name should be selectable from the drop down list.
a.reverser_lever
limits

Type the following values in the two setting for the limits

0 2
angles

Type the following values in the two setting for the angles

0.525 -0.525
notches

By default CCP only adds one setting. Click the add button to add the remianing two settings and type the following values in the three settings for the notches.

0 0.5 1
notchheight

By default CCP only adds one setting. Click the add button to add the remianing two settings and type the following values in the three settings for the notchheight. Always ensure the number of notches and notchheights are a match.

1 2 1
radius

Ensure the following is entered into this tag
0.2

att-parent

Ensure the following is entered into this tag
default

 

For each tag of the trainbrake_lever container add the following values.

Tag name
Description and recomended value
kind
Select the following from the drop down box
lever
auto-create
ensure checkbox is selected
att
If you have the default mesh's directory path added and the attachment points named correctly then the following attachment name should be selectable from the drop down list.
a.trainbrake_lever
limits

Type the following values in the two setting for the limits

0 4
angles

Type the following values in the two setting for the angles

0.698 -0.698
notches

By default CCP only adds one setting. Click the add button to add the remianing sixteen settings and type the following values in the seventeen settings for the notches.

0 0.18 0.22 0.26 0.29 0.3 0.34 0.38 0.42 0.45 0.49 0.53 0.57 0.61 0.65 0.91 1
notchheight

By default CCP only adds one setting. Click the add button to add the remianing sixteen settings and type the following values in the seventeen settings for the notchheight. Always ensure the number of notches and notchheights are a match.

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
radius

Ensure the following is entered into this tag
0.2

att-parent

Ensure the following is entered into this tag
default

Final step

 

 

Using a text file editor

1. Config entries

In the following table the required entries for the interior and a brief description are shown. There are many more possibilities for TRS2004 than what is shown here.

Create a new text document from within your selected text editor and enter the following information.

Config.txt entry Uneditable entries in red Description
kuid <KUID:86105:55999> This is the kuid number. The "86105" should have been already replaced with your user number and the 55999 should also have a default entry. Do not change this number in any way as CMP will not recognize the changes even though you are editing with a text editor.
username Tutorial Interior This is the name that will show up if any errors arise and is TrainzObjectz. Give the interior a meaningful title but keep it short as possible.
kind interior This tells Trainz that the kind is an interior and not a scenery or track item.
category-class ZI This will allow the content to be sorted by the category class. ZI is a train part interior.
category-region-0 US This is the region the locomotive was used in. If there is more than one country required then you can add category-region-1 on the next line.
category-era-0 2000s This is the years that the item is used in. As with the region category you can have more than one.
description "Tutorial on how to create a Locomotive interior" This is a description about the locomotive. It can be brief or very detailed.
cameralist {
  camera0 -0.984,0.332,0.690,0.051,-0.117
}
This is the in cab viewing locations. You can have as many of these as you need
cameradefault 0 This tells TRS which of the above views to use when first entering the cab.

mesh-table {
  default {
    mesh SD70MACBNSF_interior.im
    auto-create 1
  }

This is the mesh table. In this table you can reference items such as animation and other attachments. Animated items can also be controlled via the use of a script.

This is also where you add the setup for levers and gauges

speedo_needle {
  kind needle
  auto-create 1
  mesh Needle.im
  att a.needle0
  limits 0, 50
  angles -0.78525, 0.78525
  att-parent default
}
This is a typical setup for a speedo needle gauge.

bplocomain_needle {
  kind needle
  auto-create 1
  mesh Needle.im
  att a.bplocomain_needle
  limits 0,50
  angles -0.78525, 0.78525
  att-parent default
}

This is a typical setup for a main brake pressure needle gauge.

throttle_lever {
  kind lever

  auto-create 1
  mesh throttle_lever.im
  att a.throttle_lever

  limits 0,8
  angles 0.698, -0.698
  notches 0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1
  notchheight 1,1,1,1,1,1,1,1,1
  radius .2
  att-parent default
}

This is a typical setup for a throttle lever.
reverser_lever {
  kind lever
  auto-create 1
  mesh Reverser_Lever.im
  att a.reverser_lever
  limits 0,2
  angles 0.525, -0.525
  notches 0,0.5,1
  notchheight 1,2,1
  radius .2
  att-parent default
}
This is a typical setup for a reverser lever.

trainbrake_lever {
  kind lever
  auto-create 1
  mesh Automatic_Brake.im
  att a.automatic_brake
  limits 0,4
  angles 0.698, -0.698
  notches 0,0.18,0.22,0.26,0.29,0.3,0.34,0.38,0.42,0.45,0.49,0.53,0.57,0.61,0.65,0.91,1
  notchheight 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
  radius .2
  att-parent default

}

This is a typical setup for a trainbrake lever.
} This bracket closes the entire mesh table. Leaving this out will cause undesirable results.
trainz-build 2.5 This tells the download station which version of Trainz the item is for which in this case is TRS2004 SP2

Once you have the text entered save the file to the root directory of the locomotive. In this case the folder is called Tutorial_Interior and name the file config.txt

NOTE Do not copy and paste from this tutorial.

 

2. Viewing in Trainz

Once you have the config created and saved then it is time to see if our locomotive will show up in Trainz. Before we start trainz up we need to edit the settings in the trainzoptions.txt file. Open the TRS2006 directory and open the trainzoptions.txt file. Enter the following line on its own line

-freeintcam

You could also use TrainzObjects to enter the setting. Save and close the file and then navigate to the tutorial_loco and open the config file. Find the line

interior <KUID:-1:101475>

and change it to

interior <KUID:86105:55999>

Replace the 86105:55999 with the number you have been issued for your interior. Save and close the file and start Trainz up using CMP ensuring you "Commit" the changes to the asset first and then go to surveyor. The loco should be listed as Loco Tutorial. Add the loco to a suitable track location and switch to driver. Switch to the interior view and using the Page Up, Page Down and the arrow keys find a suitable viewing location and either write the values down that appear at the bottom left of the screen or hit the screenshot key. This is the value for the camera list. If you want more than one camera location then continue panning around and writing down the camera locations. When you exit TRS then use CCP to enter the numbers into the cameralist container.

 

3. Settings

Now that we have had a look in trainz and seen that everything works the way it should levers and gauges etc we need to have a closer look at the gauge and lever blocks and see what each line does and how to customize them for your own situation.

speedo_needle { This line is the name of the effect block. In this case it is a default name with predefined actions. If you are using script to control your gauges then you can name this anything you want.
kind needle This tells TRS that it is a needle effect and as such it adopts the needle actions
auto-create 1 This line tells TRS that the object should be created when the rest of the interior is created and should appear without the need for script to make it show up.
mesh Needle.im Name of the mesh file for the needle
att a.needle0 Name of the attachment point for the needle
limits 0, 50 Range of movement steps for the needle. The more steps the smoother the needles movement.
angles -0.78525,0.78525

This is the angular limits of movement in radians. To find these values you need to take the values we calculated in chapter 3. You then need to multiply the values by 0.01745

For example the values we found for the needles were -45 and +45 therefore

45 X 0.01745 = 0.78525 and this value in its positive and negative value are what we add to the config file

att-parent default What the effect is attached to.
} Closing bracket for this effect only.

 

 

throttle_lever { This line is the name of the effect block. In this case it is a default name with predefined actions. If you are using script to control your levers then you can name this anything you want.
kind lever This tells TRS that it is a lever effect and as such it adopts the lever actions
auto-create 1 This line tells TRS that the object should be created when the rest of the interior is created and should appear without the need for script to make it show up.
mesh throttle_lever.im Name of the mesh file for the lever
att a.throttle_lever Name of the attachment point for the lever
limits 0,8

Always equals 1 less than the notch index total
.i.e. Throttle has 9 stops, b limit is 8, reverser has 3 stops, b limit is 2

angles 0.698, -0.698

This is the angular limits of movement in radians. To find these values you need to take the values we calculated in chapter 3 and multiply the values by 0.01745

For example the values we found for the throttle were -40 and +40 therefore

40 X 0.01745 = 0.698 and this value in its positive and negative value are what we add to the config file

If you want the lever to work in reverse then swap these values around.

notches 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 These are the locations that the lever will stop at in each movement. For the throttle there are 9 steps, one for zero and one for each notch 1 though to 8. The values must start at 0 and must not exceed 1. Anything above or below 0 or 1 will be ignored. They do not need to be evenly spaced as long as the number of notches and notchheights match there will be no problems.
notchheight 1, 1, 1, 1, 1, 1, 1, 1, 1 This is the length of the red or green lines that appear when the cursor is places over the lever. It is essential that you have exactly the same number of notchheights as there are notches. Failure to do so will result in an error in the log0.htm file.
radius .2 This is the distance in meters from the levers attachment point that the label will appear
att-parent default What the effect is attached to.
} Closing bracket for this effect only.

 

reverser_lever { This line is the name of the effect block. In this case it is a default name with predefined actions. If you are using script to control your levers then you can name this anything you want.
kind lever This tells TRS that it is a lever effect and as such it adopts the lever actions
auto-create 1 This line tells TRS that the object should be created when the rest of the interior is created and should appear without the need for script to make it show up.
mesh reverser_lever.im Name of the mesh file for the lever
att a.reverser_lever Name of the attachment point for the lever
limits 0,2

Always equals 1 less than the notch index total
.i.e. Throttle has 9 stops, b limit is 8, reverser has 3 stops, b limit is 2

angles 0.525, -0.525

This is the angular limits of movement in radians. To find these values you need to take the values we calculated in chapter 3 and multiply the values by 0.01745

For example the values we found for the throttle were -40 and +40 therefore

30 X 0.01745 = 0.525 and this value in its positive and negative value are what we add to the config file

If you want the lever to work in reverse then swap these values around.

notches 0, 0.5, 1 These are the locations that the lever will stop at in each movement. For the throttle there are 9 steps, one for zero and one for each notch 1 though to 8. The values must start at 0 and must not exceed 1. Anything above or below 0 or 1 will be ignored. They do not need to be evenly spaced as long as the number of notches and notchheights match there will be no problems.
notchheight 1, 2, 1 This is the length of the red or green lines that appear when the cursor is places over the lever. It is essential that you have exactly the same number of notchheights as there are notches. Failure to do so will result in an error in the log0.htm file.
radius .2 This is the distance in meters from the levers attachment point that the label will appear
att-parent default What the effect is attached to.
} Closing bracket for this effect only.
 

4. Final Note

Although we have a working loco interior it is by no means complete and there are many items that can be added and configured using scripting. There are many other types of attachments and they are all listed in the Content Creation Guidelines. Texturing is very basic for the interior and a lot more work is required to bring it up to a releasable product.

This type of interior does not use animated levers. Animated levers require either a collision box or a script to control them.

 

Back to chapter titles

 

 

 

Trainz and Trainz Railroad Simulator are trademarks of Auran

Best viewed at 1024 x 768 or higher

Pages best viewed with Cooper and Cooper Black font installed.

Copyright © 2007 P. Campbell. All rights reserved. Revised: June 13, 2007