CCG/Kind: MOCrossing

From TrainzOnline
< CCG
Revision as of 17:35, 5 June 2011 by Pev (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

KIND: MOCROSSING

This is an example level crossing consisting of script animated boom gates, and flashing lights, however, only the config.txt entries are discussed here. Some duplicate entries in the config.txt file for the corona effects are not shown to conserve space.

Note that an animated mocrossing can be created without the use of scripts, the animation being triggered automatically by a train. Animation events may also be linked to an animation key-frame to give control over effect and script timing.

CCG mocrossing.jpg

The track and road types are specified in the attached-track and the meshes are within the mesh-table. An invisible road KUID may be useful for this type of model.

Config.txt:

 kuid                 <KUID2:######:######:1>
 light                1
 kind                 "mocrossing"
 trainz-build         2.7
 category-region      "AU"
 category-era         "1980s"
 region               "Australia"
 class                "modular_xing"
 script               "xing.gs"
 KUID-table {
        corona_red    <KUID:-3:10112>
        road          <KUID:###:####>
 }
 mesh-table {
        default       
        {
          mesh        "road.im"
          anim        "boomgates.kin"
          auto-create 1
          effects 
          {
            pole1-light1
              {
                kind  "corona"
                att   "a.pole1-lamp0"
                texture-kuid <KUID:-3:10112>
              }
            pole1-light2
              {
                kind  "corona"
                att   "a.pole1-lamp1"
                texture-kuid <KUID:-3:10112>
              }
            boom1-light1
              {
                kind  "corona"
                att   "a.boom1-light0"
                directional 0
                texture-kuid <KUID:-3:10112>
              }
            boom1-light2
              {
                kind  "corona"
                att   "a.boom1-light1"
                directional 0
                texture-kuid <KUID:-3:10112>
              }
           }
        }
 attached-track 
       {
        track {
               track     <KUID:-1:15>
               vertices {
                      0      a.track0a
                      1      a.track0b
               }
        }
        road {
               track         <KUID:###:####>
               useadjoiningtracktype      0
               vertices {
                      0      a.road0a
                      1      a.road0b
               }
        }
 }
 string-table
 {
 }
 username        "QR Level Crossing
 category-class  "TR"
 description     "QR level crossing with animated boomgates and flashing lights."


Breakdown:

class
Script class.
script
Script file name.
kuid-table
Lists the dependencies (track, road, corona)
mesh
Name of the default mesh model.
anim
Animation file attached to the default mesh.
att
Attachment point for the sub mesh.
att-parent
Defines the mesh to which the sub mesh is attached.
auto-create 1
The mesh is visible when the model is placed.
effects
The attached effects (coronas).
directional 0
The default alignment is overridden so the corona always faces the screen.
texture-kuid
KUID for the corona.
attached-track
Track type that will be joined between the attachment points, The names "a.track" and "a.road" are not mandatory, any name using the "a.name" convention may be used. The attachment points are defined in the model mesh. Refer to Page 91for attachment orientation.
useadjoiningtracktype 0
prevents the track used being updated to match the attached track.
string-table
A list that can be accessed in script/scriptlet code.


Return to CCG Index

Content Creator's Guide

Personal tools