By putting a Brake ( x ) lighting condition in the lighting code, we can also potentially simulate things like brake lights on streetcars and light rail vehicles, which often share their right-of-way with common automobile traffic.:
x: 0 = ignore, 1 = brake released, 2 = brake applied
To fine-tune the triggering of the brake lighting conditions, the parameters ORTSBrakeLightAppliedToReleasedPressure ( x ) and ORTSBrakeLightReleasedToAppliedPressure ( x ). Where ( x ) indicated the pressure that (in the case of ORTSBrakeLightAppliedToReleasedPressure) the brake cylinder must drop below in order to change the lights from their "brake applied" state to their "brake released" state, or (in the case of ORTSBrakeLightReleasedToAppliedPressure) the pressure the brake cylinder must rise above in order to change the lights from their "brake released" state to their "brake applied" state.
If the vehicle's handbrakes are to influence the status of the brake lights, then the parameter ORTSDoesHandbrakeTriggerBrakeLight ( x ) can be added.
Here's an example code:
Light ( comment( Left Side brake applied (yellow) light dim, front ) Type ( 0 ) Conditions ( Headlight ( 2 ) Unit ( 0 ) Brake ( 2 ) ORTSBrakeLightReleasedToAppliedPressure ( 25psi ) ORTSDoesHandbrakeTriggerBrakeLight ( 1 ) ) FadeIn ( 0.5 ) FadeOut ( 0.5 ) Cycle ( 0 ) States ( 1 State ( Duration ( 0.0 ) LightColour ( ffffff33 ) Position ( -1.575 2.645 -11.01 ) Azimuth ( 0 0 0 ) Transition ( 0 ) Radius ( .15 ) ) ) ) L ight ( comment( Left Side brake released (green)light dim, front ) Type ( 0 ) Conditions ( Headlight ( 2 ) Unit ( 0 ) Brake ( 1 ) ORTSBrakeLightAppliedToReleasedPressure ( 10psi ) ORTSDoesHandbrakeTriggerBrakeLight ( 1 ) ) FadeIn ( 0.5 ) FadeOut ( 0.5 ) Cycle ( 0 ) States ( 1 State ( Duration ( 0.0 ) LightColour ( ff00ff00 ) Position ( -1.58 2.595 -11.01 ) Azimuth ( 0 0 0 ) Transition ( 0 ) Radius ( .15 ) ) ) )
Other lighting conditions can potentially include:
Reverser ( x ): The position of the locomotive's reverser determines whether the light is on or off. x: 0 = ignore, 1 = Forward Only, 2 = Reverse Only, 3 = Neutral Only, 4 = Forward and Reverse Only, 5 = Forward and Neutral Only, 6 = Reverse and Neutral Only. In the case of steam locomotives, "Neutral" is defined as anything between +10 (Forward) and -10 (Reverse). Anything above +10 is considered "Forward" and anything below -10 is considered "Reverse". This can be potentially used to define light "spheres" or "cones" for rear headlights on steam tenders so they only turn on for reverse movements and are off at all other times (and likewise the front headlight cone on the loco is disabled when the reverser is in Reverse).:
Light ( comment ( Sphere of Tender Backup Light ) Type ( 1 ) Conditions ( Headlight ( 3 ) TimeOfDay ( 0 ) Service ( 2 ) Unit ( 3 ) Control ( 0 ) Reverser ( 2 ) ) Cycle ( 0 ) FadeIn ( 1 ) FadeOut ( 1 ) States ( 1 State ( Duration ( 0.0 ) LightColour ( ffffe3b5 ) Position ( 0 3.17 -6.60 ) Azimuth ( -180 -180 -180 ) Transition ( 0 ) Radius ( 1000.0 ) Angle ( 22.5 ) ) ) )
Other possible conditions include Doors ( x ) where the lighting is determined by the state of the vehicle's doors. x: 0 = ignore, 1 = all doors closed, 2 = left doors open, 3 = right doors open, 4 = both doors (left AND right) open, 5 = Either (left OR right) door open.
Please feel free to suggest any other conditions that might be of importance.