CCG/Kind: MOJunction

From TrainzOnline
< CCG
Jump to: navigation, search

Contents

KIND: MOJUNCTION

This is used for creating junction control levers.

Config.txt:

kuid                  <KUID2:####:#####:1>
kind                  "mojunction"
mesh-table
{
  mode0
  {
    mesh              "lever1/lever1.im"
    auto-create       1
  }
  mode1
  {
    mesh              "lever2/lever2.im"
    auto-create       1
  }
}
region                "Australia"
trackside             2
light                 1
soundscript
{
  toggle
  {
    trigger           "toggle"
    distance          5, 100
    nostartdelay      1
    repeat-delay      1
    sound
    {
      "points.wav"
    }
  }
}
username              "my junction"
description           "blah blah"
trainz-build          2.7
category-class        "X"
category-region       "AU"
category-era          "1980s"

Breakdown:

region
Surveyor region.
trackside
This is a value that is the distance in meters the object is placed relative to the center of the track. Negative values will put the object on the left side of the track, and positive values will place the object on the right.
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).
mode0
The model name of the initial junction, the model file is located in subfolder (lever1). Example refers to a file lever1\lever1.im
mode1
The model name of the initial junction, the model file is located in subfolder (lever2). Example refers to a file lever2\lever2.im

Note that this model does not have an animation file. The model changes between the two positions defined by the lever1.im and the lever2.im file models.


soundscript
Soundscripts for mojunction objects can be activated with toggle trigger message as in the example.

When a model has animation it is possible to trigger effects by an event associated with the animation at defined key frames of the animation. This event is activated by a trigger name such as "toggle" in the .evt file and called up from the config.txt file.

Refer to the Animation Event descriptions on Page 372.

However, for this model without an animation, the trigger name "toggle" is recognised by Trainz when the mojunction is activated, and the sound will play.


If you delete the Auran default junction lever for a switch junction in Trainz and replace it with your model, the wave file defined in the config.txt file will be associated with the trigger and play instead of the default in-built sound.


Return to CCG Index

Content Creator's Guide

Personal tools