Junction Kit

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(junction-type codes)
(Replaced content with "Help and Information on AJS Junction Kit Mark 2 Under Construction Junction Kit Configuration Notes on configuration of Assets")
 
Line 1: Line 1:
==Notes on the Preview Assets==
+
Help and Information on AJS Junction Kit Mark 2
==Default Control==
+
Under Construction
By default clicking on a fixed track junction asset will only toggle the first referenced switch, usually item 0 in the junction-vertices table.  There is no way that the other nodes can be manually switched without script.  However the AI will be able to successfully negotiate the object no matter how many junction-vertices are defined.<br><br>
+
  
The assets do not respond to the junction-direction button on the track tab in Surveyor and they cannot be switched on the minimap.<br><br>
 
  
These drawbacks can only be addressed by Auran.
+
[[Junction Kit Configuration]] Notes on configuration of Assets
 
+
==Script Library Control==
+
There is a button in the Properties dialogue which allows you to toggle through all of the possible settings to set a new default for the session.  These settings are remembered across session saves.<br><br>
+
 
+
In Driver the AI is left to its own devices and should be able to switch the junctions properly without interference from the script.<br><br>
+
 
+
Pressing J or ^J from a train will toggle the node nearest to the train and will set up any other junction nodes to suit.<br><br>
+
 
+
Clicking on the mesh will toggle to the next available state.<br><br>
+
 
+
It is not possible to detect the difference between a mouse click on the mesh and a keypress from a train approaching the first node with 100% accuracy.<br><br>
+
 
+
==Levers==
+
Levers are entirely decorative, the junctions are activated by a click on the main mesh.
+
 
+
==Junction Linking==
+
Links are ignored by the AI - they only operate when the junctions are manually switched.<br><br>
+
 
+
==Asset Configuration==
+
 
+
==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.
+
* You will also need a mesh-table, junction-vertices and attached -track containers.<br><br>
+
{{TableHeader|width=95%|margin=15px}}
+
|-
+
|width="150"|Tag
+
|width="150"|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 {'''<br>&nbsp;&nbsp;&nbsp;'''0'''<br>'''}'''
+
|'''<kuid:122285:79000>'''<br>
+
|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 {'''<br>
+
&nbsp;&nbsp;&nbsp;'''codelib'''<br>
+
'''}'''
+
|'''<kuid:122285:79000><br>
+
|codelib is the script library.
+
|-
+
|'''extensions {'''<br>
+
&nbsp;&nbsp;&nbsp;'''jk2-122285 {'''<br>
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''junction-type'''<br>
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default-state<br>
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction-0<br>
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction-1<br>
+
&nbsp;&nbsp;&nbsp;'''}'''<br>
+
'''}'''
+
|&nbsp;<br>
+
&nbsp;<br>
+
integer<br>
+
integer<br>
+
integer<br>
+
integer<br>
+
&nbsp;<br>
+
&nbsp;<br>
+
|'''junction-type''' (see below) defines the layout and behaviour of the junction.<br>
+
'''default-state''' (see below) defines the initial state of the junction when first placed in Surveyor, this defaults to 0 and can be altered in Surveyor.<br>
+
'''direction-0''' defines the straight ahead direction for the first node in a single crossover. (0=left, 1=straight, 2=right) Defaults to 0 and applies to Junction-type 8 only.<br>
+
'''direction-1''' defines the straight ahead direction for the second node. Defaults to 0. Junction-type 8 only.<br>
+
|}<br>
+
 
+
==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.
+
{{TableHeader|width=95%|margin=15px}}
+
|-
+
|width="150"|Value
+
|Description
+
|-
+
| -3
+
|Placeholder used by the script to reference 3 way spline junctions
+
|-
+
| -2
+
|Placeholder used by the script to reference 2 way spline junctions
+
|-
+
| -1
+
|Generic clickable object such as Signal Box Asset
+
|-
+
| 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
+
|-
+
| 8
+
|Single Crossover (UK Trailing)
+
|-
+
| 9
+
|Single Crossover (UK Leading)
+
|-
+
|&nbsp;
+
|Other types may be defined and added to this list as the project progresses.
+
|}<br>
+
 
+
==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.
+
{{TableHeader|width=95%|margin=15px}}
+
|-
+
|width="150"|junction-type
+
|Legal Values
+
|-
+
|0
+
|Not relevant
+
|-
+
|1
+
|To be developed
+
|-
+
|2
+
|0 = left<br>1 = right
+
|-
+
|3
+
|0 = left<br>1 = right
+
|-
+
|4
+
|0 = left<br>1 = centre<br>2 = right
+
|-
+
|5
+
|[[Image:SingleSlip.jpg]]
+
|-
+
|6
+
|[[Image:DoubleSlip.jpg]]
+
|-
+
|7
+
|[[Image:DoubleCrossover.jpg]]
+
|-
+
|8
+
|0 = straight ahead<br>1 = crossover position
+
|-
+
|}
+
 
+
==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.
+
{{TableHeader|width=95%|margin=15px}}
+
|-
+
|width="150"|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.
+
|}
+

Latest revision as of 05:20, 23 November 2013

Help and Information on AJS Junction Kit Mark 2 Under Construction


Junction Kit Configuration Notes on configuration of Assets

Personal tools