Tail-lights container

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Rewrite using the original example.)
(Reformatted Config txt example and added missing curly brace. Before it was unclear in the code if 'tail-lights' was a peer of 'mesh-table' or a sub-container.)
Line 29: Line 29:
 
This example shows the mesh-table container and tail-light container for a traincar that has two tail lights at each end.
 
This example shows the mesh-table container and tail-light container for a traincar that has two tail lights at each end.
  
  mesh-table {
+
mesh-table  
    default {
+
{
      mesh                                "traincar.im"
+
default  
      auto-create                        1
+
{
   
+
mesh                                "traincar.im"
      effects
+
auto-create                        1
      {
+
        frontred0
+
effects
        {
+
{
          kind                            "corona"
+
frontred0
          att                            "a.frontred0"
+
{
          directional                    1
+
kind                            "corona"
          object-size                    0.2
+
att                            "a.frontred0"
          texture-kuid                    <kuid:-3:10112>
+
directional                    1
          max-distance                    1000
+
object-size                    0.2
        }
+
texture-kuid                    <kuid:-3:10112>
     
+
max-distance                    1000
        frontred1
+
}
        {
+
          kind                            "corona"
+
frontred1
          att                            "a.frontred1"
+
{
          directional                    1
+
kind                            "corona"
          object-size                    0.2
+
att                            "a.frontred1"
          texture-kuid                    <kuid:-3:10112>
+
directional                    1
          max-distance                    1000
+
object-size                    0.2
        }
+
texture-kuid                    <kuid:-3:10112>
     
+
max-distance                    1000
        backred0
+
}
        {
+
          kind                            "corona"
+
backred0
          att                            "a.backred0"
+
{
          directional                    1
+
kind                            "corona"
          object-size                    0.2
+
att                            "a.backred0"
          texture-kuid                    <kuid:-3:10112>
+
directional                    1
          max-distance                    1000
+
object-size                    0.2
      }
+
texture-kuid                    <kuid:-3:10112>
     
+
max-distance                    1000
      backred1
+
}
      {
+
        kind                            "corona"
+
backred1
        att                            "a.backred1"
+
{
        directional                    1
+
kind                            "corona"
        object-size                    0.2
+
att                            "a.backred1"
        texture-kuid                    <kuid:-3:10112>
+
directional                    1
        max-distance                    1000
+
object-size                    0.2
      }     
+
texture-kuid                    <kuid:-3:10112>
    }
+
max-distance                    1000
  }
+
}     
  tail-lights
+
}
    {
+
}
      front0
+
}
      {
+
 
        effect                          "frontred0"
+
tail-lights
        light-is-on-front-end          1
+
{
      }
+
front0
     
+
{
      front1
+
effect                          "frontred0"
      {
+
light-is-on-front-end          1
        effect                          "frontred1"
+
}
        light-is-on-front-end          1
+
      }
+
front1
     
+
{
      back0
+
effect                          "frontred1"
      {
+
light-is-on-front-end          1
        effect                          "backred0"
+
}
        light-is-on-front-end          0
+
      }
+
back0
     
+
{
      back1
+
effect                          "backred0"
      {
+
light-is-on-front-end          0
        effect                          "backred1"
+
}
        light-is-on-front-end          0
+
    }
+
back1
  }
+
{
 +
effect                          "backred1"
 +
light-is-on-front-end          0
 +
}
 +
}

Revision as of 10:06, 24 April 2020

The tail-lights container is a list of tail-light subcontainers and is used by KIND Traincar assets. It determines which of the corona effects for the traincar mesh are to be considered tail lights.

Tail lights are lit for the trailing end of a train vehicle that is the last vehicle in a consist. Tail lights that are not at the trailing end are not lit. If the traincar is not part of a consist then the lights are not lit.

The container is made up of a number of tail light subcontainers which include the effect name and a Boolean value indicating whether the effect is to be treated as a front-end light or a rear-end light. A rear-end tail light is lit when the rear end of the traincar is the trailing end of the consist. A front-end tail light is lit when the front of the traincar is at the trailing end of the consist (ie, the traincar is reversed within the consist).

Each effect listed in the container must be defined as a Corona Effect in the mesh table, with the appropriate tags for the corona KUID, size, etc. The tail-lights container has one tail-light subcontainer for each tail-light. The label used for each subcontainer is arbitrary, but must be unique. The container does not support any tags.

This container replaces a task that required a script in earlier versions of Trainz. If converting an asset from a version that uses a script, note that the effect used for the light is likely a texture replacement effect - this needs to be changed in the mesh table to a corona effect.

Contents

tail-light subcontainer

effect

Type: String
Compulsory: Yes
Default: Nothing
Desc: The name of the effect in the mesh-table that is to be used as this tail light.

light-is-on-front-end

Type: Boolean
Compulsory: No
Default: 0 (False)
Desc: Identifies this tail light as being a front light(True) or a rear light(False) of the traincar. This setting controls which lights are lit based on the traincar facing within the consist. Note that this is not the physical location of the light, although typically front lights would be at the front of the traincar and rear lights wold be at the rear.


Example

This example shows the mesh-table container and tail-light container for a traincar that has two tail lights at each end.

mesh-table { default { mesh "traincar.im" auto-create 1

effects { frontred0 { kind "corona" att "a.frontred0" directional 1 object-size 0.2 texture-kuid <kuid:-3:10112> max-distance 1000 }

frontred1 { kind "corona" att "a.frontred1" directional 1 object-size 0.2 texture-kuid <kuid:-3:10112> max-distance 1000 }

backred0 { kind "corona" att "a.backred0" directional 1 object-size 0.2 texture-kuid <kuid:-3:10112> max-distance 1000 }

backred1 { kind "corona" att "a.backred1" directional 1 object-size 0.2 texture-kuid <kuid:-3:10112> max-distance 1000 } } } }

tail-lights { front0 { effect "frontred0" light-is-on-front-end 1 }

front1 { effect "frontred1" light-is-on-front-end 1 }

back0 { effect "backred0" light-is-on-front-end 0 }

back1 { effect "backred1" light-is-on-front-end 0 } }

Personal tools