Lighting settings in MSTS

Setting requirements

The first thing you must specify is when you want the light or lights in question to come on.  This is done by setting a number of flags to define the requirements for the lights concerned to light – if no requirements are listed, the light will always be on.

Possible Requirements


Type
	( 0 )   the light is actually a 2-polygon square, the appearance of which is controlled
              by a combination of parameters in Conditions and States
	( 1 )   the so-called "sphere of Light" - the beam thrown by the loco:
              works only on player locomotives (not AI)

Conditions (
	Headlight (0)  (ignore headlight control status)
	Headlight (1) (the headlight control is at “Off”)
	Headlight (2)  (the headlight control is at “Dim”)
	Headlight (3)  (the headlight control is at “Bright”)

	Unit (0) (ignore unit status)
	Unit (1) (the unit is in the train but isn’t at the front or back)
	Unit (2) (the unit is the frontmost unit of the train)
	Unit (3) (the unit is the rearmost unit of the train)

	Penalty (0) (ignore penalty status)
	Penalty (1) (the train has not “stopped due to a penalty brake application”)
	Penalty (2) (penalty) (the train has stopped due to a penalty brake application”
		(useful for specifying an emergency warning light)

	Control (0) (ignore control status)
	Control (1) (the player is not control of the unit
                 [i.e. it is a helper locomotive, AI locomotive or wagon])
	Control (2) (the player is in control of the unit)

	Service (0) (ignore service status)
	Service (1) (the unit is not in service e.g. a failed train lying in a siding)
	Service (2) (the unit is in service)

	TimeOfDay (0) (ignore time of day)
	TimeOfDay (1) (only come on if it’s daytime)
	TimeOfDay (2) (only come on if it’s night)

	Weather (0) (ignore weather)
	Weather (1) (only come on if it’s fine)
	Weather (2) (only come on if it’s raining)
	Weather (3) (only come on if it’s snowing)

Hang on, you say, you've left out Coupling()
So I have, but then so did Kuju when they left out the code in the Sim to make it work!

FadeIn
	( nn )  nn = time in seconds from fully off to fully on
FadeOut
	( nn )  nn = time in seconds from fully on to fully off

States
	( zz )  nn = number of states (each state represents a different light setting,
             (flash on/off, flash different colours, etc

State
	Define each state: there must be the same number of definitions as zz above
	
	Duration ( nn )		nn - duration of multi-state light in seconds
				leave at zero for single state
	LightColour ( ffrrggbb )transparency, red, green, blue (in hex)
	Position ( xx yy zz )	of light from origin of model
	Transition ( 0 )
	Radius ( nn )		nn = length of beam thrown [type ( 1 ) only]
	Radius ( nn )		nn = radius of light [type ( 0 ) only]
	Angle ( nn )		nn = width of beam in degrees [type ( 1 ) only]
	Azimuth ( xx yy zz )	in degrees
	Elevation ( xx yy zz )	in degrees