World of Trainz Home Page Shop at World of Trainz Downloads Upcoming Projects Tutorials Forum About Links  
 
   

Reskin Tutorial

Chapter 1 Setting up the config and directories

In this tutorial you will learn how to reskin a rolling stock item.

Note. To complete this tutorial you will need to have available a suitable locomotive or rolling stock item. For this tutorial I have used prjindigo's

SD40-2 and I will be creating a BN green sd40 with BN logos on the front and sides.

 

1. Create a new folder

The first thing we need to do is create a new folder in the xx\World\Custom\trains directory. You can name it anything you like. I usually name the folder with my kuid number first and then a description of the item. For example the BN SD40-2'sfolder is called 86105 9990 BN SD40-2. Using this naming convention allows me to easily search for the item by it's kuid number however the naming of the folder is entirely up to you.

2. Folder contents

Now that we have a folder for the locomotive we need to copy the SD40-2 files into the folder. Navigate to the dispatcher/downloads and find the folder containing the SD40-2 files. In this case it is called kuid2 86105 9989. Select all the files contained in the folder to the new folder you created in the custom/trains directory. It is possible to create a reskin in the dispatcher/downloads directory however it is not recommended..

 

3. Config entries

Here is the contents of a typical config file for a locomotive item

Config.txt entry Description
kuid <KUID2:86105:9990:0> This is the kuid number. Replace the "86105" with your user number and replace the 9990 with a suitable number for your item. The recommended range for a locomotive is 1-9999. Although the kuid range is no longer a requirement I still prefer to keep my numbers within these ranges. The last number represents the version number for the item.
username Loco EMD SD40-2 BN This is the name that will show up in Driver. Give the locomotive a meaningful title but keep it short as possible. This should be used in place of the "name" tag for TRS2004.
company Burlington Northern This is a company name for the item.
origin USA The original country the locomotive was used or created in.
bogey <KUID:-1:100141> This is the kuid number of the bogey file that will be used on the locomotive. I have used one of the default bogey numbers you can change the number to the bogey you want to use but it is possible that the creator has built bogeys that cannot be interchanged.

bogey-1-r <KUID:-1:100141>

This line is only needed if you have more than one type of bogey or if the attachment point has been rotated. The -r means that the animation is reversed.
kuid-table {
0 <KUID:-1:100141>
}
This tells the download station what items are required for the locomotive to work. It can also be used for mesh replacement, texture replacement etc
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
kind traincar This tells Trainz that the kind is a Traincar and not a scenery or track item.
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 This is the years that the item is used in. As with the region category you can have more than one.
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
interior <KUID:-1:101475> This is the interior kuid. This is a required entry and in this case references a default interior
fonts 0 This tells Trainz that there are no running numbers associated with this locomotive.

running-numbers{
}

This tells Trainz what the selected running numbers are. This setting is overridden in surveyor.
description "Burlington Northern SD40-2 Locomotive" This is a description about the locomotive. It can be brief or very detailed.
asset-filename BN-SD40-2 This is the folder that the meshes and the textures are contained in.

mesh-table
{
default
{
mesh BN-SD40-2_body/BN-SD40-2_body.lm
auto-create 1
}
shadow
{
mesh BN-SD40-2_shadow/BN-SD40-2_shadow.im
}
}

This is the mesh table. You will notice that the main mesh tag is pointing to a lm file instead of an .im file. This is beacause this locomotive uses the LOD system to reduce the resources required when the locomotive is viewed from a distance.

In this table you can also 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.

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 smoke attachment. This method of attaching smoke is no longer recommended and the new system is to use the "Twinkles" program to create the effects and attach them in the same way that a mesh object is attached.
obsolete-table {
}
This setting is for previous versions that you want to obsolete.
trainz-build 2.2 This tells the download station which version of Trainz the item is for. In this case it is for TRS2004 with SP2 installed.

4. File names

Now that you have given the item an asset-filename you will need to change all the referenced filenames to suit. Figure 1 shows the main folder with all the required folders and the correct names given to the folders

 

Figure 1 Main folder showing correct names

 

Now that you have the folders named you will need to open each folder and rename the referenced files within. Figure 2 shows the mesh file (.im) correctly named. Whatever you do do not rename the texture.txt files. If you rename the image files (.tge, .bmp) then you will need to open the associated texture.txt file and edit the filename listed within. The texture.txt files are created by either gmax or 3d Studio Max and cannot be renamed.

 

Figure 2 Mesh files including LOD files named correctly

 

You will also need to rename the shadow mesh file and the art files. With the art files you will also need to rename and edit the texture.txt files. The entries contained within tell TRS2004 what the name of the art file is and also where the alpha channel can be found.

Primary=BN-SD40-2_art_512.tga
Tile=st
Hint=Dynamic
Alpha=BN-SD40-2_art_512.tga

 

Figure 3 Art files named correctly

 

Once you have everything renamed and the config.txt file is complete then you can try it out in trainz. If it does not show up then you have either not renamed all the correct files, you have a mistake in the config.txt file or you have referenced dependencies that are not on your computer. It can also be useful to check the TRS2004 error log. It is located in x\Cache\Logs with x being the location where you installed TRS2004.

5. Editing image files

Now that you have the directory correct and hopefully the object shows up in TRS2004 we can begin the editng of the actual image files. To do this you will need a paint program such as Photoshop or Paint Shop Pro. In this case the files to be edited are 6genSD40-2undec.tga and emdheaddetails.tga These are the main files that give the locomotive its color scheme.Every item has at least one tga or bmp file that will need to be edited. The next big problem is finding which part of the texture file is applied to which part of the rolling stock.

6a. Viewing in TOE

Trainz Object Explorer (TOE) is a utility for viewing the mesh files of non default items and will allow you to see the changes you make to the texture files without starting Trainz. TOE can be downloaded from here. Once you have TOE installed and running use TOE to open the BN-SD40-2_body.im file and you should have an undecorated SD40-2.

6b. Viewing in Trainz

If the loco you are reskinning has been exported with the latest Trainz exporters that support bump mapping then TOE will be unable to open and view the files and will have a fatal error or lock up. The only way to view these type of files is in TRS2004 itself.

 

Chapter 2a

Chapter 2b

 

HOME

| DOWNLOADS | UPCOMING PROJECTS | FEEDBACK | TUTORIALS | 3DS, GMAX TIPS | ABOUT | FORUM | SOFTWARE | LINKS

Copyright © 2004 P. Campbell. All rights reserved.

Revised: September 23, 2004
Site questions? webmaster