User:Fabartus/temp3

Basics of reskinning
Trainz has three basic parts to a model or asset. The first is the mesh or shape, the second is the texture file (.bmp or .tga), and the third part comprises text documents, such as config.txt and scripts. You can modify the texture files and connecting text files fairly easily to change the appearance of the asset, a process known as re-skinning, the goal of this tutorial. Re-skinning is a fairly easy way to get started in asset creation for your layout. Be aware you need to respect copyright laws and you will need the mesh creator's permission before distributing the new asset (i.e., uploading to the DLS).
 * Also, understand that different types of texture files have slight differences; some file types have more options than others. Some assets have a greater impact on Trainz performance than others. Since we can select which asset to reskin, as a beginner select assets with a single .bmp or .tga texture file.


 * This tutorial will take you through the steps to do a simple reskin. The tutorial uses TRS2009 CM2 because this version of Trainz does a lot more error checking than previous versions and this will help you to avoid errors, and it's data types and organization is the basis for the following two versions of Trainz as is documented in the technical references.

Step 1 - Clone the asset
To begin, you need something to work on or with. Which ever version of Trainz you are working with, and whatever graphics and text editor software you may prefer, the steps in the dance are the same.

Trainz to TRS2004
The file storage methods in Trainz, UTC, and even the highly popular TR04 was structured on an assets root file folder being named after the asset's kuid (excepting map files which were by the name of the route&mdash; e.g. a real example: C:\Auran\TRS2004\World\Custom\profiles\kuid -2 14476891 a session on the map: C:\Auran\TRS2004\World\Custom\maps\HVI-2014-1011m0).

Added content will be found in the ..\World\Custom folder hierarchy and will have to be sought out using the Windows search capabilities. Once the folder is located, it must be copied to a working location, which is easy to remember and keep straight; we suggest the installs root directory or set up an ..\editing folder under that installs root folder like the TR06–TS09-SP3's folder hierarchy. TS09-SP4–TS12-SP2 have the editing folder built in under the ..\UserData folder off the root. At that point you will need to both rename the (kuid based) folder name and edit the kuid to your identification and sequence number you wish to assign the asset (i.e. A unique kuid for the asset you are cloning by finishing this step).

TRS2006 to TS2012
To clone an asset in '06 or TC3 use CMP in a similar manner to the TS2009 description, in TRS2004 access the asset folder (Auran/TRS2004/World/Dispatcher/downloads/asset kuid) and copy the folder. Open the copied folder, open the config.txt file and change the assets kuid number to one with your own ID prefix. Be sure not to duplicate an existing kuid number of yours. Open the config. file and change as appropriate the description, author, licence, e-mail address and web address. Be careful not to change any other data. Save and close the config.txt. file. Now edit the asset folder's kuid number to the one you used in the config.txt. file.

In TRS12 you need only select the asset by right-clicking on it in Content Manager. Select 'edit' from the drop down menu, then 'Edit in Content Creator Plus'. This brings up an editable form that will save a new config.txt file for you. You may alter the fields in the form as appropriate. Note that some fields are determined by changes you make in the editable fields, making it easy to complete this step without mistakes (errors and warnings appear in the bottom panel).

Step 1 Clone the Asset in CM
We'll start with a simple sign that uses a .bmp texture file:   and step one is to clone the asset in Content Manager. Note this asset, a simple sign (classed as is  (TB); so it doesn't require any more complicated features of other  or the adjustments needed to make the asset compatible with some of the later TB versions of Trainz. Right click the asset and click on clone. (For TRS 2004 see above, second paragraph; meaning what??? in TC3 through Trainz12 you'll see an error message informing you that the asset uses an obsolete trainz-build number (numbers below 2.7 are not supported. However, TS09-SP4 up through the TS12's will correctly overcome this programmer's nag limitation when you commit your new asset).

Step 3- edit in corrections
Having cloned the asset we now need to edit it. Go to the Open for Edit tab, right click. (TRS 2004 users, open cloned folder). In Trainz12, right click on the new asset (note a new kuid has been assigned with your ID prefix). Then and select''. ''

Image:Edit in explorer
This opens up a Windows folder containing the asset. We now want to edit the .bmp file using GIMP

Image:Edit with GIMP
Note the two panels one for the image and one containing the tools.

Image:Edit with GIMP1


Just below the image is the scale, for ease of use raise this to 400% and increase the window size of the panel. Use the eye dropper tool to pick up the background colour then the paint brush to remove the existing lettering.

Image:Edit with GIMP2
GIMP is particularly strong in adding lettering. Note the background / foreground colour squares click on the curved arrow to reverse these to get white lettering. Click on the lettering tool, the letter "A" and select a font, "Gill Sans MT Bold" is fairly useful.

Image:Edit with GIMP3
Left click with the mouse at the top left hand corner then enter the desired text. It is possible to change the font size before clicking on close.

Image:Edit with Gimp4

 * To position the text type "M" then click on "Move the active layer"

Image:Edit with Gimp5


Save the file (after reading through the below first!), but don't close it's window nor quit the Graphics program.

Checks and Caveats on Saved images
''If you started with a then the saving process is slightly different. First note the file size of the original .tga file. Then when you save ensure that RLE compression is unchecked.''

Next
''Compare the file sizes between the original and the new texture file.
 * If your new edited file is smaller then you need to double check you have RLE compression off.
 * If your edited file is roughly 33% larger than the original you need to verify you do not have an alpha channel.
 * Correct this by re-editing the file, then delete any alpha masks from the copy by clicking Layer, Mask, and Delete Layer Mask, then save again.''

Image:Edit with Gimp6


Go to your and now edit the config.txt file.

Now edit the  file in a basic text editor such as Notepad++. (See introductory paragraph on cloning in TRS2004 for details on editing the  file)

Click to select in CM2 and commit (TRS 2004 users simply make sure that the   file is saved, close the asset folder and back out of the Trainz folder.)

Lastly, Test it
Bring up in Surveyor. Place your new asset on a map somewhere and give it a critical look over from every angle. Use to enter walk-around mode and give it a close inspection from the ground level.