Saxham Market 3-D Virtual Models
The SD3DVM Invisible Level Crossing
Contact Me |
Tutorials Index |
SM3DVM Homw |
My Home Page
Tutorial
How to use an Invisible Level Crossing and Crossing Controller to synchronise
traffic with the SD3DVM Gated Level Crossing
- Start by placing a SM3DVM level crossing on the baseboard.
The yellow marker indicates the centre of the crossing, to assist with the
subsequent lining up of the invisible crossing and the crossing boards.
The other markers indicate the nodes to which track can be attached as follows:
- Blue: the first "main" line
- White: the second "main" line
- Red: the alignment of a trailing crossover between the two main lines.
- Place a SM3DVM invisible level crossing nearby (behind and to the right of the
visible level crossing in this picture).
- Place a SM3DVM level crossing controller on the map (visible in the distance
in this picture, behind the invisible crossing).
This picture shows the level crossing controller in close-up. The arrow should point
toward the invisible crossing.
- Use invisible track (such as the SM3DVM "Invisitrack") to link the end of
the level crossing controller marked with the red pillar to the invisible
level crossing. Include at least intermediate node to allow a junction
to be found in the next step. (I've only included one node here. As it
turned out, it would have been better to include two nodes, which would have
made moving the level crossing controller easier in the later steps)
- Add another length of invisible track to the left of the level
crossing controller, and form a junction with the previously laid track
linking the controller to the invisible crossing. If there are two or more
nodes between the crossing controller and the invisible crossing, make the
junction at the node nearer, or nearest, the invisible crossing. Trainz will
normally add a junction lever automatically, but this lever will be visible in
Driver sessions.
- Delete the junction lever placed automatically by Trainz, and replace it with
an invisible junction lever (e.g. the SM3DVM invisible junction lever).
- In this picture, the invisible level crossing has been moved away from the
visible crossing to make more space available when the time comes to connect
a road.
- Give the level crossing a name. This can be anything (within reason - Trainz
does have limits on the name length and the characters that can be used).
For this tutorial, we'll give the crossing the name
Crossing Name.
- Give the invisible junction lever a name. The SD3DVM level crossing is
scripted to operate a junction lever whose name is formed by appending a space
and "(Control)" to the end of the crossing's own name - so, in this example, the
invisible junction lever is named
Crossing Name (Control).
- Attach roads to the invisible junction. The roads in this example aren't put
in their final alignment yet.
- Attach rails to the invisible junction. As with the roads, the rails
in this example aren't put in heir final alignment yet.
- Move the invisible level crossing into position on the visible crossing, using
the yellow markers at the centre of each to ensure the correct alignment.
- Add level crossing boards.
... and move them on top of the level crossing itself. Again, use the yellow
marker pillars to ensure correct alignment.
- Finally, straighten out the road and rail splines to complete the scenic effect.
|
How it Works
The "invisible" components (the grey objects to the right of the track in the pictures
above will disappear in a Driver session. Provided that everything is set up correctly,
the sequence of events as a train approaches and crosses the level crossing will be:
- The visible level crossing responds to the approaching train by starting to close.
- The visible level crossing is scripted to switch the invisible junction lever
(which it identifies through the names given to the crossing and the lever) to the right.
- The level crossing controller has a dummy wagon placed on it (this is the box with
the arrow on the top). This now has a path set over the invisible level crossing,
which responds by closing. In turn, this stops the traffic on the road attached to the
invisible crossing. The invisible crossing coincides with the visible crossing, so that
the effect is to stop traffic going over the visible crossing.
- After a short delay, the visible level crossing closes each gate in turn.
- The train crosses the level crossing.
- When the train has passed down the line, the visible level crossing starts to open.
- The script opens each gate in turn.
- When both gates are fully open, the level crossing then sets the invisible junction
lever to the left, so that no train now seems to be approaching the invisble crossing.
- The invisible level crossing responds by "opening", allowing road traffic to restart.
Scripted Assets
Both the visible level crossing and the level crossing controller are scripted
(the invisible level crossing and the invisible junction lever aren't, the only thing
Special about those components is that they (along with the level crossing controller
and the invisible track) disappear in a Driver session.
The visible level crossing script animates the level crossing gates and also switches the
lamps on top of each gate off when the gate starts to move and back on when the gate has
opened or closed fully. I haven't found a way of keeping the lamps shining as the gates
move, or at least I haven't found a way of doing this elegantly and without making the
computer do a lot of work that doesn't add that much to the visual effect. The
script also switches a junction lever, which it locates by matching its own name with the
junction lever name, to make it appear to the the invisible level crossing that a train is
on its way.
Troubleshooting
I said before "provided that everything is set up correctly". That was because a few rules
have to be adhered to if the scripts are to recognise and associate the components that need
to work together. Things can go wrong. For example:
- The names of the visible level crossing and the invisible junction lever must match,
otherwise the crossing won't be able to find the lever. If the crossing is named
"Name", then the junction must be named "Name (Control)". Get is wrong, and
road traffic won't stop when the gates close, but will just drive through the gates and
into the path of trains.
- The names are case-dependent, and there must be one, and only one, space
separating the name of the crossing and "(Control)", there must be no spaces after
"(Control)", and round brackets must be used. I might well do some work on the script to
remove some, or all, of these restrictions later, but for the time being the
following combinations won't work:
- "Name" and "NAME (Control)" (case doesn't match)
- "Name" and "Name (control)" ("Control" must be in lower case except for the first letter)
- "Name" and "Name Control)" (Missing bracket)
- "Name" and "Name [Control]" (Square brackets)
- "Name" and "Name (Control)" (Too many spaces)
- "Name" and "Name(Control)" (No space between "Name" and "(Control)")
- "Name" and "Name (Control) " (Extra space at end of junction name)
- If the level crossing controller is too far from the invisible level crossing, the
invisible crossing might not recognise the dummy wagon as an "approaching train", so that
it fails to close, and road traffic will not stop when the gates close. This can be cured
by moving the controller nearer the invisible crossing.
- If the junction operated by the invisible junction lever is too close to the level
crossing controller, then the presence of the dummy wagon on the crossing controller
might stop the junction lever from moving, and road traffic will not stop when the gates
close. This can be cured by moving the junction further away from the controller.
- If there are insufficient nodes in the invisible track linking the level crossing
controller to the invisible level crossing, there might be problems moving the junction
lever or junction node to deal with the previous problem. Either include at least two nodes
between the controller and the invisible crossing when first building the crossing (making
the junction at the node nearer the invisible crossing) or delete the level
crossing controller, move the junction, and place a new level crossing controller.
- On one occasion during testing, the level crossing script gave errors when attempting
to animate the gates or switch the invisible junction lever. This appears to be caused by
moving or replacing the level crossing controller or the invisible junction lever. Closing
Trainz and restarting it resolved this problem.
- If the road is attached to the visible level crossing, then traffic on that road will
stop when the gates close, but drive through the gates as soon as they start to open.
(There is no problem to using the SD3DVM level crossing on its own, without using any of
the invisible level crossing, invisible junction lever, or level crossing controller
assets provided that any road attached directly to the crossing does not
carry traffic, otherwise the sight of cars driving through opening gates will be quite
disturbing!).