TrainzObjectz
A UK Company
Randomizing a Trainz Layout - 3    

MAIN MENU
=================
Home Page

Downloads

Tutorials

KUID List

Search this Site

Other UK Content

TaFWeb Software Home Page

Text-only version of web site (suitable for page readers)





Using RandScriptz to Randomize a Layout
Back


Part 3 - Entering the Randomization Data


Click the Insert Consist button in the toolbar (or select Insert Consist from the right-click context menu). In the dialog which appears next, select the Settings which you saved on page 1 of the tutorial in which you had placed a piece of rolling stock on each trackmark (otherwise called a startmark) - in my case ProteusMarks. A list of the trackmark numbers will appear on the right-hand side of the dialog box. In Proteus Yard Consist 0 was not randomized, so Consist Number was initially set to 1 - your layout requirements may differ, of course. Having set the first randomized consist number you need to enter the trackmark at which it will start. This can be a single trackmark number if you always want it to start in the same place, or a series of numbers separated by commas - in which case one of them will be chosen at random each time you use the layout. Rather than typing the numbers into the edit box you can double-click the list on the right to enter them. Either way (provided the trackmark number is correct) RandScriptz will automatically add the appropriate Startdir (or starting direction). Please ensure that each trackmark is used once only, otherwise it is possible that the randomizer will try and assign two consists to the same trackmark! When you have finished entering the trackmarks for the first consist, click the Start button to enter the details into the box at the top of the dialog box.

The next stage is to specify how the consist is to be made up. In the case of Proteus Yard the first randomized consist is made up of one locomotive chosen from List 0 and between 8 and 14 wagons chosen from List 1, so two entries are necessary. The locomotive details must be done first: set the Min. and Max. boxes both to 1. Set the List no. to 0, and leave the chance as 1:1 (which means that this consist will always appear on the layout). The Abort if not included checkbox and the All same kind checkbox should be left unchecked. Now click the Add button to add it into the box at the top of the dialog box.

For the wagons, set the Min. box to 8 and the Max. box to 14, the List no. to 1, and leave the rest as they were for the locomotive. Again click the Add button. This completes the randomization of the first consist, so press the OK button at the bottom of the dialog box to add everything to the main script.

Screenshot 2

Continue entering the rest of your randomized consists in the same way. A few points should be noted: the Chance box can contain a ratio (for example 1:3) which determines the chances of that item being included. If the Abort if not included checkbox is checked then, if the item is not included this time then the rest of the consist will also not be included. By using the checkbox you can ensure that if a locomotive is not included then the wagons will also not be included. If the checkbox is not checked then you may find that you end up with a locomotive-less consist on your layout! The All same kind checkbox means that whatever number of items (wagons, coaches, etc.) is chosen they will all be the same type. This might be useful if you are making up random passenger trains so that the coaches of the train are all of the same type. You must take care that there are enough choices in your lists to satisfy the maximum needs of your script - this really applies only to the locomotives supplied with Trainz since only four of any one type can be included on a layout. RandScriptz will try and make sure that more than four are not used but if you only have two locomotives in your list and the randomization calls for nine locomotives then the randomizer will fail!

Once you have entered all the randomization data it only remains to add in the initial settings. This step can be ignored if you are not planning to distribute your layout to other people, but is essential if the layout is to be distributed. Simply click the Initial Settings button on the toolbar (or select Initial Settings from the right-click context menu) and then select the name of the real Settings which you previously saved (Proteus Yard in my case). The Settings will be added to the end of the script, and the first time someone else runs the script the Settings will be added into their driversettings.txt file in their copy of Trainz.

Finally, of course, click the Save button on the toolbar and save the script with the same name as your Initial Settings. You now only need to run the RandConsistz program before you start Trainz in order to have a fresh set of trains each time! Now, how does the phrase go? ... oh yes ... "and that's all there is to it!"


Other links you may find of interest:

TaFWeb Software
London, UK
E-mail:

This page URL: http://www.tafweb-trainz.co.uk/randscriptz_tutorial3.html
Last major revision: 1 February 2005 at 23:08
Site created with PageBuilder

Web page created by TaFWeb Design © 2008