Vehicle-running-numbers container

From TrainzOnline
Jump to: navigation, search

The vehicle-running-numbers container is an optional subcontainer used by KIND Traincar assets to define the behaviour of automatic random running-number generation. Support for this subcontainer was added in Trainz A New Era as a faster alternative to various custom scripts which attempt to do the same thing.

Contents

vehicle-running-numbers Container

Example running numbers container:

vehicle-running-numbers
{
  running-numbers                       "35050-35150"
}

Supported Tags

The vehicle-running-numbers container supports the following tags. Each tag is shown here with its default value.

 running-numbers                   ""
 multiple-unit-increment-front
 multiple-unit-increment-rear

running-numbers

Type: Text
Desc: Specifies the valid running-number range(s) to randomly select from. This can be a list, a range, or any combination of both. For example:
 running-numbers                   "12345,67890,30000-31000"

This example will cause the traincar to be randomly assigned the running number 12345, 67890, or any number in between 30000 (inclusive) and 31000 (exclusive). Running numbers are assigned on train placement, and can be overridden using the traincar properties dialog.

multiple-unit-increment-front

Type: Integer
Desc: Optional tag used for assigning sequential/identical running numbers to multiple-unit trains. See the following section for more information about multiple units.

multiple-unit-increment-rear

Type: Integer
Desc: Optional tag used for assigning sequential/identical running numbers to multiple-unit trains. See the following section for more information about multiple units.


Multiple unit trains

The multiple-unit-increment-* tags allow you to define sets of traincars which are automatically numbered identically or sequentially. This is useful for prototypical situations where multiple locomotives may be considered one unit, and thus numbered in some patterned way.

Each of these tags specifies whether the front/rear coupler of the traincar continues the multiple unit set. For example if you have a traincar asset which species only multiple-unit-increment-front, then two of those traincars coupled nose-to-nose will create a 'set'. Without the multiple-unit-increment-rear tag any traincar coupled to the rear will *not* be considered part of the set (regardless of any multiple-unit tag on that other traincar). This means that these tags effectively have no default value, as there presence alone will change the behaviour of the automatic numbering. If you do not want set numbering at all, do not add these tags.

Once a set of compatible traincars exists in a consist the frontmost traincar will be chosen as the 'seed' and given a random running number as normal. The coupled traincar will then be assigned a running-number based on the value of the relevant tag (e.g. multiple-unit-increment-front if the 'seed' traincar is coupled to the front). If this number is 0, the running-number will be identical. A value of 100 will result in adding 100 to the running-number of the seed. Negative values are allowed. This process continues until the end of the set, or until an invalid running-number is generated. Generation of an invalid running-number will result in a new set being created (with the current traincar becoming the new seed).


Asset Creation / Trouble Shooting

There is more information HERE to find out how to put running numbers on your Trainz content.

You can find a How To guide for adding the vehicle-running-numbers container to your asset Here


Return To

Personal tools