HowTo/Build a Car for Traffic (stand-alone version)

From TrainzOnline
< HowTo
Revision as of 16:09, 1 June 2011 by Pev (Talk | contribs)

Jump to: navigation, search

Contents

Make the Texture

Firstly, get some photographs or coloured drawings of the car. We must have (or make) a side view, top view, front view and back view. If the two sides are different we should have a left and right side view. Assemble these photos/drawings to make a texture.

Example texture:

Hillman imp red2.jpg

Make the Model Mesh

Then in our modelling program (3DSMax, Blender) attach the texture to a plane and adjust the size so the the side view of the car is full size for the vehicle.

Create our mesh by tracing around the various parts of the car in side view. Be systematic here so we can line up the vertices. Change view to top and join up the vertices with polys to create surfaces.

This is not a lesson in modelling, so sufficient to say that the model mesh should have welded vertices and you only make one half, then mirror it to get the other half.

The model should then be texture mapped and hopefully we end up with a good representation of the pictured vehicle.

Example from Mesh Viewer:

Hillman imp red.jpg


Load Model into Trainz

Trainz has some very specific requirements for traffic and care should be taken to get the correct entries in the config,txt file.

To get our car into the game as a stand-alone item make the asset as follows.

In Content Manager, click on New Asset in the main menu and make a scenery item as a new asset. We can change the kind later if you make a mistake.

The Content Creator Plus utility (CCP) will open a "New Asset" folder in the editing area of Trainz.

Copy the mesh, texture images and texture.txt files to this new folder.(its name doesn't matter).

Then ensure that the asset works and no textures are missing by opening the mesh in a Mesh Viewer (see third party Tools for a download). This step can save some pain later if some thing is missing. Any area that is rendered white has a missing texture,

In CCP, right click on the tree view in the LHS pane and add a "default" mesh container then add the "mesh" and "auto-create" (on) tags. Locate the mesh as prompted by CCP.

Now save and exit from Content Creator Plus. The rest must be done manually as CCP does not support traffic as yet.

Commit the asset into the Game and re-open for edit using Content Manager.

Open the config.txt in NotePad and edit it so that it is as follows.


kuid             <kuid:XXXXX:YYYY>                        ... the kuid set by CCP
username         "One of my Carz for Traffic in TS2010"   ... the name of the asset set by me in CCP
kind             "scenery"                                ... the kind set by CCP
trainz-build     3.3                                      ... trainz build for TS2010 set by CCP
description      "A whopee sedan in red for traffic in TS2010"  .. our description of our car (start and end quotes are required)  
mesh-table
{
  default
  {
    auto-create  1
    mesh         "hillman_imp.im"
  }
  default-night   ........................................... add this if you want lights at night
  {
    mesh         "lights.im"   .............................. your light mesh with head and tail lights
                                                              and perhaps a light beam above the road.
    night-mesh-base   "default"
  }
}
height-range      -10,50        .............................. recommended to have this tag
nightmode         "car"         .............................. the new nightmode setting for traffic 
                                                                if you have lights
trackside         0.01          .............................. the new setting for carz to run on roads
category-era      "1950s;1960s"
category-region   "AU;UK"
author            "MyName"
license           "No restrictions.....blah blah"
contact-email     "me@braenet.com.au" etc for personal details.
thumbnails
{
  0
  {
    image         "$screenshot$.jpg"
    width         240
    height        180
  }
}

Re-commit the car into the game and ensure there are no errors.

The car is now ready to be added to a route or region to become live traffic. Refer to HowTo/Add Carz Traffic to a Route

A more efficient way to have a group of carz on a route is to combine them into a mesh library. This method allows sharing of textures over a number of vehicles. HowTo/Build_a_Car_for_Traffic_(mesh_library_version) describes the extra steps needed to implement this strategy.

Return to How To Index

HowToGuides

Personal tools