KIND Region

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Undo revision 29093 by Pware (talk))
(corrected overwriting)
 
Line 1: Line 1:
The information in this Wiki Page applies to '''TANE''', '''TRS19''' and '''Trainz Plus'''.
+
{{ORP-top}}
 +
==KIND Region==
 +
'''KIND Region''' provides a set of values that are characteristic of the region that a route is modelling.  These values are the location of the region, the vehicles that travel on the roads and whether they travel on the left or the right, the default junction switches and the color of the water.
  
__TOC__
+
A region asset is selected for a route when the route is created. It can be changed in Surveyor when the route is edited. A region does not necessarily correspond to a particular physical or political area - it can be defined as required to reflect the settings that should apply to the route.
='''What is a Region?'''=
+
  
<table cellpadding="4" bgcolor=#c1e7e7>
+
==KIND Hierarchy==
<tr valign="top">
+
*[[TrainzBaseSpec]]
<td>[[file:DotPoint.JPG|link=]]</td>
+
<td>A '''Region''' defines the characteristics of a geograpic location (e.g. a country or a province) and/or a time period (e.g. 1950s) that is being modelled in a route and session<td>
+
</tr>
+
<tr valign="top">
+
<td>[[file:DotPoint.JPG|link=]]</td>
+
<td>A '''Region Asset''' is a '''config.txt''' file that contains the region data<td>
+
</tr>
+
</table><br>
+
  
='''How to Create a Region Asset'''=
+
==Parent Classes==
 +
* ''none.''
  
<table cellpadding="4" bgcolor=#ffffff> <!-- BEGIN Step table -->
+
==Child Classes==
<tr valign="top">
+
* '[[KUID]] defined assets for vehicle traffic particular to the region and for the default junction switch.
<td>[[file:Steps.PNG|link=]]<br><br>
+
<span style="font-size: 17px; font-weight: 700;">Steps</span></td>
+
<td>[[file:DotPoint1.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Create the Asset:</span><br>
+
<table> <!-- BEGIN Step 1 table -->
+
<tr valign="top">
+
<td>[[file:NewAsset.PNG|link=]]<br><br>
+
[[file:NewAssetCreated.PNG|link=]]</td>
+
<td>From the '''Trainz''' Launcher
+
#select '''Manage Content'''
+
#in '''Content Manager''' open the '''Developer''' menu
+
#select '''New Content'''
+
This will create a new asset and open it for editing.
+
<br><br>
+
A message window will appear that will (hopefully) report on the successful creation of a new asset.
+
*Close the message window
+
</td>
+
</tr>
+
</table> <!-- END Step 1 table -->
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>&nbsp;</td>
+
<td>[[file:DotPoint2.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Find the New Asset:</span><br>
+
<table> <!-- BEGIN Step 2 table -->
+
<tr valign="top">
+
<td>[[file:NewAssetSelectOpen.PNG|link=]]</td>
+
<td>
+
*Set the CM Search Filter to '''Open for Editing'''
+
This will display only those assets that have been opened for editing (hopefully only your new and as yet unnamed asset will be shown)
+
</td>
+
</tr>
+
</table> <!-- END Step 2 table -->
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>&nbsp;</td>
+
<td>[[file:DotPoint3.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Open the Asset in Windows File Explorer:</span><br>
+
<table> <!-- BEGIN Step 3 table -->
+
<tr valign="top">
+
<td>[[file:NewAssetShowExplorer.PNG|link=]]</td>
+
<td>
+
#Right mouse click on the entry '''New Asset'''
+
#Select '''Open'''
+
#Select '''Show in Explorer'''
+
</td>
+
</tr>
+
</table> <!-- END Step 3 table -->
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>&nbsp;</td>
+
<td>[[file:DotPoint4.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Open Config.txt File in Notepad:</span><br>
+
<table> <!-- BEGIN Step 4 table -->
+
<tr valign="top">
+
<td>[[file:NewAssetOpenExplorer.PNG|link=]]</td>
+
<td>There will only be a single item in the asset, its config.txt file
+
*Double click on the file to open it in Notepad</td>
+
</tr>
+
</table> <!-- END Step 4 table -->
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>&nbsp;</td>
+
<td>[[file:DotPoint5.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Edit the Config.txt File:</span><br>
+
<table> <!-- BEGIN Step 5 table -->
+
<tr valign="top">
+
<td>[[file:NewAssetOpenNotepad.PNG|link=]]</td>
+
<td>You will need to edit the contents of this file.
+
*The next section, [[file:PageLink.PNG|link=]] '''[[#The Config.txt File|The Config.txt File]]''', identifies the changes you will need to make.
+
*The new name you give to the asset will not take effect until after it has been committed.
+
*After editing, save the changes and exit Notepad.</td>
+
</tr>
+
</table> <!-- END Step 5 table -->
+
<br>
+
<table cellpadding="4" bgcolor=#fcbcbc> <!-- BEGIN Step 5 warning table -->
+
<tr valign="top"> <!-- warning -->
+
<td colspan=2><span style="font-size: 17px;"><b>Warning:</b></span></td>
+
</tr>
+
<tr valign="top">
+
<td>[[file:Stop.PNG|link=]]</td>
+
<td>Unless you know '''exactly''' what you are doing'''*''',&nbsp;<span style="color: white; background-color: red; font-weight: 700; font-size: 17px;">&nbsp;DO NOT ALTER THE KUID NUMBER&nbsp;</span>&nbsp;that has been added to the file<br>
+
'''*''' but even if you do, think <span style="font-weight: 700; text-decoration: underline">twice</span> before you change it !</td>
+
</tr>
+
</table> <!-- END Step 5 warning table -->
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>&nbsp;</td>
+
<td>[[file:DotPoint6.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Add a Thumbnail:</span><br>
+
<table> <!-- BEGIN Step 6 table -->
+
<tr valign="top">
+
<td colspan=2>
+
You will need to add a thumbnail image as described in the section [[file:PageLink.PNG|link=]] '''[[#The Thumbnail Image|The Thumbnail Image]]'''. The thumbnail and the config.txt files are the only two items required in this asset.
+
<br>
+
The thumbnail does not have to be added immediately but must it be present before the new asset can be used. You can reopen the asset for editing later to add the thumbnail before it is committed.</td>
+
</tr>
+
</table> <!-- END Step 6 table -->
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>&nbsp;</td>
+
<td>[[file:DotPoint7.JPG|link=]]&nbsp;<span style="font-size: 17px; font-weight: 700;">Finish Up:</span>
+
<table> <!-- BEGIN Step 7 table -->
+
<tr valign="top">
+
<td>[[file:NewAssetSubmit.PNG|link=]]</td>
+
<td>
+
*Close the Asset window
+
*Commit the asset in Content manager
+
**Right mouse click on the asset
+
**Select '''Submit Edits'''
+
Hopefully there will be no errors.<br><br>
+
<table cellpadding="4" bgcolor=#ffffb0> <!-- BEGIN Step 7 Notes table -->
+
<tr valign="top">
+
<td>[[file:NotePad.PNG|link=]]</td>
+
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
+
Because you still have the Filter '''Open for Editing''' in operation, the now closed and committed asset will vanish from the window display. To check that your asset has been correctly created and renamed, set the CM Search Filter to "Today".</td>
+
</tr>
+
</table> <!-- END Step 7 Notes table -->
+
<table cellpadding="4" bgcolor=#ff0000> <!-- BEGIN Step 7 errors table -->
+
<tr valign="top">
+
<td>
+
<table cellpading="4" bgcolor=#ffffff> <!-- BEGIN Step 7 errors-bugs table -->
+
<tr valign="top">
+
<td>[[file:Bug.png|link=]]</td>
+
<td>Some of the most common errors that can occur when creating and committing a new asset are:-
+
*no '''''thumbnail image''''' in the asset
+
*typing errors in the config.txt file
+
*poorly formatted tags in the config.txt file
+
*incorrect file types added to the asset folder
+
*files missing from the asset folder
+
*incorrect '''kuid''' value (despite the warning you changed it in '''Step 5''')</td>
+
</tr>
+
</table> <!-- END Step 7 errors-bugs table -->
+
</td>
+
</tr>
+
</table> <!-- END Step 7 errors table -->
+
</td>
+
</tr>
+
</table> <!-- END Step 7 table -->
+
</td>
+
</tr>
+
</table> <!-- END Steps table -->
+
  
<table width="100%"> <!-- BEGIN Back-to-top table -->
+
==Supported Tags==
<tr valign="top">
+
The [[KIND Region]] [[config.txt file]] supports the following tags (in addition to the tags that are available to all assets). Each tag is shown here with its default value.
<td align="right">[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
+
</tr>
+
</table> <!-- END Back-to-top table -->
+
  
='''The Config.txt File'''=
+
watercolor      0,0,0
 +
defaultjunction <nullkuid>
 +
ontheright      0
 +
longitude      153.0,2.0,1.0
 +
latitude        27.0,28.0,-1.0
 +
altitude        0
 +
car0            <nullkuid>
 +
  ...
 +
car15          <nullkuid>
  
This file should follow the same (or a similar) format as the example below.<br>
+
====kind====
*entries in&nbsp;<span style="background-color: blue; color: white; font-weight: 700;">&nbsp;blue&nbsp;</span>&nbsp;are examples only and may/will be different for each asset
+
:Type:      String "region"
*the indenting of the lines and the spacing ("tabbing") between the "tags" on the left and their contents on the right are purely to make it easier for humans to read
+
:Compulsory: Yes from 3.4
*the use of the '''{}''' braces is to group tags into common "containers". These containers must not be broken up and the number of '''{''' characters must match the number of '''}''' characters
+
:Default:    n/a
*the order of the "tags" is not important
+
:Desc:      Identifies the asset as Kind Region.
  
'''kuid'''                              <kuid:<span style="background-color: blue; color: white; font-weight: 700;"> this is an auto-generated number </span>>
+
====watercolor====
'''kind'''                              '''"region"'''
+
:Type:       Integer list
username                          "<span style="background-color: blue; color: white; font-weight: 700;">Tasmania 1950s/1960s Region</span>"
+
:Compulsory: Yes from 3.4
'''category-class'''                    "YX"
+
:Default:    0,0,0
'''category-era'''                     "<span style="background-color: blue; color: white; font-weight: 700;">1950s;1960s</span>"
+
:Desc:       RGB vaues for the color of the water placed in the routes that use this region. This color will be adjusted by the color settings for the route, including time-of-day adjustments.
'''category-region'''                  "<span style="background-color: blue; color: white; font-weight: 700;">AU</span>"
+
'''ontheright'''                        <span style="background-color: blue; color: white; font-weight: 700;">0</span>
+
'''water-color'''                      <span style="background-color: blue; color: white; font-weight: 700;">75,128,255</span>
+
'''defaultjunction'''                  <span style="background-color: blue; color: white; font-weight: 700;"><kuid:61119:24120></span>
+
'''longitude'''                        <span style="background-color: blue; color: white; font-weight: 700;">147.0,26.0,1.0</span>
+
'''latitude'''                          <span style="background-color: blue; color: white; font-weight: 700;">41,50,-1</span>
+
'''altitude'''                          <span style="background-color: blue; color: white; font-weight: 700;">212</span>
+
'''car0'''                              <span style="background-color: blue; color: white; font-weight: 700;"><kuid:61119:24120></span>
+
'''trainz-build'''                      <span style="background-color: blue; color: white; font-weight: 700;">4.3</span>
+
'''thumbnails'''
+
{
+
  <span style="background-color: blue; color: white; font-weight: 700;">'''Default'''</span>
+
  {
+
    width                              240
+
    height                              180
+
    image                              "<span style="background-color: blue; color: white; font-weight: 700;">Tasmania-Region</span>'''.jpg'''"
+
   }
+
}
+
description                            "<span style="background-color: blue; color: white; font-weight: 700;">Vehicle, road, water and geographic data for Tasmania (Australia) in the 1950s and 1960s</span>"
+
kuid-table
+
{
+
  0                                     <span style="background-color: blue; color: white; font-weight: 700;">kuid value</span>
+
  1                                    <span style="background-color: blue; color: white; font-weight: 700;">kuid value</span>
+
  2                                    <span style="background-color: blue; color: white; font-weight: 700;">kuid value</span>
+
}
+
+
<table cellpadding="4" bgcolor=#eeeeee>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
<tr valign="top">
+
<td>[[file:Gears.PNG|link=]]</td>
+
<td><span style="font-size: 17px;">'''Settings:'''</span><br>
+
'''For the above example:'''<br>
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> kuid </span>&nbsp;is unique to every asset so it is&nbsp;<span style="background-color: red; color: white; font-weight: 700;">&nbsp;not a good idea to choose your own&nbsp;</span>. This will be automatically generated by the '''Content Manager''' program when a new asset is created
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> kind </span>&nbsp;identifies the ''type'' of asset and the types of files that '''Trainz''' will expect to find in the asset. It also tells '''Trainz''' how to render and error check the asset. A list of asset kinds can be found at [[file:WikiLink.PNG|link=]] '''[[KIND_TrainzBaseSpec#KIND_Hierarchy|KIND Hierarchy]]'''
+
"'''icon_gradeXing.texture.txt'''") but the filename ending "'''.txt'''" is not added to the name in the '''texture''' tag so it would appear as "'''icon_gradeXing.texture'''"
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> username </span>&nbsp;is your name for the asset and the name that other users will see. It is a good idea to make it short and meaningful.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> category-class </span>&nbsp;identifies the ''intent'' of the asset and is important in classifying it for filtering and searching. For '''region''' assets, the category class is "'''YX'''". A list of category classes can be found at [[file:WikiLink.PNG|link=]] '''[[Category-class]]'''
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> category-era </span>&nbsp;identifies the decade or decades in which the region is based (e.g. "1950s"). See the section [[file:PageLink.PNG|link=]] '''[[#Category Era Tag|Category Era Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> category-region </span>&nbsp;identifies the country or countries in which layout is based. See the section [[file:PageLink.PNG|link=]] '''[[#Category Region Tag|Category Region Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> ontheright </span>&nbsp;identifies which side of the road is used by road traffic. See the section [[file:PageLink.PNG|link=]] '''[[#On the Right Tag|On the Right Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> water-color </span>&nbsp;identifies the the colour used by water surfaces in this region. See the section [[file:PageLink.PNG|link=]] '''[[#Water Color Tag|Water Color Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> defaultjunction </span>&nbsp;identifies the junction lever or switch that Trainz will use as its default lever asset whenever a lever is added to a track junction in this region. See the section [[file:PageLink.PNG|link=]] '''[[#Default Junction Tag|Default Junction Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> longitude </span>&nbsp;identifies the geographic longitude of a point in the region. See the section [[file:PageLink.PNG|link=]] '''[[#Longitude Tag|Longitude Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> latitude </span>&nbsp;identifies the geographic latitude of a point in the region. See the section [[file:PageLink.PNG|link=]] '''[[#Latitude Tag|Latitude Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> altitude </span>&nbsp;identifies the altitude of the point in the region whose longitude and latitude has been given. See the section [[file:PageLink.PNG|link=]] '''[[#Altitude Tag|Altitude Tag]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> car0 </span>&nbsp;identifies the first moving car that will appear on roads in the region. Upto 15 different cars can be specified. See the section [[file:PageLink.PNG|link=]] '''[[#Car Tags|Car Tags]]''' below for more details.
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> trainz-build </span>&nbsp;identifies the ''minimum'' Trainz version needed for this asset. A list of asset trainz-build numbers and their corresponding Trainz versions can be found at [[file:WikiLink.PNG|link=]] '''[["Trainz-build"_number|Trainz build numbers]]'''
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> thumbnails </span>&nbsp;container holds the ''preview'' images of the asset shown by the '''Content Manager''' program, the Web version of the ''DLS'' and, for '''some assets''', the Surveyor main menu image(s). Information on thumbnails can be found at [[file:WikiLink.PNG|link=]] '''[[Thumbnails]]'''
+
**The label&nbsp;<span style="background-color: blue; color: white; font-weight: 700;">'''&nbsp;Default&nbsp;'''</span>&nbsp;is the '''container ID''' or '''placeholder''' for the thumbnail used by CM and the Web based DLS. While its ''exact label'' (or number - eg. "Default", "00", "01", etc) is not important, it must be different from any other labels that might be present in the thumbnail. '''Default''' and '''0''' are commonly used placeholder labels for the 240 x 180 thumbnail image
+
***The '''image''' is the name of the thumbnail image - it '''must''' be a JPG format image
+
***The '''width''' of the image must be '''240 pixels'''
+
***The '''height''' of the image must be '''180 pixels'''
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> description </span>&nbsp;provides more details for users than the '''username'''
+
*The&nbsp;<span style="background-color: blue; color: white; font-weight: 700;"> kuid-table </span>&nbsp;contains the kuid values of the '''defaultjunction''' asset (if used) and all the '''carN''' assets. See the section [[file:PageLink.PNG|link=]] '''[[#Kuid Table Tag|Kuid Table Tag]]''' below for more details.
+
</td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
----</td>
+
</tr>
+
</table>
+
  
<table cellpadding="4" bgcolor=#ffffb0>
+
====defaultjunction====
<tr valign="top">
+
:Type:      Kuid
<td>[[file:PencilTips.PNG|link=]]</td>
+
:Compulsory: Yes from 3.4
<td><span style="font-weight: 700; font-size: 17px;">Language Options:</span></td>
+
:Default:   <nullkuid>
</tr>
+
:Desc:      The KUID of a junction switch lever. This lever will be automatically placed on the route when a junction is created, if the user has selected to auto-add junction switch levers.  
<tr valign="top">
+
<td></td>
+
<td>All Trainz assets have a language facility built into their config.txt files that allows other language translations to be added for certain tags, such as the '''username''' and '''description''' tags. A full description of the process can be found on the Trainz Wiki at '''[[HowTo/Localize_an_Asset|Localize an Asset]]''' and a list of all the supported languages with their two character codes at [[file:WikiLink.PNG|link=]]&nbsp;'''[[Localization_code|Localization (country) Codes]]'''.<br>
+
  
At the very basic level any creator can easily provide other language translations for the '''username''' and '''description''' tags in the assets they create. Examples are shown below for this sample asset.</td>
+
====ontheright====
</tr>
+
:Type:      Boolean
<tr valign="top">
+
:Compulsory: Yes
<td colspan=2>
+
:Default:    0
username                    "Tasmania 1950s/1960s region"
+
:Desc:      If True (1) then vehicles will travel on the right-hand side of the road. If false (0) then vehicles will drive on the left-hand side.
username-c2                ""
+
username-es                ""
+
username-fr                ""
+
  username-gr                ""
+
username-nl                ""
+
username-ru                ""
+
</td>
+
</tr>
+
<tr valign="top">
+
<td></td>
+
<td>Translations to Chinese (simplified), Spanish, French, German, Dutch and Russian, perfect or not, were provided by Google Translate.
+
</td>
+
</tr>
+
</table>
+
  
<table width="100%">
+
====longitude====
<tr valign="top">
+
:Type:      Float list
<td align="right">[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
+
:Compulsory: Yes from 3.4
</tr>
+
:Default:    153.0,2.0,1.0
</table>
+
:Desc:      Three floating-point values specifying the longitude of the region in degrees, minutes and E/W. Longitude East of Greenwich is indicated by the third value of +1, while longitude West of Greenwich is indicated by a value of -1.
  
=='''Category Era Tag'''==
+
====latitude====
 +
:Type:      Float list
 +
:Compulsory: Yes from 3.4
 +
:Default:    27.0,28.0,-1.0
 +
:Desc:      Three floating-point values specifying the latitude of the region in degrees, minutes and N/S. Latitude North of the Equator is indicated by the third value of +1, while latitude South of the Equator is indicated by a value of -1. Latitude is used as part of the seasonal calculations and in relation to the angle of the sun.
  
This identifies the decade or decades in which the region is based. Each decade name ends with an "s" (e.g. "1950s") and multiple consecutive decades can be specified by using a semi-colon (;) as a separator (e.g. "1950s;1960s"). A list of category-eras can be found at [[file:WikiLink.PNG|link=]] '''[["Category-era"_tag|Category-era tag]]'''.
+
===altitude===
 +
:Type:      Float
 +
:Compulsory: Yes from 3.4
 +
:Default:    0.0
 +
:Desc:      Height of the region in metres.   Height is used in some seasonal calculations.
  
=='''Category Region Tag'''==
+
===car0=== 
 +
:Type:      kuid
 +
:Compulsory: No. The car will not exist if the tag is not present.
 +
:Default:    n/a
 +
:Desc:      KUID of a car that will travel on any roads in the region that are traffic-enabled. Note that this KUID must refer to an asset that is correctly indicated as a car used for roads: kind 'scenery', category-class 'VL' and trackside 0.01 (the value for this can vary if necessary).
 +
Tags 'car1' through 'car14' can be used for an additional 14 cars.  The maximum available for a region is 15 cars.  They should be used in sequence from car0 to car14.
  
This identifies the country or countries in which the region is based. Each country has a two letter code (e.g. "AU" for Australia) and multiple countries can be specified by using a semi-colon (;) as a separator (e.g. "AU;UK;US"). If no country is to be specified then the two character code "00" (double zero) is used. A list of countries (category regions) can be found at [[file:WikiLink.PNG|link=]] '''[[#"Category-region"_tag|Category-region tag]]'''.
+
See the following two guides for making car asset for use with regions.
  
=='''On the Right Tag'''==
+
[[HowTo/Build_a_Car_for_Traffic_(stand-alone_version)]]
  
This identifies which side of the road is used by road traffic in this region. 0 = left side, 1 = right side. This tag is '''compulsory''' in a Region asset.
+
[[HowTo/Build_a_Car_for_Traffic_(mesh_library_version)]]
  
=='''Water Color Tag'''==
+
==Example Config.txt==
 
+
This identifies the the colour used by water surfaces in this region. Three integers specify the RGB ('''R'''ed, '''G'''reen, '''B'''lue) colour values to be used. Each value is from 0 to 255 and are separated by commas (e.g. 75,128,255). This tag is '''compulsory''' in a Region asset with an asset build number of 3.4 and higher.
+
 
+
=='''Default Junction Tag'''==
+
 
+
This identifies the junction lever or switch that Trainz will use as its default lever asset whenever a lever is added to a track junction in this region. The lever asset must be identified by its kuid (e.g. <kuid:61119:24120>). This tag is '''compulsory''' in a Region asset with an asset build number of 3.4 and higher.
+
 
+
The kuid value of the switch lever must be added to the '''kuid-table''' container of the config.txt file.
+
 
+
=='''Longitude Tag'''==
+
 
+
This identifies the geographic longitude of a point in the region. Three values separated by commas must be supplied. The first is the longitude '''degrees''';, the second is the longitude '''minutes''' and the third is the '''East/West''' value (1.0 = East, -1.0 = West). For example: 147.0,26.0,1.0 would represent longitude 147 degrees 26 minutes East. This tag is '''compulsory''' in a Region asset with an asset build number of 3.4 and higher.
+
 
+
=='''Latitude Tag'''==
+
 
+
This identifies the geographic latitude of a point in the region. Three values separated by commas must be supplied. The first is the latitude '''degrees''';, the second is the latitude '''minutes''' and the third is the '''North/South''' value (1.0 = North, -1.0 = South). For example: 41,50,-1 would represent latitude 41 degrees 50 minutes South. This tag is '''compulsory''' in a Region asset with an asset build number of 3.4 and higher.
+
 
+
=='''Altitude Tag'''==
+
 
+
This identifies the altitude of the point in the region whose longitude and latitude has been given. The height is a single value in metres and is used in the display of snow effects for those assets that support snow. This tag is '''compulsory''' in a Region asset with an asset build number of 3.4 and higher.
+
 
+
=='''Car Tags'''==
+
 
+
This identifies the moving cars that will appear on roads in the region.
+
*Upto 15 different cars, each as a separate tag from '''car0''' to '''car14''' identifying their '''kuid''' values, can be specified in a region. The car numbers must be consecutive with no missing or duplicated entries
+
*The cars must be specifically created as moving vehicles and not as static vehicles - static car assets cannot be used
+
*'''car''' tags are '''not compulsory'''. If not used then no moving cars will appear
+
*Not all roads can carry moving vehicles
+
*The '''Environment Tool''' has a control that will '''enable''' and '''disable''' all road traffic
+
*The kuids of the cars must be added to the '''kuid-table''' container of the config.txt file
+
For example, the following entries will specify just 4 moving vehicles for the region.
+
car0                                    <kuid:329364:1568>
+
car1                                    <kuid:309161:100599>
+
car2                                    <kuid2:329364:1689:1>
+
car3                                    <kuid2:329364:1707:1>
+
 
+
=='''Kuid Table Tag'''==
+
 
+
This must contain the kuid values of the '''Default Junction''' asset (if used) and all the cars specifed in the '''car''' tags. Using the examples shown above, the '''kuid-table''' would be (the kuid order is not important):-
+
  
 +
kuid                                    <kuid:xxxxxxx:yyyyyyy>
 +
username                                "Name for the region"
 +
kind                                    "region"
 +
trainz-build                            3.5
 +
watercolor                              70,135,140
 +
defaultjunction                        <kuid:-1:100553>
 +
ontheright                              1
 +
longitude                              15,13,+1
 +
latitude                                54,30,+1
 +
altitude                                0
 +
car0                                    <kuid:447264:1132>
 +
car1                                    <kuid:447264:1133>
 +
car2                                    <kuid:447264:1134>
 +
category-class                          "YX"
 +
category-era                            "1960s;1970s;1980s;1990s;2000s;2010s"
 +
category-region                        "00"
 +
description                            "Description for the region"
 +
license                                "Licence terms and conditions for the asset"
 +
thumbnails
 +
{
 +
  0
 +
  {
 +
    image                              "thumbnail.jpg"
 +
    width                              240
 +
    height                              180
 +
  }
 +
}
 
  kuid-table
 
  kuid-table
 
  {
 
  {
  0                                     <kuid:329364:1568>
+
  0                                   <kuid:-1:100553>
  1                                     <kuid:309161:100599>
+
  1                                   <kuid:447264:1132>
  2                                     <kuid2:329364:1689:1>
+
  2                                   <kuid:447264:1133>
  3                                     <kuid2:329364:1707:1>
+
  3                                   <kuid:447264:1134>
  4                                    <kuid:61119:24120>
+
 
  }
 
  }
  
='''The Thumbnail Image'''=
+
==Creating a Region==
<table cellpadding="4" bgcolor=#c1e7e7>
+
 
<tr valign="top">
+
Trainz - Content Creation - #30 - Region Assets: [https://youtu.be/pgJdp8JH6Tc Video]
<td>[[file:DotPoint.JPG|link=]]</td>
+
 
<td>'''A thumbnail image MUST be present in the asset'''</td>
+
The simplest way to create a new region is to clone an existing one and make any required changes.
</tr>
+
</table>
+
<br>
+
<table cellpadding="4" bgcolor=#ffffb0>
+
<tr valign="top">
+
<td>[[file:NotePad.PNG|link=]]</td>
+
<td><span style="font-size: 17px;">'''Notes:'''</span><br>
+
The thumbnail image:-
+
*must be in '''JPG''' format.
+
*must be 240 pixels wide by 180 pixels tall.
+
*'''does not''' have to be named ''thumbnail.jpg'' as long as the name used is in the '''Thumbnails''' container in the '''config.txt''' file.
+
</td>
+
</tr>
+
</table>
+
  
='''Using the Asset'''=
+
The files for a region are the config.txt text file and the thumbnail image file.  It is therefore particularly easy to create a region from scratch.
  
Once the new asset has been committed it will be available for use as a '''Region'''.
+
The thumbnail can be created in any image editng program.  It should be 240 pixels wide and 180 pixels high, in JPG format.
  
The region is specified when a new route is created and it can be altered by selecting '''Edit Route''' from the main menu in '''TANE''' or the edit menu in '''TRS19'''.
+
The config.txt file can be created in any text editor, using the above example as a template. Make the changes as required.  Put the config.txt file and the thumbnail image file into a folder.  Open Content Manager and use File \ Import Content (for versions prior to T:ANE) or File \ Import Content Folder (for T:ANE versions), navigate to the folder where the files were placed, and import it.
  
<table width="100%">
+
To test the region, create a new route and select your region as the region for the route, or select an existing route, open it in Surveyor, choose Edit Route from the main menu and select your region from the region list.
<tr valign="top">
+
<td align="right">[[file:BackToTop.png|link=#top|alt=Top|Top]]</td>
+
</tr>
+
</table>
+
  
----
+
==Categories==
----
+
[[Category:Asset KIND|R]]
='''Trainz Wiki'''=
+
{{ORP-bot}}
<table cellpadding="4" bgcolor=#ffffff>
+
<tr valign="top">
+
<td>[[file:TrainzWiki.png|link=]]</td>
+
<td>
+
<span style="font-size: 17px;">'''More Tutorials and Guides to Using Trainz'''</span><br>
+
*'''<span class="plainlinks">[http://online.ts2009.com/mediaWiki/index.php/HowTo How to Guides]</span>'''
+
*'''[[Driver Commands List]]'''
+
*'''[[Session Rule List with Parameters|Session Rules List (Alphabetical) with Parameters]]'''
+
*'''[[Session Rules By Categories With Properties|Session Rules List (Categories) With Parameters]]'''
+
</td>
+
</tr>
+
</table>
+
----
+
This page was created by Trainz user '''<span class="plainlinks">[http://online.ts2009.com/mediaWiki/index.php/User:Pware pware]</span>''' in April 2020 and was last updated as shown below.
+
----
+
[[Category:How-to guides]]
+

Latest revision as of 10:48, 2 April 2021

Contents

[edit] KIND Region

KIND Region provides a set of values that are characteristic of the region that a route is modelling. These values are the location of the region, the vehicles that travel on the roads and whether they travel on the left or the right, the default junction switches and the color of the water.

A region asset is selected for a route when the route is created. It can be changed in Surveyor when the route is edited. A region does not necessarily correspond to a particular physical or political area - it can be defined as required to reflect the settings that should apply to the route.

[edit] KIND Hierarchy

[edit] Parent Classes

  • none.

[edit] Child Classes

  • 'KUID defined assets for vehicle traffic particular to the region and for the default junction switch.

[edit] Supported Tags

The KIND Region config.txt file supports the following tags (in addition to the tags that are available to all assets). Each tag is shown here with its default value.

watercolor      0,0,0
defaultjunction <nullkuid> 
ontheright      0
longitude       153.0,2.0,1.0
latitude        27.0,28.0,-1.0
altitude        0
car0            <nullkuid>
  ...
car15           <nullkuid>

[edit] kind

Type: String "region"
Compulsory: Yes from 3.4
Default: n/a
Desc: Identifies the asset as Kind Region.

[edit] watercolor

Type: Integer list
Compulsory: Yes from 3.4
Default: 0,0,0
Desc: RGB vaues for the color of the water placed in the routes that use this region. This color will be adjusted by the color settings for the route, including time-of-day adjustments.

[edit] defaultjunction

Type: Kuid
Compulsory: Yes from 3.4
Default: <nullkuid>
Desc: The KUID of a junction switch lever. This lever will be automatically placed on the route when a junction is created, if the user has selected to auto-add junction switch levers.

[edit] ontheright

Type: Boolean
Compulsory: Yes
Default: 0
Desc: If True (1) then vehicles will travel on the right-hand side of the road. If false (0) then vehicles will drive on the left-hand side.

[edit] longitude

Type: Float list
Compulsory: Yes from 3.4
Default: 153.0,2.0,1.0
Desc: Three floating-point values specifying the longitude of the region in degrees, minutes and E/W. Longitude East of Greenwich is indicated by the third value of +1, while longitude West of Greenwich is indicated by a value of -1.

[edit] latitude

Type: Float list
Compulsory: Yes from 3.4
Default: 27.0,28.0,-1.0
Desc: Three floating-point values specifying the latitude of the region in degrees, minutes and N/S. Latitude North of the Equator is indicated by the third value of +1, while latitude South of the Equator is indicated by a value of -1. Latitude is used as part of the seasonal calculations and in relation to the angle of the sun.

[edit] altitude

Type: Float
Compulsory: Yes from 3.4
Default: 0.0
Desc: Height of the region in metres. Height is used in some seasonal calculations.

[edit] car0

Type: kuid
Compulsory: No. The car will not exist if the tag is not present.
Default: n/a
Desc: KUID of a car that will travel on any roads in the region that are traffic-enabled. Note that this KUID must refer to an asset that is correctly indicated as a car used for roads: kind 'scenery', category-class 'VL' and trackside 0.01 (the value for this can vary if necessary).

Tags 'car1' through 'car14' can be used for an additional 14 cars. The maximum available for a region is 15 cars. They should be used in sequence from car0 to car14.

See the following two guides for making car asset for use with regions.

HowTo/Build_a_Car_for_Traffic_(stand-alone_version)

HowTo/Build_a_Car_for_Traffic_(mesh_library_version)

[edit] Example Config.txt

kuid                                    <kuid:xxxxxxx:yyyyyyy>
username                                "Name for the region"
kind                                    "region"
trainz-build                            3.5
watercolor                              70,135,140
defaultjunction                         <kuid:-1:100553>
ontheright                              1
longitude                               15,13,+1
latitude                                54,30,+1
altitude                                0
car0                                    <kuid:447264:1132>
car1                                    <kuid:447264:1133>
car2                                    <kuid:447264:1134>
category-class                          "YX"
category-era                            "1960s;1970s;1980s;1990s;2000s;2010s"
category-region                         "00"
description                             "Description for the region"
license                                 "Licence terms and conditions for the asset"
thumbnails
{
 0
 {
   image                               "thumbnail.jpg"
   width                               240
   height                              180
 }
}
kuid-table
{
 0                                    <kuid:-1:100553>
 1                                    <kuid:447264:1132>
 2                                    <kuid:447264:1133>
 3                                    <kuid:447264:1134>
}

[edit] Creating a Region

Trainz - Content Creation - #30 - Region Assets: Video

The simplest way to create a new region is to clone an existing one and make any required changes.

The files for a region are the config.txt text file and the thumbnail image file. It is therefore particularly easy to create a region from scratch.

The thumbnail can be created in any image editng program. It should be 240 pixels wide and 180 pixels high, in JPG format.

The config.txt file can be created in any text editor, using the above example as a template. Make the changes as required. Put the config.txt file and the thumbnail image file into a folder. Open Content Manager and use File \ Import Content (for versions prior to T:ANE) or File \ Import Content Folder (for T:ANE versions), navigate to the folder where the files were placed, and import it.

To test the region, create a new route and select your region as the region for the route, or select an existing route, open it in Surveyor, choose Edit Route from the main menu and select your region from the region list.

[edit] Categories

Personal tools