3D Studio Max Locomotive Tutorial

Chapter 12 Setting up the Configuration file

Using CCP

Using a text file editor*

 

 

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

*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. You can use Notepad or any other text editor.

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. If you have added a shadow mesh then you can also add another mesh to the mesh-table container. In this case name the container "shadow". Once added use the file navigation button and explorer to select the shadow mesh. No other tags are needed for the shadow mesh so we can move on to the next container.

In the file tree view right click and add the following tags.

company
interior
enginespec
enginesound
hornsound
smoke_shade
smoke_random
smoke_slowlife
smoke_fastlife
smoke_height
smoke_fastspeed
light
description

Also add the following containers.

thumbnails
bogeys

when adding the bogeys container you will be asked for a name for the container. Type in a meaningful name. In this case I have used the following;

front


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
AL - Diesel & Diesel Electric

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 Loco

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
engine This tells Trainz that the item is a locomotive and not a rolling stock item. Ensure the check box is selected.
mass This is the mass of the locomotive in kgs. In this case I have used the following value
50000
company

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

interior

This is the interior file. For this setting I have used an asset included with TRS2006. To add the value for this entry click on the file selection button and in the "KUID Browser window select the following entry.
Gen_sd

enginespec

This is the engines specification file. This is a required entry and in this case references a default engine spec for the SD40-2. Unfortunately the KUID browser is unable to differentiate engine specs from other assets and will display all installed assets. To trim the list down in the top text field type SD40 and wait a few seconds and the list should be reduced to a much smaller selection. You will notice here we are presented with another short coming of the KUID browser. There are three entries all named SD40-2 or similar. The top entry is the correct one. The only way to find out the kind for each entrie is to select it and then click on the "C" button which will return you to CMP. Right click on the asset and select "Edit in Explorer" then open the config.txt file and see what the "kind" tags value is. You could also use CCP to do the same thing however opening more than one instance of CCP may not work correctly. Eventually you will have the following entry for this tag
SD40 2

enginesound This is the engine sound file. For this setting I have used an asset included with TRS2006. To add the value for this entry click on the file selection button and in the "KUID Browser window select the following entry.
emd
hornsound This is the horn sound file. For this setting I have used an asset included with TRS2006. To add the value for this entry click on the file selection button and in the "KUID Browser window select the following entry.
Diesel Horn
smoke_shade 0.3 This is a setting for the diesel smoke attachment. I have used the following value
0.3
smoke_random 2.5 This is a setting for the diesel smoke attachment. I have used the following value
2.5
smoke_slowlife 6 This is a setting for the diesel smoke attachment. I have used the following value
6
smoke_fastlife 0.8 This is a setting for the diesel smoke attachment. I have used the following value
0.8
smoke_height 1.7 This is a setting for the diesel smoke attachment. I have used the following value
1.7
smoke_fastspeed 1.6 This is a setting for the diesel smoke attachment. I have used the following value
1.6
light Sets lighting to be used for object to be ambient or directional. If the checkbox is selected then the lighting is set to directional light which is affected by the position of the sun.

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

 

 

Figure 1 Additional tags with their default values

 

Figure 2 KUID browser showing interior assets

 

Figure 3 KUID browser using search feature

 

Now that we have all the standard tags added for the locomotive we can customize the remaining two containers. Select the front subcontainer of the bogey container and use the file navigation button and explorer to select the following value

gp38_bogey

Only select the reversed checkbox if you want the bogey animation to run in reverse.
For the thumbnails container we need to create a new folder called Tutorial_images and place the consist images in the folder. The art_512 image is no longer supported in TRS2006 so it can be deleted. (For the creation of these images see one of these tutorials Photoshop, Paint Shop Pro)
Now we need to point the file navigation button and explorer of the first image to the tutorial_art_icon.tga in the Tutorial_images folder. Once complete type 128 into the width text box and 24 into the height textbox.

Final step

 

 

 

Using a text file editor

1. Config entries

In the following table the required entries for the locomotive 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:15000> This is the kuid number. The "86105" should have been already replaced with your user number and the 15000 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.
trainz-build 2.5 This tells the download station which version of Trainz the item is for.
category-class "AL" This will allow the content to be sorted by the category class. AL is a Diesel and Diesel Electric locomotive.
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 "1970s;1980s;1990s;2000s" This is the years that the item is used in. As with the region category you can have more than one.
username Loco Tutorial This is the name of the locomotive.
kind traincar This tells Trainz that the kind is a Traincar and not a scenery or track item.
engine 1 This tells Trainz that the item is a locomotive and not a rolling stock item.
mass 50000 This is the mass of the locomotive in kgs
company Tutorial This is a company name for the item.
interior <KUID:-1:101475> This is the interior kuid. This is a required entry and in this case references a default interior
enginespec <KUID:-1:42004231> This is the engine spec file. This file is included with Trainz and it is the engine spec file for a GP38-2
enginesound <KUID:-1:42003000> This is the engines sound file kuid. This is a required entry and in this case references a default engine sound
hornsound <KUID:-1:42003101> This is the horn sound file kuid. This is a required entry and in this case references a default horn sound
smoke_shade 0.3
smoke_random 2.5
smoke_slowlife 6
smoke_fastlife 0.8
smoke_height 1.7
smoke_fastspeed 1.6
This is the settings for the diesel smoke attachment.
light 1  
description "Tutorial on how to create a sample Locomotive" This is a description about the locomotive. It can be brief or very detailed.

mesh-table {
  default {
    mesh Tutorial_body/Tutorial_body.im
    auto-create 1
  }
  shadow {
    mesh Tutorial_shadow/Tutorial_shadow.im
  }
}

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 coronas and set up the night mode mesh etc.

bogeys {
  front {
    reversed 0
    bogey <kuid:-10:175>
  }
}
This line is only needed if you have more than one type of bogey or if you rotated the attachment point. The -r means that the animation is reversed.
thumbnails {
  0 {
    image "tutorial_images/Tutorial_art_icon.tga"
    width 128
    height 64
  }
}
 

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

NOTE Do not copy and paste from this tutorial.

 

2. Viewing in Trainz

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. You should have a result similar to the following.

 

 

Figure 4 Final result as viewed from within TRS2006

 

3. Final Note

Although we have a working loco it is by no means accurately built to any drawing and there are many items that are not built as they would be on a real locomotive. Items such as the height of the cab and main body, fuel tank height, overall dimensions etc. are not built to any dimensions and are more than likely incorrect.

 

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