Tail-lights container

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
TS 12 SP1 finally has introduced a native function to use Taillights without needing a custom script.
+
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.
  
As before (for script variants), the coronas have to be defined inside the effects container in the mesh-table.
+
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.
 +
 
 +
====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.
  
To make those coronas work as tail-lights, a new container type named "tail-lights" has been introduced.
 
This container has one child element per tail-light, in each child the matching effect name is referenced and the location of the tail-light is defined.
 
  
This function shows the backside-coronas of the last traincar in a train, if the last car is not equipped with taillights, no coronas are displayed.
 
  
 
==Example==
 
==Example==
  
  mesh-table {
+
This example shows the mesh-table container and tail-light container for a traincar that has two tail lights at each end.
     default {
+
 
      mesh                                "traincar.im"
+
mesh-table
      auto-create                        1
+
{
   
+
     default  
      effects
+
    {
 +
        mesh                                "traincar.im"
 +
        auto-create                        1
 +
       
 +
        effects
 
         {
 
         {
        frontred0
+
            frontred0
      {
+
            {
        kind                            "corona"
+
                kind                            "corona"
        att                            "a.frontred0"
+
                att                            "a.frontred0"
        directional                    1
+
                directional                    1
        object-size                    0.2
+
                object-size                    0.2
        texture-kuid                    <kuid:-3:10112>
+
                texture-kuid                    <kuid:-3:10112>
        max-distance                    1000
+
                max-distance                    1000
      }
+
            }
     
+
           
      frontred1
+
            frontred1
      {
+
            {
        kind                            "corona"
+
                kind                            "corona"
        att                            "a.frontred1"
+
                att                            "a.frontred1"
        directional                    1
+
                directional                    1
        object-size                    0.2
+
                object-size                    0.2
        texture-kuid                    <kuid:-3:10112>
+
                texture-kuid                    <kuid:-3:10112>
        max-distance                    1000
+
                max-distance                    1000
      }
+
            }
     
+
           
      frontwhite0
+
            backred0
      {
+
            {
        kind                            "corona"
+
                kind                            "corona"
        att                            "a.frontwhite0"
+
                att                            "a.backred0"
        directional                    1
+
                directional                    1
        object-size                    0.25
+
                object-size                    0.2
        texture-kuid                    <kuid:-3:10111>
+
                texture-kuid                    <kuid:-3:10112>
        max-distance                    1000
+
                max-distance                    1000
        max-intensity                  1.2
+
            }
      }
+
           
     
+
            backred1
      frontwhite1
+
            {
      {
+
                kind                            "corona"
        kind                            "corona"
+
                att                            "a.backred1"
        att                            "a.frontwhite1"
+
                directional                    1
        directional                    1
+
                object-size                    0.2
        object-size                    0.25
+
                texture-kuid                    <kuid:-3:10112>
        texture-kuid                    <kuid:-3:10111>
+
                max-distance                    1000
        max-distance                    1000
+
            }  
        max-intensity                  1.2
+
         }
      }
+
     
+
      frontwhite2
+
      {
+
        kind                            "corona"
+
        att                            "a.frontwhite2"
+
        directional                    1
+
        object-size                    0.25
+
        texture-kuid                    <kuid:-3:10111>
+
        max-distance                    1000
+
        max-intensity                  1.2
+
      }
+
       
+
      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
+
      }
+
     
+
      backwhite0
+
      {
+
         kind                            "corona"
+
        att                            "a.backwhite0"
+
        directional                    1
+
        object-size                    0.25
+
        texture-kuid                    <kuid:-3:10111>
+
        max-distance                    1000
+
        max-intensity                  1.2
+
      }
+
     
+
      backwhite1
+
      {
+
        kind                            "corona"
+
        att                            "a.backwhite1"
+
        directional                    1
+
        object-size                    0.25
+
        texture-kuid                    <kuid:-3:10111>
+
        max-distance                    1000
+
        max-intensity                  1.2
+
      }
+
     
+
      backwhite2
+
      {
+
        kind                            "corona"
+
        att                            "a.backwhite2"
+
        directional                    1
+
        object-size                    0.25
+
        texture-kuid                    <kuid:-3:10111>
+
        max-distance                    1000
+
        max-intensity                  1.2
+
      }
+
     
+
 
     }
 
     }
  }
+
}
   
+
  
  tail-lights
+
tail-lights
 +
{
 +
    front0
 
     {
 
     {
      front0
 
      {
 
 
         effect                          "frontred0"
 
         effect                          "frontred0"
 
         light-is-on-front-end          1
 
         light-is-on-front-end          1
      }
+
    }
     
+
   
      front1
+
    front1
      {
+
    {
 
         effect                          "frontred1"
 
         effect                          "frontred1"
 
         light-is-on-front-end          1
 
         light-is-on-front-end          1
      }
+
    }
     
+
   
      back0
+
    back0
      {
+
    {
 
         effect                          "backred0"
 
         effect                          "backred0"
 
         light-is-on-front-end          0
 
         light-is-on-front-end          0
      }
+
    }
     
+
   
      back1
+
    back1
      {
+
    {
 
         effect                          "backred1"
 
         effect                          "backred1"
 
         light-is-on-front-end          0
 
         light-is-on-front-end          0
 
 
     }
 
     }
  }
+
}

Latest revision as of 10:11, 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

[edit] tail-light subcontainer

[edit] 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.

[edit] 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.


[edit] 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