HowTo/Implement a Destination Sign System

From TrainzOnline
< HowTo(Difference between revisions)
Jump to: navigation, search
(first edit)
 
Line 11: Line 11:
  
 
These work by script controlled texture replacement so the format and config.txt are important.
 
These work by script controlled texture replacement so the format and config.txt are important.
 +
  
 
Motorman1066's trams all share the same destination boards for Brisbane kuid:xxxxxxxxxxx and these are read into the tram script and provide an option selection from the properties button in surveyor. (more on this later)
 
Motorman1066's trams all share the same destination boards for Brisbane kuid:xxxxxxxxxxx and these are read into the tram script and provide an option selection from the properties button in surveyor. (more on this later)
 +
  
 
To use this process on another route, eg Surfside Trams, a different set of destination signs is needed.
 
To use this process on another route, eg Surfside Trams, a different set of destination signs is needed.
 +
  
 
An asset with set of textures for the Gold Coast was built by cloning and editing motorman1066's Brisbane ones.  In his case each texture has a destination name and route number.  The two bits of data are separated by texture mapping and displayed on the destination sign and the route number sign as below.
 
An asset with set of textures for the Gold Coast was built by cloning and editing motorman1066's Brisbane ones.  In his case each texture has a destination name and route number.  The two bits of data are separated by texture mapping and displayed on the destination sign and the route number sign as below.
  
insert pheonix tram pic.
+
 
 +
[[File:Dest_Phoenix_PEV.jpg]]
 +
 
  
 
Each texture looks as below.
 
Each texture looks as below.
  
insert texture pic.
+
 
 +
[[File:Dest_sign_sample_PEV.jpg]]
 +
 
  
 
In this case the boards are backlit at night with a white night mesh so the white text is transparent.
 
In this case the boards are backlit at night with a white night mesh so the white text is transparent.
Line 52: Line 59:
 
  textures
 
  textures
 
  {
 
  {
   0                "Blank.texture"
+
   0                "Blank.texture"               [[File:Dest_texture0_PEV.jpg]]
   1                "dest0.texture"
+
   1                "dest0.texture"               [[File:Dest_texture1_PEV.jpg]]
   2                "dest1.texture"
+
   2                "dest1.texture"               [[File:Dest_texture2_PEV.jpg]]
   3                "dest2.texture"
+
   3                "dest2.texture"               [[File:Dest_texture3_PEV.jpg]]
   4                "dest3.texture"
+
   4                "dest3.texture"               [[File:Dest_texture4_PEV.jpg]]
   5                "dest4.texture"
+
   5                "dest4.texture"               [[File:Dest_texture5_PEV.jpg]]
   6                "dest5.texture"
+
   6                "dest5.texture"               [[File:Dest_texture6_PEV.jpg]]
   7                "dest6.texture"
+
   7                "dest6.texture"               [[File:Dest_texture7_PEV.jpg]]
   8                "dest7.texture"
+
   8                "dest7.texture"               [[File:Dest_texture8_PEV.jpg]]
   9                "dest8.texture"
+
   9                "dest8.texture"               [[File:Dest_texture9_PEV.jpg]]
 
  }
 
  }
 
  category-class      "JO"
 
  category-class      "JO"

Revision as of 20:18, 22 August 2013

Introduction

This document was inspired by the release from NormP of Surfside Trams 2 for TS12. This is a fictional route with tramways on the Gold Coast in Australia. The Gold Coast is near Brisbane where trams were used up to 1972.

The Brisbane trams modelled by motorman1066 seemed appropriate to use on the route, so were added and the destination boards for Brisbane appeared for use the sessions. A set of destination boards was made for the Surfside Trams route, and this document details the steps required to get them to work.


The Destination Boards

These work by script controlled texture replacement so the format and config.txt are important.


Motorman1066's trams all share the same destination boards for Brisbane kuid:xxxxxxxxxxx and these are read into the tram script and provide an option selection from the properties button in surveyor. (more on this later)


To use this process on another route, eg Surfside Trams, a different set of destination signs is needed.


An asset with set of textures for the Gold Coast was built by cloning and editing motorman1066's Brisbane ones. In his case each texture has a destination name and route number. The two bits of data are separated by texture mapping and displayed on the destination sign and the route number sign as below.


Dest Phoenix PEV.jpg


Each texture looks as below.


Dest sign sample PEV.jpg


In this case the boards are backlit at night with a white night mesh so the white text is transparent.

The Surfside destination boards are a small set with only 10 destinations. Here is the complete config.txt.

kuid                <kuid:XXXXXX:YYYYYY>
username            "SurfSideDestsignTextures"
kind                "texture-group"
trainz-build        2.9
  
extensions
{
  destnames-000000
  {
    0               "BLANK"
    1               "SEA WORLD DEPOT"
    2               "SEA WORLD"
    3               "CAVILL AVE"
    4               "SURFERS PARADISE"
    5               "PRIMARY SCHOOL"
    6               "BUNDALL"
    7               "SOUTHPORT POOL"
    8               "PACIFIC FAIR"
    9               "PACIFIC FAIR DEPOT"
  }
}
  
textures
{
  0                 "Blank.texture"                Dest texture0 PEV.jpg
  1                 "dest0.texture"                Dest texture1 PEV.jpg
  2                 "dest1.texture"                Dest texture2 PEV.jpg
  3                 "dest2.texture"                Dest texture3 PEV.jpg
  4                 "dest3.texture"                Dest texture4 PEV.jpg
  5                 "dest4.texture"                Dest texture5 PEV.jpg
  6                 "dest5.texture"                Dest texture6 PEV.jpg
  7                 "dest6.texture"                Dest texture7 PEV.jpg
  8                 "dest7.texture"                Dest texture8 PEV.jpg
  9                 "dest8.texture"                Dest texture9 PEV.jpg
}
category-class      "JO"
category-era        "1940s;1950s;1960s"
category-region     "AU"
description         "Destination signs for Normp's Surf-Side Trams.
                     Derived from destination boards for Motorman1066 Brisbane trams.
                     Developed from an original concept created by Peter Denhert."
author              "motorman1066 amended by PEV"
license             "etc"
organisation        "Selz Tramz Workshopz 2006"
   
thumbnails
{
  0
  {
    image           "destination sign 240.jpg"
    width           240
    height          180
  }
}


Note the kind must be "texture-group" and category class must be "JO" (Other Textures). Also note the sub-container name in the "extensions" container. It must start with lower case "destnames-" as shown above. Put your own user

ID number after it.

The tram script generates a selection table which shows the items listed in the "extensions" container as destination board options. Selecting from the list chooses the texture of the same number. So, from the above config.txt, texture 1 (dest0.texture) is SEA WORLD DEPOT

and so on.


Tram Car (or loco) Requirements

In this case the trams were cloned from motorman1066's assets and the names changed to represent use by me on Surfside Trams route. The

kuid-table is changed so that the asset for new destinations is included. See below:

The tram cars must be built to support texture replacement on the destination sign. The config.txt must have effects container named

"destsign" in the mesh table as below.

mesh-table
{
 default
 {
   mesh                                "554 body/554 body.lm"
   auto-create                         1
   
   effects
   {
     destsign
     {
       kind                            "texture-replacement"
       texture                         "texture dest.texture"
     }
   }
 }
etc

The "texture dest.texture" is a blank sign the same as the blank in the destination sign asset. It is located in the same folder as the parent

mesh (in this case the 554 body folder.)

Additionally the kuid-table of the tram config.txt must have an entry "destsigntextures" which calls the kuid of the destination sign asset

above.

The tram assets in this case have a script (tram.gs) of class called "Tram". The script from Peter Denhert provides the interface to select

destinations in Surveyor and to communicate with the "Change Destination Sign To" rule (insert pic) allowing destinations to be changed by the

driver AI.


Using the Destination Sign System

Firstly we add the DestsignTable Rule to the Session (or route, depending on layer setting). We can choose to be in the session layer to make

the sessions more flexible.

Press the Edit Session Rules Button (insert pic) at the top left of the surveyor screen.

The Edit Session window will appear. insert pic Press the Add button to add a rule to the session.

The selection box for Rules will appear. insert pic Scroll down to find and select the "DestSignTable" rule. This rule searches the session and route assets for kind "texture-group" assets and

build a table of such assets. It also adds the "Change Destination to" (insert pic) to the driver command menu.


Select the "DestSignTable" rule from the Edit Session Rules box and Press the Edit Button. The Rule properites are displayed. insert pic Ensure that Enable industries/station as destination and Enable trackmarks as destinations are not enabled and that Enable table of

destinations is selected as shown.

Click on "Import destinations from texture-group". The "Select texture-group" box will be displayed. insert pic Select the appropriate texture group.. in this case "SurfSideDestTextures".

A list of destinations will be added as below. insert pic

This completes the set up of the "DestSignTable" rule; we can now add trams to our session.



When we have placed the tram car on a track in Trainz Surveyor, press the properties button in the rolling stock tab. insert pic and left click on the tram. The tram properties window appears where we can add a running number and enable our destination list.

The circled text is the name of the texture-group for our destination sign. If the texture group is incorrect, left click on the text and

"Select texture-group" box will appear allowing us to change the texture group to "SurfSideDestsignTextures" as previously. insert pic

We can also select a destination sign immediately if desired by left clicking Destination text as shown. The Destination selection box is displayed allowing us to choose an appropriate destination. insert pic 11

The Driver AI can be used to change destination signs at any time. Click on the green arrow to insert a driver command. From the menu choose

"Change Destination To" and select a destination from the drop down menu. insert pic 12

The destinations can change automatically at the appropriate loacation with this driver command. Mouse over it to find the new destination

when in Driver.

Personal tools