Junction Kit

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(config.txt: Tags & Containers)
Line 29: Line 29:
 
|-
 
|-
 
|'''script-include-table {'''<br>&nbsp;&nbsp;&nbsp;'''0'''<br>'''}'''
 
|'''script-include-table {'''<br>&nbsp;&nbsp;&nbsp;'''0'''<br>'''}'''
|'''<kuid:122285:79001>'''<br>
+
|'''<kuid:122285:79000>'''<br>
|This is a pointer to the asset containing the script referenced by JKStub.gs.
+
|This is a pointer to the asset containing the script referenced by JKObject.gs.
 
|-
 
|-
 
|'''script'''
 
|'''script'''
|'''"JKStub"'''
+
|'''"JKObject"'''
 
|The script file which you should drop into your asset folder
 
|The script file which you should drop into your asset folder
 
|-
 
|-
 
|'''class'''
 
|'''class'''
|'''"JKStub"'''
+
|'''"JKObject"'''
 
|The name of the script class within this file
 
|The name of the script class within this file
 
|-
 
|-
 
|'''kuid-table {'''<br>
 
|'''kuid-table {'''<br>
 
&nbsp;&nbsp;&nbsp;'''codelib'''<br>
 
&nbsp;&nbsp;&nbsp;'''codelib'''<br>
&nbsp;&nbsp;&nbsp;'''utility'''<br>
 
 
'''}'''
 
'''}'''
|'''<kuid:122285:79000><br><kuid:122285:79001>'''<br>
+
|'''<kuid:122285:79000><br>
 
|codelib is the script library.<br><br>utility refers to the externally included support script.
 
|codelib is the script library.<br><br>utility refers to the externally included support script.
 
|-
 
|-

Revision as of 16:45, 21 April 2013

Contents

config.txt: Tags & Containers

  • This is a list of tags and containers which relate to fixed track junctions.
  • Tags in bold type are essential for correct operation of the Library.
Tag Value Description
kind fixedtrack This is mandatory, fixed junctions will not work as any other asset kind.
use-named-track 1 This tag enables messages to be generated for scenery triggers attached to the junctions
use-gradient-track 1 This affects the way that TRS handles height adjustments.
rotate-yz-range -10,10 Allows junctions to be rolled to align with a grade. This is optional but if you wish to implement it you will need to align your models along the X axis in GMax, horizontally on the 'page'
rollstep 0.1 Defines the minimum angular increment when junctions are rolled.
script-include-table {
   0
}
<kuid:122285:79000>
This is a pointer to the asset containing the script referenced by JKObject.gs.
script "JKObject" The script file which you should drop into your asset folder
class "JKObject" The name of the script class within this file
kuid-table {

   codelib
}

<kuid:122285:79000>
codelib is the script library.

utility refers to the externally included support script.
extensions {

   jk2-122285 {
      junction-type
      default-state
   }
}

 

 
integer
integer
 
 

junction-type (see below) defines the layout and behaviour of the junction.

default-state (see below) defines the initial direction of the junction when first placed in Surveyor, this defaults to 0 if the tag is not present. The state can always be altered via the object property interface.


junction-type codes

  • A correct entry for this tag in the extensions table is essential for the script to recognise what actions need to be taken in response to conditions encountered.
  • The sub-table should remain as jk2-122285, do not alter it to your own kuid.
Value Description
0 Fixed track object with no animations, typically this would be a spacer which has no animations but which which needs scripted ability (such as ballast hiding) to match other assets.
1 Diamond crossing
2 Catch point (Derail)
3 Two way point
4 Three way point
5 Single slip
6 Double slip
7 Double crossover
  Other types may be defined and added to this list as the project progresses.

default-state codes

  • These are not always the same as the junction direction constants defined in TRS.
  • For multi junction objects, to allow the script to understand which node is which they must be defined in config.txt in the same order as set out in the diagrams below.
junction-type Legal Values
0 Not relevant
1 To be developed
2 0 = left
1 = right
3 0 = left
1 = right
4 0 = left
1 = centre
2 = right
5 SingleSlip.jpg
6 DoubleSlip.jpg
7 DoubleCrossover.jpg


mesh table containers

  • The library deals with animations and hiding of meshes based on the mesh names.
  • The actual content of the mesh containers is of no relevance to the script except where noted below.
  • The following special names are recognised.
  • Additional special mesh names will be added as the project develops.
Mesh Name Script Action
template# These are marker meshes which can be used for alignment or simply to indicate the location of node 1. You can provide any number of thesem starting with template1, template2,...,templaten. As long as there are no breaks in the numeric sequence each mesh will be displayed or hidden as appropriate. These meshes are only ever visible in Surveyor.
blade# These should contain mesh and animation references. Use blade1 for meshes attached to the first node and so on. The library supports both *.im and *.lm meshes.
ballast# If meshes named ballast are supplied they can be hidden via a property object option. Again you can serialise the containers to have the script act on more than one mesh.
Personal tools