CCG/Kind: MOSignal

From TrainzOnline
< CCG(Difference between revisions)
Jump to: navigation, search
(New page: ==KIND: MOSIGNAL== The standard light signals in TRS. ===Config.txt=== kuid <KUID2:####:#####:1> kind "mosignal" mesh-table { default { ...)
 
 
Line 91: Line 91:
 
Looking at the example above, under the heading `signals' we see the states the signal is capable of displaying in the left column. From this extract we can see that this signal is capable of displaying aspects 0, 2 & 4.
 
Looking at the example above, under the heading `signals' we see the states the signal is capable of displaying in the left column. From this extract we can see that this signal is capable of displaying aspects 0, 2 & 4.
  
When aspect 0 (stop) is displayed, light point 7 is activated.
+
:When aspect 0 (stop) is displayed, light point 7 is activated.
  
When aspect 2 (caution left) is displayed, light points 6,0,1,2,3,4 are activated
+
:When aspect 2 (caution left) is displayed, light points 6,0,1,2,3,4 are activated
  
When aspect 4 (caution) is displayed, light point 6 is activated.
+
:When aspect 4 (caution) is displayed, light point 6 is activated.
  
  

Latest revision as of 16:41, 5 June 2011

Contents

[edit] KIND: MOSIGNAL

The standard light signals in TRS.

[edit] Config.txt

kuid                    <KUID2:####:#####:1>
kind                    "mosignal"
mesh-table
{
  default
  {
     mesh               "signalname.im"
     auto-create        1
     effects
     {
      0
      {
        kind            "name"
        fontsize        0.15
        fontcolor       30,30,30
        att             "a.name0"
        name            "name"
      }
    }
  }
}
light                   1
trackside               -2.7
function                "TrackSignal"
region                  "Britain"
username                "my signal"
description             "blah blah"
trainz-build            2.7
category-class          "A"
category-region         "UK"
category-era            "1980s"


[edit] Breakdown:

region
Surveyor region.
light
Sets lighting to be used for object to be ambient or directional. 0 sets ambient lighting and object is lit by general light value (uniform colouring), 1 sets directional light which is affected by the position of the sun (shows shadows on the object surfaces).
trackside
This is a value that is the distance in meters the object is placed relative to the center of the track. Negative value will put the object on the left side of the track, and positive values will appear on the right.
function
Must be set to TrackSignal

Note: All editable signage must use the effect - name set-up when a mesh-table is used. Refer Effects on Page 26.

SIGNALS

The next section of the config explains which aspects the signal is capable of displaying, and also which light points are activated when each state is displayed. The supported aspects are configured by reference number as follows...

0       STOP
1       STOP THEN PROCEED
2       CAUTION AND LEFT DIVERGE
3       CAUTION AND RIGHT DIVERGE
4       CAUTION
5       PROCEED AND LEFT DIVERGE
6       PROCEED AND RIGHT DIVERGE
7       ADVANCED CAUTION
8       PROCEED


The following two aspects are only used for scenarios....

9       SLOW
10      MEDIUM SPEED


The aspect section of the config.txt is arranged as follows.....

     signals
     {
       0
       {
         light 7
       }
       2
       {
         light 6,0,1,2,3,4
       }
       4
       {
         light 6
       }
     }

Note: Don't forget the `space' between the number and bracket, if you are editing by hand in Explorer.

Looking at the example above, under the heading `signals' we see the states the signal is capable of displaying in the left column. From this extract we can see that this signal is capable of displaying aspects 0, 2 & 4.

When aspect 0 (stop) is displayed, light point 7 is activated.
When aspect 2 (caution left) is displayed, light points 6,0,1,2,3,4 are activated
When aspect 4 (caution) is displayed, light point 6 is activated.


Lights

Each light point needs to have a corona associated with it. Coronas are stored in each signal object's directory alongside it's textures. Examples have been packaged within the zip file this document was located.

   lights
   {
     0
     {
       corona    corona_white.tga
     }
     1
     {
       corona    corona_white.tga
     }
     2
     {
       corona    corona_white.tga
     }
     3
     {
       corona    corona_white.tga
     }
     4
     {
       corona    corona_white.tga
     }
     5
     {
       corona    corona_green.tga
     }
     6
     {
       corona    corona_yellow.tga
     }
     7
     {
       corona    corona_red.tga
     }
     8
     {
       corona    corona_white.tga
     }
     9
     {
       corona    corona_white.tga
     }
   }

Note: Don't forget the 'space' or 'new line' between the number and bracket, if you are editing by hand in Explorer.

Looking at the example above, under the heading `lights' we see the light points that are attached to the 3D model. This model has 10 of them, they are named a.light0 to a.light9.

From the signals section we know that when aspect 0 (stop) is displayed, light point 7 is activated.

Looking at the extract above...

When light point 7 is activated, it displays corona red.
When aspect 2 (caution left) is displayed, light points 6,0,1,2,3,4 are activated
When light point 6 is activated, it displays corona_yellow.
When light points 0 ­ 4 are activated, each displays corona_white.

Signal placement is very important for correct operation of the system. There are some rules to consider while signaling your map which if not observed may cause problems with getting the correct aspects to display.

There are also various departures from prototypical operation which should be considered when designing new signaling, and also when installing it into a map.


[edit] Return to CCG Index

Content Creator's Guide

Personal tools