Traincar

File location: ...\Trainz\World\Custom\Trains\

A ‘traincar’ is a rolling stock (freight car, passenger car or locomotive) asset. One of the main features of TRS2004 is that traincars, (namely rolling stock), can now have the ability to transport commodities (products) and to interact with compatible industry assets.
As there are a range of products and product categories, each rolling stock type is set up differently to accommodate the load type both visual representation and through it’s config.TXT file For this reason we have made available individual downloads for the various rolling stock types on Page 36

Typical Directory Structure for a custom Traincar Engine type should be:

World\
Custom\
Trains\
Custom_Traincar\
Custom_Traincar_Art\
traincar_art_512.TGA (512x512 32-bit.TGA)
traincar_art_512.texture.TXT
traincar_icon_art.TGA (128x32 32-bit.TGA)
traincar_icon_art.texture.TXT
Custom_Traincar_Body\
config.TXT
custom_traincar.IM
x.TGA (16-bit)
y.BMP (8-bit grayscale opacity map - if required)
env_metal.BMP (16-bit color environment/reflection map)
*.texture.TXT
digit_1.TGA (24-bit)
Custom_Traincar_Shadow\
custom_traincar_shadow.IM
black.TGA
black.texture.TXT
Custom_Traincar_Alpha_Numbers\
alphanumber_0.TGA (to alphanumber_9.TGA)(32-Bit)
Refer: Locomotive Numbering

Config.TXT File Example for a Traincar -- Engine

kuid <KUID:####:#####>
kind
traincar
origin
AU
company
Queensland Rail
name
Electric Loco

engine 1
bogey
<KUID:####:#####>
bogey-1 <KUID:####:#####>
bogey-2-r <KUID:####:#####>
pantograph <KUID:###:#####>
interior <KUID:####:#####>
enginespec
<KUID:####:#####>
enginesound <KUID:####:#####>
hornsound <KUID:####:#####>
mass 37000
fonts 2
running-numbers

{
   rn-0 #104420
   rn-1 #104427
   rn-2 #104430
   rn-3 #104452
}

kuid-table
{
}

obsolete-table
{
}

mesh-table
{
   default
   {
      mesh Loco_Body/loco_body.LM
      auto-create 1
   }
   shadow
   {
      mesh Loco_Shadow/loco_shadow.IM
   }
   fan1
   {
      mesh Loco_Body/Fan/fan.IM
      anim Loco_Body/Fan/fan.KIN
      auto-create 1
      att a.fan0
      att-parent default
      animation-loop-speed 1.0
   }
   fan2
   {
      mesh Loco_Body/Fan/fan.IM
      anim Loco_Body/Fan/fan.KIN
      auto-create 1
      att a.fan2
      att-parent default
      animation-loop-speed 1.0
   }
   default-night-forward
   {
      mesh Loco_Body/Night/night.IM
      auto-create 0
      att a.bog0
      att-parent default
   }
}

smoke_shade 0.3
smoke_random 2
smoke_slowlife 1
smoke_fastlife 6
smoke_height 7
smoke_fastspeed 4
smoke0
{
   attachment a.exhaust0
   mode speed
   enabled 1
   maxspeedkph 120
   filelospeed.TFX
}
smoke1
{
   attachment a.exhaust1
   mode speed
   enabled 1
   maxspeedkph 120
   filehispeed.TFX
}

description “ “
trainz-build 2.0
category-class AC
category-region-0 AU
category-era-0 1970s
category-era-1 1980s
category-era-2 1990s
category-era-3 2000s

TAGS DESCRIPTIONS
origin Country
company Rolling stock owner
mass Mass in kilograms
bogey Bogey KUID number (default for a.bog0 and a.bog1) Refer: Bogey
bogey-1 Bogey KUID number for a.bog1 (Used only if different to a.bog0)
bogey-r and bogey-1-r Used instead of bogey and bogey-1. The bogey will have reversed orientation.
Note: This will cause bogey animation to play in reverse
pantograph Pantograph KUID number inserted at a.pant0, a.pant1, etc. Use this tag only when needed. Refer: Pantograph
interior Cab KUID number of the required interior. Inserted at a.cabfront. Use this tag only when needed (e.g. Locomotive) Refer: Interior
engine States traincar type

0 Car/Wagon

1

Loco
fonts
Indicates how many types of numbering fonts used.
  0  = no fonts used
  1  = one font
Digit textures (digit_1.TGA to digit_6.TGA) replaced automatically with alphanumber textures (alphanumber_0 to alphanumber_9) as numbers are changed via the Surveyor Trains tab - ‘Edit Properties’ icon (the ‘?’ icon).
  2  =two fonts
Digit textures (digit_1a.TGA to digit_6a.TGA and digit_1b.TGA to digit_6b.TGA) replaced automatically with alphanumber textures (alphanumber_0a to alphanumber_9a and alphanumber_0b to alphanumber_9b)as numbers are changed via the Surveyor Trains tab - ‘Edit Properties’ icon (the ‘?’ icon).
running-numbers The default numbers viewed before being changed in My Collection. Generally Auran uses 4 variations of numbers (up to 6 digits each).
Note: This tag not required if fonts 0 is used.
enginespec Engine KUID number. This specifies the driver physics boundaries for the traincar. Located in ...\Trainz\Engines\
WARNING: ALTERING ENGINESPECFIGURES MAY RESULT IN UNDESIRED EFFECTS IN PERFORMNACE AND BEHAVIOR OF YOUR TRAINS. (MAKE BACK-UP COPIES OF YOUR ENGINE CONFIG.TXT FILES!)
enginesound Sound KUID number for a traincar. Custom sounds to be located in ...\Trainz\world\custom\enginesound\ Refer: Enginesound
hornsound Hornsound KUID number for a traincar. Custom horn sounds to be located in ...\Trainz\world\custom\hornsound\ . Refer: Hornsound
smoke0 Sets boundaries for smoke, steam, vapor and similar effects. Refer: Smoke Effects
description Description of model for Railyard information
light_color RGB headlight color. E.g. 255,255,255
ditch_color RGB ditch color. E.g. 255,255,255

Locomotive Numbering:

TRS2004 supports dynamic locomotive numbering for custom content (using alpha-numbers). Otherwise known as ‘running numbers’..

Digits are modeled as 6 individual rectangular polygons offset from the face of the Loco body (about 5mm). Digit polygons must be texture mapped using the correct texture naming and alpha-number naming conventions as follows:

If one font type used:

Digit textures (digit_1.TGA to digit_6.TGA) are replaced automatically with alpha-number textures (alphanumber_0 to alphanumber_9).

If two or more font type used:

Digit textures (digit_1a.TGA to digit_6a.TGA and digit_1b.TGA to digit_6b.TGA, etc.) are replaced automatically with alpha-number textures (alphanumber_0a to alphanumber_9a and alphanumber_0b to alphanumber_9b).

Locomotive numbering in TRS2004 is edited in Surveyor: Trains panel (Train mode) - Edit Properties (the ‘?’ icon).

Refer to Source Files for configuration of Loco Numbering digit's

 

Config.TXT File Example for a Traincar -- Box Car

kuid 100085
kind traincar
engine 0

bogey 100073
enginespec
<KUID:-1:42004201>

name PRR 40'Boxcar
mass 20775
company Pennsylvania Railroad
origin No.Amer.

queues
{
   load
   {

      size 7
      initial-count 0
      product-kuid <KUID:-3:10013>
      allowed-products
      {
         0 <KUID:-3:10013>
      }
   }
}

description "

40Ft Freightcar - Box Car Class X 43A

Company: Pennsylvania Railroad (PRR)

Length: 44'4 (coupled)
Length: 41'10 (over strikers) 
Length: 30'10 (btwn truck centers)
Wheelbase: 5'6 (truck)
Height: 15'0,5/16 (overall)
Height: 11'0,1/16 (inside at center)
Height: 10'6 (inside at eaves) 
Width: 9'9 (over side sills) 
Width; 9'2,1/16 (inside)
Door: 7'0 wide, 9'10,3/4 high (clear opening)
Weight: 45,800 Lbs 
Capacity: 100,000 Lbs 
Capacity: 3,898 cubic ft."

trainz-build 2.0
category-class XGB
category-region-0 US
category-region-1 CA
category-era-0 1940s
category-era-1 1950s
category-era-2 1960s
category-era-3 1970s

 

Config.TXT File Example for a Traincar -- Tank Car

kuid <KUID:-3:10035>
kind traincar
engine 0

bogey 100080
enginespec <KUID:-1:42004201>

origin TRS2004
name GATX Oil Tanker
mass 11000
company Oily Rag & Co

script "GATX_oilco"
class "GATX_oilco"

queues
{
   load
   {
      size 38800
      initial-count 0

; Allows crude oil, aviation fuel, diesel fuel &
; petrol fuel - can't use a petroleum tank car
; to transport other liquids like water or milk
      allowed-products
      {
         0 <KUID:-3:10010>
         1 <KUID:-3:10045>
         2 <KUID:-3:10011>
         3 <KUID:-3:10012>
      }
   }
}

mesh-table
{
   default
   {
      auto-create 1
      mesh GATX_Oilco_Body/GATX_oilco_body.LM
      effects
      {
         pipe-attachment-left
         {
            kind attachment
            att a.loaderL
         }
         pipe-attachment-right
         {
            kind attachment
            att a.loaderR
         }
      }
   }
   shadow
   {
      mesh GATX_Oilco_Shadow/GATX_oilco_shadow.IM
   }
}

description "
length: 37'4
width: 9'8
height: 13'9
truck wheelbase: 5'6
truck pivot centres: 27'2"

trainz-build 2.0
category-class XT
category-region-0 US
category-region-1 CA
category-era-0 1940s
category-era-1 1950s
category-era-2 1960s
category-era-3 1970s

 

Config.TXT File Example for a Traincar -- Hopper Car

kuid <KUID:44179:60006>
kind traincar
engine 0

bogey 100063
enginespec
<KUID:-1:42004201>

name "Hopper"
mass 15000
company MAM
origin TRS2004

script "Hopper"
class "Hopper"

soundscript

   door_close
   {
      trigger
door_close
      nostartdelay 1
      repeat-delay 1
      distance 5, 170
      sound
      {
        
coupling_1.wav
      }
   }
}

mesh-table
{
   default
   {
      mesh
Coal_Hopper_Body/coal_hopper_body.LM
      auto-create 1
   }
   shadow
   {
      mesh
Coal_Hopper_Shadow/coal_hopper_shadow.IM
   }
   load
   {
      mesh
Coal_Hopper_Body/Load/load.IM
      anim Coal_Hopper_Body/Load/load.KIN
      auto-create 1
      use-parent-bounds 1
      effects
      {
         product-texture
         {
            kind
texture-replacement
            texture "load_map.texture"
         }
      }
   }
   left-door
   {
      mesh
Coal_Hopper_Body/Unload_left/unload_left.IM
      anim Coal_Hopper_Body/Unload_left/unload_left.KIN
      auto-create 1
   }
   right-door
   {
      mesh
Coal_Hopper_Body/Unload_right/unload_right.IM
      anim Coal_Hopper_Body/Unload_right/unload_right.KIN
      auto-create 1
   }
}

queues
{
   load0
   {
      size
54300
      initial-count 0
      animated-mesh load
      product-kuid <KUID:44179:60013>
      allowed-categories
      {
         0
<KUID:-3:10040>
      }
   }
}

smoke0
{

; "vehicle unload" particle effect
   attachment a.unload_left_pfx0
   mode time
   color 0,0,0,250
   rate 8
   velocity 2
   lifetime 2
   minsize 1
   maxsize 4
   enabled 0
}
smoke1
{
; "vehicle unload" particle effect
   attachment a.unload_left_pfx1
   mode time
   color 0,0,0,250
   rate 8
   velocity 2
   lifetime 2
   minsize 1
   maxsize 4
   enabled 0
}
smoke2
{
; "vehicle unload" particle effect
   attachment a.unload_right_pfx0
  mode time
   color 0,0,0,250
   rate 8
   velocity 2
   lifetime 2
   minsize 1
   maxsize 4
   enabled 0
}
smoke3
{
; "vehicle unload" particle effect
   attachment a.unload_right_pfx1
   mode time
   color 0,0,0,250
   rate 8
   velocity 2
   lifetime 2
   minsize 1
   maxsize 4
   enabled 0
}

description "
Coal Hopper

Length (over coupler): 12.4m 
Width (overall): 2.8m 
Height (overall): 3.9m 
Bogie pivot centres: 7.4m
Bogie Wheelbase: 1.6m"

trainz-build 2.0
category-class XHB
category-region-0 US
category-region-1 CA
category-era-0 1940s
category-era-1 1950s
category-era-2 1960s
category-era-3 1970s

ANIMATED HOPPER LOADING EXAMPLE

This is how Randall White [whitepass/58422] did the coal load animation for the 2-bay hopper. First GMax must be in meters and have the car done. I had a load and cut it into two meshes while it was at the top. Next, move the load to the bottom of the car so it fits then move the two loads to about -200 meters and link.

 

Config.TXT File Example for a Traincar -- Flat Car

kuid <KUID:-3:100878>
kind traincar
engine 0

bogey 100821
enginespec <KUID:-1:42004201>

name Container Flat Car 
company TRS
origin TRS2004
mass 50000

mesh-table
{
   default
   {
      mesh
Container_Flat_Body/container_flat_body.LM
      auto-create 1
   }
   shadow
   {
      mesh Container_Flat_Shadow/container_flat_shadow.IM
   }
}

queues
{
   load0
   {
      size 1
      initial-count 0
      attachment-points
      {
         0 a.load0
      }
      allowed-products
      {
         0 <KUID:-3:10041>
       }
      conflicts-with-queues
      {
         0 load1
         1 load2
      }
   }
   load1
   {
      size 2
      initial-count 0
      attachment-points
      {
         0 a.load1
         1 a.load2
      }
      allowed-products
      {
         0 <KUID:-3:10003>
         1 <KUID:-3:10014>
      }
      conflicts-with-queues
      {
         0 load0
         1 load2
      }
   }
   load2
   {
      size 8
      initial-count 0
      attachment-points
      {
         0 a.gen_goods0
         1 a.gen_goods1
         2 a.gen_goods2
         3 a.gen_goods3
         4 a.gen_goods4
         5 a.gen_goods5
         6 a.gen_goods6
         7 a.gen_goods7
      }
      allowed-products
      {
         0 <KUID:-3:10013>
      }
      conflicts-with-queues
      {
         0 load0
         1 load1
      }
   }
}

description "
Container Flat Car"

trainz-build 2.0
category-class XFC
category-region-0 US
category-region-1 CA
category-era-0 1940s
category-era-1 1950s
category-era-2 1960s
category-era-3 1970s

Content Creation Guide Table of Content

Paint Shed Guide