INTRODUCTION
In this tutorial, we will continue to add the speed restrictions. AWS warnings will also be added and the end of the route protected with TPWS. Signalling will also be introduced.
Throughout this series of tutorials, pre-existing code will be coloured blue and changes being made to the code will be shown in red. New code to be added will be coloured green.
Objects required for this tutorial may be found here….
DL_TUTORIAL_2_1 objects.zip. These should be unzipped to the directory …\OBJECTS\DLTUTORIAL_2.
The route file we shall start this series with is available here.....
DLTUTORIAL_2_1_start.zip.
This route is operationally identical to that which we constructed previously except for the addition of a run into a siding at the end of the route and the introduction of a crossover after the third station. These have been made using the principles outlined in previous tutorials - the reasons for their inclusion will become apparent as this tutorial progresses.
An improved track texture has also been used and the ground object has been slightly modified so that the ballast shoulder is revealed. Rain has been removed by deleting the ‘beacon 21’ commands.
It is worth noting that the principles for implementing permanent speed restrictions given here are equally applicable to temporary speed restrictions (although the signage will obviously differ).
Time to open the route file and get coding…
In the previous tutorial, we started imposing speed restrictions at appropriate locations on the route using the limit command,
.limit x,
Where x is the speed limit to be imposed (in kmh)
Speed limits are already in place for the start of the route and on the approach to the second station. The next location where a speed limit sign is needed is on the exit from the second station. Here, we will have different speed limits on the straight mainline and on the branch we are travelling on. Although the signs display two different limits, we need only consider the one applicable to the route we will be travelling on, the speed limit sign for the straight mainline track being purely decorative.
A suitable free object has been included in the object downloads, but before use, we must index this in the ‘with structure’ section of the route file. This can be achieved by adding the code
.freeobj(22) DLTUTORIAL_2\warning_20.x,
.freeobj(23) DLTUTORIAL_2\limit_90_20L.csv,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
Now we can position our sign at the correct location. Because there is no change to the speed limit on the running line at this point, a limit command is not required.
Once clear of the pointwork and associated curve, the line speed can be increased. Although at the moment, the following 2km are dead straight and flat, once we start adding scenic elements, the nature of this section of the route will change to reflect it’s branchline status. We therefore need a speed limit to reflect the secondary nature of the branch and 60MPH is suggested. Once again, the object file for the speed limit sign needs to be indexed;
.freeobj(23) DLTUTORIAL_2\limit_90_20L.csv,
.freeobj(24) DLTUTORIAL_2\limit_60.x,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
before placing the free object and using the limit command to implement the speed limit;
3100,.curve 0;0,.railtype 0;1,.railtype 1;1,.rail 2;5.05;0;52,.rail 3;8.55;0;52,
3125,.rail 2;10.13,.rail 3;13.63,
.freeobj 0;24,.limit 97,3150,.rail 2;15.21,.rail 3;18.71,
The final speed restriction needed is for the turn back siding (the construction of this was not covered in previous tutorials although the principles used were as described). Here, a dead-end siding is being entered via a low radius switch. This situation requires a suitably low speed limit and 5MPH is suggested. As usual, the free object needs to be indexed before use;
.freeobj(24) DLTUTORIAL_2\limit_60.x,
.freeobj(25) DLTUTORIAL_2\Limit_5L.csv,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
And then the object needs to be positioned and the speed limit enforced;
5150,.freeobj 0;11;0;0;180,.railtype 0;1,
5475,.railtype 1;52,
.freeobj 0;25,.limit 9,5500,.railstart 2;0;0;53,.railtype 0;53,.freeobj 0;12;0;0;7.15,.curve -100;0,
All of the speed limits have now been added to the running line.
We should not forget that on adjacent tracks, signage will also be present and that for added realism, this should be included where appropriate.
On our route, there would be speed limit signs at the approach to the diverging junction (entering the second station) and leaving the second station. The backs of signs therefore needed to be added at these locations, firstly by indexing the object;
.freeobj(25) DLTUTORIAL_2\Limit_5L.csv,
.freeobj(26) DLTUTORIAL_2\limit_back.x,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
and then positioning these in the desired locations - note that the x distance is included otherwise the object would be positioned on the left hand side of the track (as viewed),
For the exit from the second station, a single back of sign object needs positioning;
2425,.railtype 0;5,.rail 1;3.5,.curve -1000;0,.railtype 1;12,
.freeobj 0;26;8.1,Whereas on the approach to the second station, two objects are required, one on the adjacent track and one on the straight mainline track;
3125,.rail 2;10.13,.rail 3;13.63,.freeobj 0;24,.limit 97,
.freeobj 0;26;8.1,.freeobj 2;26;8.1,Notice that the position for the object in the straight mainline section has been referenced to rail 2, the left hand of the two tracks. It would be equally valid to position this object (and indeed all others) with reference to any of the other rails, e.g., try making the change,
3125,.rail 2;10.13,.rail 3;13.63,.freeobj 0;24,.limit 97,.freeobj 0;26;8.1,
.freeobj 3;26;4.6,Knowing that rail 3 is 2.5m to the right of rail 2, the resultant position of the object will be identical.
For completeness, the final sign objects to be added for travelling in the opposite direction are warnings for the 20MPH limit on the approach to the junction. As usual, the object needs to be indexed in the with structure section of the route;
.freeobj(26) DLTUTORIAL_2\limit_back.x,
.freeobj(27) DLTUTORIAL_2\warning_back.x,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
These should be placed 975m from the restriction (guidelines regarding the positioning of warning signs can be obtained from rgsonline);
3825,.railend 2;152.37,.railend 3;155.87,
4100,.freeobj 0;27;8.1,.freeobj 2;27;8.1,
4500,.freeobj 0;1,
Now that the signs are in place, the next job is to implement the automatic warning system (AWS). This is generally positioned 183m before the warning and will therefore be required at 917m.
To enable the AWS warning sound, a ‘beacon’ must be defined by adding
.Ground(1) DLTUTORIAL_2\ground1.csv,
.Beacon(1) brsigs\awsmagnet_1.x,
.Freeobj(1) DLTUTORIAL_2\stop_500m.csv,
Before locating the AWS beacon at 917m;
800,.curve 0;0,.railtype 0;51,.railtype 1;51,
917,.Beacon 44001;1;1;0,
1025,.railtype 0;20,.railtype 1;1,
The parameters associated with the beacon command are required to ensure correct functionality and normally need not be altered.
Having fitted the AWS warning and magnet on the running line, a magnet is also required on the adjacent track at a position 183m before the warning board. We can use the AWS magnet supplied with the BR signals, indexing our free object thus (note how a different directory has been used);
.freeobj(27) DLTUTORIAL_2\warning_back.x,
.freeobj(30) brsigs\awsmagnet_1.x,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
Before placing it in the correct position;
4100,.freeobj 0;27;8.1,.freeobj 2;27;8.1,
4283,.freeobj 1;30,
4500,.freeobj 0;1,
That’s the speed limits and associated warnings finished - the 5MPH limit at the entrance to the turn back siding does not require advance warning signs or AWS fitment as it will be signal controlled.
Our next job is to position buffer stops in the siding and protect these with TPWS - as would be required at a terminal platform (note - in practice, some terminal locations are exempt from TPWS fitment).
The buffer stops should be positioned at or beyond the end of the terminating stations stopping range, looking at the code we see..
5700,.sta yourname4; 09.3900;09.4000;;-1;;;;30;30;;0,
5725,.stop 0;50,50,
5850,.railtype 0;53,.curve 4000,
The train is therefore required to stop between 5675 - 5775m and we should position our buffer stops slightly beyond this point, for example at 5800m. As usual, the free object needs to be indexed;
.freeobj(30) brsigs\awsmagnet_1.x,
.freeobj(31) DLTUTORIAL_2\bufferstop.x,
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
And then added to the route;
5725,.stop 0;50,50,
5800,.freeobj 0;31,
5850,.railtype 0;53,.curve 4000,
To be able to add TPWS, we must treat the buffer stops as a red signal.
Before introducing signalling onto the route, we need to define the signal objects which may be used in the ‘with structure’ section of the route. The BR signals are freely available from Trainsimcentral ( http://www.trainsimcentral.co.uk/misc.htm ) and are used in the majority of UK non-underground routes (although in practice any series of bitmap images can be used for a signal object).
To enable the use of standard BR signals, add the following code;
Texture.Background(0) DLTUTORIAL_2\background_1.bmp,
Signal(1).Load brsigs\signal2g; brsigs\glow2g
Signal(2).Load brsigs\signal2y; brsigs\glow2y
Signal(3).Load brsigs\signal3; brsigs\glow3
Signal(4).Load brsigs\signal4yg; brsigs\glow4yg
Signal(5).Load brsigs\repeat; brsigs\glowrepeat
Signal(6).Load brsigs\signal3featherl; brsigs\glow3
Signal(7).Load brsigs\signal3featherr; brsigs\glow3
Signal(8).Load brsigs\signal4ygfeatherl; brsigs\glow4yg
Signal(9).Load brsigs\signal4ygfeatherr; brsigs\glow4yg
Signal(10).Load brsigs\signal2callon; brsigs\glow2g
Signal(11).Load brsigs\signal3callon; brsigs\glow3
Signal(12).Load brsigs\signal4callon; brsigs\glow4yg
Signal(13).Load brsigs\signal2gy; brsigs\glow2gy
It is unlikely all of these types will be used in any route, but they will be there if needed.
A full description of the signal types is provided with the BR signals download (..\Object\BrSigs\bve4_signal_instructions.htm - do take time to read this).
To add the ‘signal’ by the buffer stops and to hide it out of view, we make use of sigf and section commands;
.SIGF M;N;X;Y,
Where M is the index of the signal object as defined in the ‘with structure’ section of the route file
N must be 1 for the signal to function correctly
X is the distance, in metres, to the left (negative) or right (positive) of the running rail
Y is the distance, in metres, below (negative) or above (positive) the running rail where the signal head is to be located.
.SECTION A;B;C;D,
The section command defines sequence of signal aspects to be displayed; for standard BR signals the following applies-
0 = red (stop)
2 = single yellow (caution)
3 = double yellow (caution)
4 = green (clear)
For 2 aspect signals, only include values for A and B,
For 3 aspect signals, only include values for A, B and C,
For 4 aspect signals, include all parameters.
All will become clear when we start adding signals to the route!
It is worth noting that a single aspect signal object could be constructed and used for our buffer stops, but lets get used to using the standard signals first!
For our ‘red signal’, we can make use of a two aspect red/green signal and use the .section command to permanently display a red aspect by adding the following code;
5725,.stop 0;50,50,
5800,.freeobj 0;31,
.sigf 2;1;-8;0.005,.section 0;0,5850,.railtype 0;53,.curve 4000,
Here, sigf 2 defines the signal type as being a 2 aspect red / yellow signal (in practice we can use any signal type capable of displaying a stop aspect). It has been positioned 8m to the left of the running line at a height of 5mm, which effectively hides it under the ground.
By using .section 0;0, the signal can only display a red aspect (normally, this signal would be associated with .section 0;2,).
We now have a functioning red signal on the route, even if we have buried it out of sight.
Before we can go for a test drive, we need to add a signal just after the last station (otherwise the guard will refuse to allow the train to start). We can do this by adding the following code;
5000,.Stop 0;10;10,.freeobj 0;2,
5050,.sigf 1;1;-7;2.005,.section 0;4,
5100,.freeobj 1;11,.railtype 1;53,
This will position a two aspect red / green signal (sigf 1) which may display red or green aspects as required.
Try changing this signal type, for example using
5050,.sigf 4;1;-7;2.005,.section 0;2;3;4,
will display a 4 aspect signal, or5050,.sigf 11;1;-7;2.005,.section 0;2,
will display a two aspect signal with a calling on subsidiary signal - much better suited to the requirements of the route.If the train is now driven through the buffer stop, BVE will give the standard warning of passing a signal at danger.
We will complete the signalling in the next tutorial, but before then we still need to add TPWS protection to the buffer stops. This requires use of another beacon command, in this instance adding….
5725,.stop 0;50,50,
5775,.Beacon 44003;0;1;0,
5800,.freeobj 0;31,.sigf 2;1;-8;0.005,.section 0;0,
As with many of the beacon commands used to control signalling aspects, it is best to consider the associated parameter as being fixed - changing them can have unpredictable effects.
The only way to hit the buffers now will be if the speed limit is exceeded or the TPWS is isolated - go for a drive to check this is true!
The route file should now look like this after all the additions made in this tutorial.....
DLTUTORIAL_2_1_final.zip.
In the next tutorial we will continue adding signals to the route (although there won’t be many as the route is so short!) and add the signal poles and other details, including working AWS and TPWS.