Trainz/containers/attached-track container

From Wikibooks, open books for an open world
Jump to navigation Jump to search

attached-track container[edit]

The Attached-track container is used by kind SceneryWithTrack to identify a list of track subcontainers. Each track derives its name from the subcontainer's tag name. These names are used from script. Each track is auto-generated spline track through attachment points located within the default mesh.

  • Attached-tracks update automatically to the spline track connected to it in Surveyor. You may over-ride this auto-update feature by adding useadjoiningtracktype 0 (see below).
  • Correct track end attachment orientation is essential. The Y axis must point ‘out’ at the correct angle. The Z axis must point ‘up’.


Track subcontainer[edit]

Each track subcontainer supports the following tags and subcontainers. Each tag is shown here with its default value.

track                   (no default value, this must be track kuid)
useadjoiningtracktype   1
vertices                {}


track[edit]

Type: Kuid
Desc: Kuid of the track or spline to be used.

useadjoiningtracktype[edit]

Type: Boolean
Desc: If true (1) then the track type will change to match that of the first track joined to the object.

vertices[edit]

Type: Vertices container
Desc: This is a list of attachment points of where the track will be attached. Each entry must have a name.

Standard Config defines[edit]

TBS Standard definitions[edit]

These tags and containers are standard definitions which are likely found in nearly all assets. Some tags are optional, and may not be defined by content creators, as their choice. Tags are keywords, and have a single assigned key-value or containers such as a string-array or '{' ... '}' bounded enclosed tag-value pairs or sub-containers. (Everything declared in Trainz config files is in pairs, for even '{' ... '}' is considered a key-value'.

  • Containers are collections of 'key' and 'key-value' pairs and 'upper-level containers' in the TBS (as opposed to sub-containers such as those within the thumbnails container) are generally suffixed by '-table'.
 kind    "'string-value'"
 trainz-build 'float', 1 digit decimal value
 kuid  <Kuid coded value>
 username    username "'string-value'"
 username-XX    username-XX "'string-value'"
 description    description "'string-value'"
 description-XX    description-XX "'string-value'"
 kuid-table (container)

  { A list of dependencies
  by kuids }

 A key-value table listing all assets upon which this asset is dependent.
 obsolete-table (container)
    {
    }
 kuids list this asset replaces (makes obsolete)
 normally none (empty)[note 1]
 string-table (container)
    {
    }
 key-value list of strings and messages used in the asset
Generally empty, large only in routes and sessions.
 string-table (container[s])
    {  Non-English
    language text }
 list of translated strings matching onto the mandatory English string-table
 category-region tag enumerated codes  category-region "'string-array'"  
 category-class tag  category-class "'enumerated string-value'
 category-era tag  category-era "'constrained string-array'"  decades
 category-keyword "'string-array'" max length of 64 bytes    category-keyword tag natural language searching keywords
  (replaces type, region)
 custom-category-list 
 "'string-array'"
 script interfacing feature
 must-have-product-rights 
 "'string-value'"  
 DRM string array
 must-not-have-product-rights 
 "'string-value'"  
 DRM string array
 privileges (container)
    {
    }
 More DRM
 thumbnails (container)
    {
    }
 thumbnails container
 script (filename)    "'string-value'"
 class (script asset class)    "'string-value'", must synch with script specification class.
 script-include-table
    {
    }
 (container listing library scripts)
 extensions (container)
    {
    }
 formal script extensions also used by asset
 license "'string-value'"  Asset creator's copyrights statement
 author    "identity 'string-value'"
 organisation    "3rd party group identity 'string-value'"
 contact-email    "email addy 'string-value'"
 contact-website    "authors/groups web url 'string-value'"
 member-of-groups (container)
    {
    }
 A list of KIND Asset-group assets to which this asset belongs.

 


Example-1 brief Config.txt[edit]

Sample config.txt file for an industry asset, with the Standard Tags:

{
 kind industry
 attached-track {
   slc-spur {
     vertices {
       0                                   "a.track0a"
       1                                   "a.track0b"
       2                                   "a.track0c"
       3                                   "a.track0d"
       4                                   "a.track0e"
     }
     track                                 <kuid:-25:893>
     useadjoiningtracktype                 1
   }
 }
 attached-trigger {
   unload-trigger {
     att                                   "a.unload-trigger"
     radius                                2.00
     track                                 "slc-spur"
   }
   load-trigger {
     att                                   "a.load-trigger"
     radius                                2.00
     track                                 "slc-spur"
   }
   gate-trigger {
     radius                                10.00
     att                                   "a.gate-trigger"
     track                                 "slc-spur"
   }
 }
}

Example-2[edit]

This expandable below is a full kind buildable (industry):

 light                                   1
 height-range                            -10,10
 
 attached-track
 {
   track_0
   {
     track                               <kuid:-1:15>
     useadjoiningtracktype               1
     
     vertices
     {
       0                                 "a.track0a"
       1                                 "a.track0b"
     }
   }
 }
 
 smoke0
 {
   attachment                            "a.smoke0"
   mode                                  "time"
   color                                 25,25,25,255
   accel                                 0,0,0.25
   start                                 0
   rate                                  4
   period                                -1
   velocity                              1
   lifetime                              2
   minsize                               0.25
   maxsize                               2
 }
 
 smoke1
 {
   attachment                            "a.smoke1"
   mode                                  "time"
   color                                 255,255,255,150
   accel                                 0,0,0.25
   start                                 0
   rate                                  4
   period                                -1
   velocity                              1
   lifetime                              2
   minsize                               0.25
   maxsize                               2
 }
 
 obsolete-table
 {
 }
 
 mesh-table
 {
   default
   {
     mesh                                "Brewery.im"
     auto-create                         1
   }
 }
 
 thumbnails
 {
   A-fmMeshViewer
   {
     image                               "$screenshot (240).jpg"
     width                               240
     height                              180
   }
   B-Original
   {
     image                               "$Thumbnail.jpg"
     width                               240
     height                              180
   }
 }
 username                                "business wood frame Brewery-aRus"
 trainz-build                            2.9
 kuid                                    <kuid2:210518:1021:2>
 kind                                    "buildable"
 category-class                          "BB"
 category-region						    "CA;US"
 category-era						    "1840s;1850s;1860s;1870s;1880s;1890s;1900s;1910s;1920s;1930s"
 
 description                             "username= 'business wood frame Brewery-aRus'
 
 
 Original description:
 Upgraded for TS2012/SP1 compatibility.
 Original username: Brewery 
 
 Key Data:
 trainz-build                            2.9
 kind                                    'buildable' (scenery-w-track)
 useadjoiningtracktype                   1
 kuid                                    <kuid2:210518:1021:2>
 
 --------- --------- 
 Rev-A 2014-1016 - by Fabartus - Massage description, replace thumb with Mesh-viewer generated version, adjust smoke mode from 'constant' to 'time' (legal enumerated value), added category region and era sorting string arrays and lastly, rename asset and foldername of library per NAMCON to unified format adopted 2014-0612. 
 --------- --------- 
 
 Asset foldername: kuid2 210518 1021 2;v2-9;scenery-w-track business;business wood frame Brewery-aRus
 Original folder:  F:\TS12\UserData\editing\brewery
 *****************************************************************************************************
   "
 
 author                                  "Benjamin R. Dorsey (bendorsey)"
 contact-email                           "withheld & deleted"
 license                                 "This item is released free of charge for your enjoyment. 
 You may use, redistribute, and re-skin the model as long as you do not do so for profit or include it in any package for profit."
 
 kuid-table
 {
   1_track_wood                          <kuid:-1:15>

}