@@ -9,7 +9,315 @@ For a full list of parameters, see :ref:`Developing OR Content - Parameters and
99Train Engine Lights
1010===================
1111
12- OR supports the whole set of lights accepted by MSTS.
12+ OR supports the whole set of lights accepted by MSTS, MSTS-bin, and adds many new
13+ options to enhance the variety and complexity of lighting systems that can be recreated.
14+
15+ Lights with multiple conditions
16+ -------------------------------
17+
18+ In the original MSTS light implementation, each light could only have one set of
19+ activation conditions. If the same light were to be activated in multiple situations,
20+ (for example, a light which should turn on for both the front and rear units)
21+ the entire light would need to be included twice, just with different conditions.
22+
23+ .. index ::
24+ single: Conditions
25+
26+ Open Rails now allows for a single light to have multiple ``Conditions () `` blocks.
27+ If *any * one set of conditions is fulfilled, the light will be enabled. If no conditions
28+ are specified, the light will be assumed to be on always. An example of how this can
29+ be used to simplify ``Lights `` implementation is included below::
30+
31+ Light (
32+ comment( Nose light bright )
33+ Conditions (
34+ Headlight ( 3 )
35+ Unit ( 2 )
36+ )
37+ FadeIn ( 0.5 )
38+ FadeOut ( 0.5 )
39+ States ( 1
40+ State (
41+ LightColour ( FFffffe6 )
42+ Radius ( 0.6 )
43+ Position ( 0.0 4.12 6.55 )
44+ )
45+ )
46+ )
47+ Light (
48+ comment( Nose light bright DPU )
49+ Conditions (
50+ Headlight ( 3 )
51+ Unit ( 4 )
52+ )
53+ FadeIn ( 0.5 )
54+ FadeOut ( 0.5 )
55+ States ( 1
56+ State (
57+ LightColour ( FFffffe6 )
58+ Radius ( 0.6 )
59+ Position ( 0.0 4.12 6.55 )
60+ )
61+ )
62+ )
63+
64+ This set of two lights can be simplified to one light like this::
65+
66+ Light (
67+ comment( Nose light bright )
68+ Conditions (
69+ Headlight ( 3 )
70+ Unit ( 2 )
71+ )
72+ Conditions (
73+ Headlight ( 3 )
74+ Unit ( 4 )
75+ )
76+ FadeIn ( 0.5 )
77+ FadeOut ( 0.5 )
78+ States ( 1
79+ State (
80+ LightColour ( FFffffe6 )
81+ Radius ( 0.6 )
82+ Position ( 0.0 4.12 6.55 )
83+ )
84+ )
85+ )
86+
87+ Both of these snippets produce the same result: a light that turns on when the
88+ headlights are bright and the unit is first, or the last unit reversed (ie:
89+ distributed power). However, by specifying multiple conditions, the second
90+ implementation takes up much less space and guarentees that both modes of the
91+ light have the exact same ``States ``. There is no hard limit on the number
92+ of conditions a light can have.
93+
94+ Lights attached to shape sub-objects
95+ ------------------------------------
96+
97+ The standard lighting configuration attaches all lights to the main body of the
98+ locomotive or wagon. While this allows lights to move and rotate as the vehicle
99+ itself moves, the approach has proven insufficient for more complicated rail
100+ vehicles such as articulated steam locomotives.
101+
102+ .. index ::
103+ single: ShapeHierarchy
104+
105+ To facilitate lighting on such locomotives and wagons, Open Rails now allows
106+ for attachment of lights to any sub-object of the shape file. With the
107+ ``ShapeHierarchy `` token placed in a ``Light () `` block, the object the light
108+ will rotate and translate with can be defined using the hierarchy name of said
109+ object. Tools such as Shape Viewer can be used to determine the hierarchy name
110+ of a particular object in the shape file. For example, *"BOGIE1" * is the standard
111+ name for the frontmost bogie. A light attached to this bogie could be created
112+ like so::
113+
114+ Light (
115+ comment( CNDR Side Front Truck Light )
116+ ShapeHierarchy ( "BOGIE1" )
117+ States ( 1
118+ State (
119+ LightColour ( 91fedf91 )
120+ Position ( -1.427 0.583 -0.330 )
121+ Azimuth ( -90 -90 -90 )
122+ Radius ( 0.2 )
123+ )
124+ )
125+ )
126+
127+ Be aware that the ``Position `` of a light is measured relative to the center of
128+ the object to which the light is attached, not to the center of the locomotive
129+ itself. Furthermore, the naming of shape parts is not consistent between all
130+ shape files. If the shape name entered in ``ShapeHierarchy `` is invalid, a
131+ warning will be produced in the log file and the light will attach to the
132+ main body of the locomotive or wagon.
133+
134+ If ``ShapeHierarchy `` is not specified in a light, the light will attach
135+ to the main body of the locomotive or wagon by default.
136+
137+ .. _features-light-conditions :
138+
139+ Open Rails specific lighting conditions
140+ ---------------------------------------
141+
142+ Open Rails also adds a set of new lighting conditions which offer additional
143+ flexibility in creating detailed light behaviors. Note that each of these
144+ must be inside the ``Conditions () `` block of a ``Light () `` in the .eng/.wag
145+ file to function. All conditions are optional and can be mixed and matched
146+ as needed, though only one of each condition can be included per conditions
147+ block!
148+
149+ .. index ::
150+ single: Conditions(ORTSBattery
151+
152+ Battery Switch
153+ ''''''''''''''
154+
155+ The light condition ``ORTSBattery `` allows a light to respond to the state of
156+ the :ref: `battery switch subsystem <physics-battery-switch >`. The valid settings
157+ and associated conditions for the light to turn *on * are as follows:
158+
159+ - ``ORTSBattery ( 0 ) `` Battery state is ignored (default)
160+ - ``ORTSBattery ( 1 ) `` Battery switch must be on
161+ - ``ORTSBattery ( 2 ) `` Battery switch must be off
162+
163+ .. index ::
164+ single: Conditions(Brake
165+
166+ Friction Brakes
167+ '''''''''''''''
168+
169+ The ``Brake `` condition can be used to create brake indicator lights
170+ which turn on or off when the friction brakes are applied. Dynamic brakes
171+ have no effect.
172+
173+ - ``Brake ( 0 ) `` Brake application/release is ignored (default)
174+ - ``Brake ( 1 ) `` Brakes must be released
175+ - ``Brake ( 2 ) `` Brakes must be applied
176+
177+ .. index ::
178+ single: Conditions(Reverser
179+
180+ Reverser
181+ ''''''''
182+
183+ ``Reverser `` is a very powerful condition that gives lights the ability
184+ to be enabled by the selected direction of travel. Note that a flipped
185+ locomotive or wagon will automatically flip the sensed reverser setting
186+ to ensure lights shine in the correct direction. Also, steam locomotive
187+ cutoff values between -10% and 10% will be detected as 'neutral'.
188+
189+ - ``Reverser ( 0 ) `` Reverser direction is ignored (default)
190+ - ``Reverser ( 1 ) `` Reverser direction must be forward
191+ - ``Reverser ( 2 ) `` Reverser direction must be reverse
192+ - ``Reverser ( 3 ) `` Reverser direction must be neutral
193+ - ``Reverser ( 4 ) `` Reverser direction must be forward or reverse
194+ - ``Reverser ( 5 ) `` Reverser direction must be forward or neutral
195+ - ``Reverser ( 6 ) `` Reverser direction must be reverse or neutral
196+
197+ .. index ::
198+ single: Conditions(Doors
199+
200+ Passenger Doors
201+ '''''''''''''''
202+
203+ Many pieces of passenger rolling stock have indicator lights to inform
204+ the crew :ref: `passenger doors <features-passenger-doors >` are open. The
205+ ``Doors `` condition is suited to this type of lighting.
206+
207+ - ``Doors ( 0 ) `` Passenger doors are ignored (default)
208+ - ``Doors ( 1 ) `` Passenger doors must all be closed
209+ - ``Doors ( 2 ) `` Passenger doors on the left must be open
210+ - ``Doors ( 3 ) `` Passenger doors on the right must be open
211+ - ``Doors ( 4 ) `` Passenger doors on both sides must be open
212+ - ``Doors ( 5 ) `` Passenger doors on either the left or right must be open
213+
214+ .. index ::
215+ single: Conditions(Horn
216+ single: ORTSHornLightsTimer
217+
218+ Horn (Automatic Flashing Ditch Lights)
219+ ''''''''''''''''''''''''''''''''''''''
220+
221+ Open Rails now supports the ability to configure flashing ditch lights
222+ (or any other type of horn activated auxiliary lighting)
223+ with the ``Horn `` light condition. When the horn is sounded, lights
224+ with the horn condition will (de)activate, and remain (de)activated
225+ for a time after the horn stops sounding. The standard timer is 30
226+ seconds, but can be changed by placing a ``ORTSHornLightsTimer ``
227+ token in the ``engine() `` section of the locomotive with flashing lights.
228+ If ``ORTSHornLightsTimer( 0s ) `` is set, the lights will only activate
229+ while the horn is sounding and immediately stop afterward.
230+
231+ - ``Horn ( 0 ) `` Horn state is ignored (default)
232+ - ``Horn ( 1 ) `` Horn must not have been sounded recently
233+ - ``Horn ( 2 ) `` Horn must have been sounded recently
234+
235+ Note that the solid ditch lights state should use ``Horn(1) `` to
236+ prevent these lights overlapping the flashing state. An example
237+ implementation of a flashing ditch light's conditions (many other
238+ details removed for clarity) is provided below::
239+
240+ Light (
241+ comment( Right ditch light )
242+ Conditions (
243+ Headlight ( 3 )
244+ Unit ( 2 )
245+ Horn ( 1 )
246+ )
247+ States ( 1
248+ State (
249+ LightColour ( FFFFFFFF )
250+ Radius ( r )
251+ Position ( x y z )
252+ )
253+ )
254+ )
255+ Light (
256+ comment( Right ditch light Flashing )
257+ Conditions (
258+ Headlight ( 3 )
259+ Unit ( 2 )
260+ Horn ( 2 )
261+ )
262+ States ( 2
263+ State (
264+ LightColour ( FFFFFFFF )
265+ Radius ( r )
266+ Transition ( 1 )
267+ Duration ( 0.5 )
268+ Position ( x y z )
269+ )
270+ State (
271+ LightColour ( FFFFFFFF )
272+ Radius ( r )
273+ Transition ( 1 )
274+ Duration ( 0.5 )
275+ Position ( x y z )
276+ )
277+ )
278+ )
279+
280+ .. index ::
281+ single: Conditions(Bell
282+ single: ORTSBellLightsTimer
283+
284+ Bell (Automatic Flashing Ditch Lights)
285+ ''''''''''''''''''''''''''''''''''''''
286+
287+ Similar to ``Horn ``, the ``Bell `` condition is useful for replicating
288+ systems with flashing lights activated by the bell, though this is
289+ less common than using the horn. Like with the horn, a timer can be
290+ set to keep the lights activated for a time after the bell starts ringing.
291+ Unlike with the horn, this timer is set to 0 seconds by default, meaning
292+ the lights will only remain (de)activated while the bell is currently ringing.
293+ If a timer is desired, ``engine(ORTSBellLightsTimer `` can be used in
294+ the locomotive's .eng file.
295+
296+ - ``Bell ( 0 ) `` Bell state is ignored (default)
297+ - ``Bell ( 1 ) `` Bell must not have been ringing recently
298+ - ``Bell ( 2 ) `` Bell must have been ringing recently or is ringing now
299+
300+ .. index ::
301+ single: Conditions(Brake
302+
303+ Multiple Unit Configuration (Locomotives Only)
304+ ''''''''''''''''''''''''''''''''''''''''''''''
305+
306+ Some MU systems send headlight signals through the wires connecting locomotives,
307+ but do not or cannot send these signals through wagons/coaches to remote
308+ locomotives (eg: distributed power, banking locomotives, etc.). The ``MU ``
309+ light condition allows for some flexibility in adjusting light behavior depending
310+ on a locomotive's physical connection to the lead locomotive (or lack thereof).
311+ While meant for locomotives only, wagons are always treated as remote locomotives
312+ for the purposes of calculation.
313+
314+ - ``MU ( 0 ) `` Locomotives's connection to the lead locomotive is ignored (default)
315+ - ``MU ( 1 ) `` Locomotive must be the lead locomotive itself
316+ - ``MU ( 2 ) `` Locomotive must be in the same group of locomotives as the lead locomotive
317+ - This condition will also be fulfilled for the lead locomotive itself.
318+ - ``MU ( 3 ) `` Locomotive must be in a different group to the lead locomotive
319+
320+
13321
14322Tilting trains
15323==============
@@ -588,7 +896,7 @@ the ``.load-or`` files in a consistent way: ``40HCtriton.load-or`` is suggested
588896container type and ``triton `` the brand painted on the container.
589897
590898Format of the .load-or file
591- '''''''''''''''''''''''
899+ '''''''''''''''''''''''''''
592900
593901Here below a sample of a ``.load-or `` file::
594902
@@ -1217,6 +1525,8 @@ shape movement, however for greater accuracy the modeler can add specific values
12171525``ORTSLengthAirHose ``. In addition the length values suggested in the Derailment Coefficient should
12181526also be added.
12191527
1528+ .. _features-passenger-doors :
1529+
12201530Passenger doors
12211531===============
12221532
0 commit comments