Elvas Tower: Headlights - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Headlights Rate Topic: -----

#1 User is offline   X3D 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 35
  • Joined: 28-January 19
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 02 September 2019 - 01:12 AM

After much trial and error with positioning and illumination settings I managed to implement a working light on the L&SE Locos by adding the following:

  Lights ( 2
  Light (
   comment( Hi-intensity light beam )
   Type  ( 1 )
   Conditions (
    Headlight ( 3 )
    Unit ( 2 )
    )
   Cycle ( 0 )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   States ( 1
    State (
     Duration ( 0.0 )
     LightColour ( ffffffdd )
     Position ( 0.0 1.60 10.0 )
     Transition ( 0.8 )
     Radius ( 20.0 )
     Angle ( 10.0 )
     )
    )
   )
  Light (
   comment( Head light bright )
   Type  ( 0 )
   Conditions (
    Headlight ( 3 )
    Unit ( 2 )
    )
   FadeIn ( 0.9 )
   FadeOut ( 0.9 )
   Cycle ( 0 )
   States ( 1
    State (
     Duration ( 0.0 )
     LightColour ( ffffffcc )
     Position ( 0.0 1.60 10.0 )
     Azimuth ( 0.0 -2.0 0.0 )
     Transition ( 0.8 )
     Radius ( 0.5 )
     )
    )
   )


I omitted the shoe sparking code information, what I would like to know is how to add a working dim light?

Thanks, Graeme

#2 User is offline   copperpen 

  • Executive Vice President
  • Group: Status: Elite Member
  • Posts: 3,143
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 02 September 2019 - 02:28 AM

Only two light settings available for headlights, usually bright and dim.

#3 User is offline   X3D 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 35
  • Joined: 28-January 19
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 02 September 2019 - 03:06 AM

Here is an example of an alteration I made to the North Wales Coast 2 - NWC_45048 which has functioning Dim & Bright Light

Lights	( 22
		Light	(
			comment( Sphere of light - forward )
			Type		( 1 )
			Conditions	(
				Headlight ( 3 )
				Unit ( 0 )
                        TimeOfDay ( 2 )
				)
			Cycle	( 0 )
			FadeIn	( 0.25 )
			FadeOut	( 0.5 )
			States	(	1
				State	(
					Duration ( 0.0 )
					LightColour ( ffffffff )
					Position ( 0 3.5 8 )
					Transition ( 0 )
					Radius ( 80.0 )
					Angle ( 15.0 )
					)
				)
			)
                Light	(
			comment( Sphere of light - reverse )
			Type		( 1 )
			Conditions	(
				        Headlight ( 2 )
                                Unit ( 0 )
                                TimeOfDay ( 2 )
				)
			Cycle	( 0 )
			FadeIn	( 0.25 )
			FadeOut	( 0.5 )
			States	(	1
				State	(
					Duration ( 0.0 )
					LightColour ( ffffffff )
					Position ( 0 3.5 0 )     <- Edited 0 3.5 -110 to 0 3.5 0 Dim Light Z-Axis
					Transition ( 0 )
					Radius ( 20.0 )          <- Edited Decreased 80 to 20 Illumination
					Angle ( 15.0 )
					)
				)
			)            


Without changing the z-axis to zero the light encompasses the whole loco, so this fixes that issue.
The problem left to fix is that when changing cabs the light does not follow suit.

Thanks, Graeme

#4 User is offline   slipperman 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 760
  • Joined: 09-February 12
  • Gender:Male
  • Location:North Nottinghamshire
  • Simulator:MSTS & ORTS
  • Country:

Posted 02 September 2019 - 09:22 AM

Hi Graeme,
When using MSTS with the Bin patch or ORTS to swap cabs (and lights), you don't need to specify the 'Sphere of Light' for the 'reverse' cab as it changes automatically. Your example doesn't allow for cab switching - it only shows the light for the 'normal', ie forward, cab.

The Open Rails manual doesn't give any details regarding loco lights, so, if you don't run MSTS you won't be aware of the different parameters and their values. You may be interested in downloading the Bin Patch (v1.8.052113 at the bottom of this page : http://mstsbin.uktra...om/eng/eng.html); after unpacking the .zip file, the manual may be read. If you don't have access to the MSTS documentation (TECHDOCS), for the main lights parameters, try the following :

Earlier this year, I found a lights tutorial, written in Spanish, which I translated and added the additional MSTS Bin Patch parameters, which Open Rails recognises. I haven't uploaded it anywhere officially yet, but if you are interested, it may be downloaded from my Google Drive : https://drive.google...iew?usp=sharing

Cheers,
Ged

#5 User is offline   X3D 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 35
  • Joined: 28-January 19
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 02 September 2019 - 09:41 AM

Hi Ged, I wasn't aware of any parameters previously lol, but I am on a mission to correct the headlight function of all the locos I have within Open Rails, this information you have offered looks ideal, I'll study it later.

Thanks again Ged, Graeme

#6 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,341
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 02 September 2019 - 10:48 AM

Once again... the OR did did not have access to the original KUJU code and when it came to headlights that ignorance prevented implementation of a working light.

Eventually it was decided to regard the light from a headlight as a sphere of illumination, as-if it were just a bulb instead of an assembly of equipment, which meant using radius() to define how large that sphere is. Then to cull all portions of the sphere that are not wanted Angle() was used (FWIW typical light and lens in North American locomotives, a proxy for all others, is about +/- 4 to 5 degrees off a centerline from the headlight on the long axis of the locomotive). The final parameter (name not recalled right now) was to set a direction for that centerline. I believe its values are the same as MSTS.

As an example:
States ( 1
State (
Duration ( 0.0 )
LightColour ( eff9ec95 )
Position ( 0.0 3.3 7.22 )
Transition ( 0 )
Radius ( 400.0 )
Angle ( 5.0 )
)
)

#7 User is offline   X3D 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 35
  • Joined: 28-January 19
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 02 September 2019 - 10:30 PM

The only issue that might demand some serious solving is the cab changing in ORTS because the code I submitted from the Loco in The North Wales Coast 2 was only a part I thought relevant, but I am guessing that when running MSTS the route locos headlights function correctly when switching cabs?

Thanks, Graeme

Here is the full section of code for NWC_45048

Lights	( 22
		Light	(
			comment( Sphere of light - forward )
			Type		( 1 )
			Conditions	(
				Headlight ( 3 )
				Unit ( 0 )
                        TimeOfDay ( 2 )
				)
			Cycle	( 0 )
			FadeIn	( 0.25 )
			FadeOut	( 0.5 )
			States	(	1
				State	(
					Duration ( 0.0 )
					LightColour ( ffffffff )
					Position ( 0 3.5 8 )
					Transition ( 0 )
					Radius ( 80.0 )
					Angle ( 15.0 )
					)
				)
			)
                Light	(
			comment( Sphere of light - reverse )
			Type		( 1 )
			Conditions	(
				        Headlight ( 2 )
                                Unit ( 0 )
                                TimeOfDay ( 2 )
				)
			Cycle	( 0 )
			FadeIn	( 0.25 )
			FadeOut	( 0.5 )
			States	(	1
				State	(
					Duration ( 0.0 )
					LightColour ( ffffffff )
					Position ( 0 3.5 0 )
					Transition ( 0 )
					Radius ( 20.0 )
					Angle ( 15.0 )
					)
				)
			)            
                Light (
			Comment( Headcode forwards light 1 )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( -0.41 1.965 10.39  )
                                        Azimuth ( 0.0 0.0 0.0 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( Headcode forwards light 2 )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( 0.41 1.965 10.39 )
                                        Azimuth ( 0.0 0.0 0.0 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( Headcode backwards light 1 )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( 0.41 1.965 -10.3675  )
					Azimuth ( -180 -180 -180 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
		Light (
			Comment( Headcode backwards light 2 )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( -0.41 1.965 -10.3675  )
					Azimuth ( -180 -180 -180 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( Rear red light right forwards )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 3 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( 0.93 1.59 -10.245 )
					Azimuth ( -180 154 154 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
            Light (
			Comment( Rear red light left forwards )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 3 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( -0.92 1.59 -10.2475 )
					Azimuth ( -180 -154 -154 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
		Light (
			Comment( Rear red light right reverse )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( -0.92 1.59 10.2825 )
					Azimuth ( 0.0 -26.0 -26 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
		Light (
			Comment( Rear red light left reverse )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
				Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( 0.93 1.59 10.28 )
					Azimuth ( 0.0 26.0 26.0 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
      Light (
			Comment( Headcode forwards light 1 Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 5 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( -0.41 1.965 10.39  )
                                        Azimuth ( 0.0 0.0 0.0 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( Headcode forwards light 2 Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 5 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( 0.41 1.965 10.39 )
                                        Azimuth ( 0.0 0.0 0.0 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( Headcode backwards light 1 Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 5 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( 0.41 1.965 -10.3675  )
					Azimuth ( -180 -180 -180 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
		Light (
			Comment( Headcode backwards light 2 Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 5 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( -0.41 1.965 -10.3675  )
					Azimuth ( -180 -180 -180 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( Rear red light right forwards Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 5 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( 0.93 1.59 -10.245 )
					Azimuth ( -180 154 154 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
            Light (
			Comment( Rear red light left forwards Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 2 )
                                Unit ( 5 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( -0.92 1.59 -10.2475 )
					Azimuth ( -180 -154 -154 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
		Light (
			Comment( Rear red light right reverse Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
                                Unit ( 4 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( -0.92 1.59 10.2825 )
					Azimuth ( 0.0 -26.0 -26 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
		Light (
			Comment( Rear red light left reverse Bin )
			Type ( 0 )
			Conditions (
				Headlight ( 3 )
				Unit ( 4 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( 0.93 1.59 10.28 )
					Azimuth ( 0.0 26.0 26.0 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
         Light (
			Comment( AI Headcode light 1 )
			Type ( 0 )
			Conditions	(
				Control ( 1 )
				Service ( 2 )
				Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( -0.41 1.965 10.39  )
                                        Azimuth ( 0.0 0.0 0.0 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
            Light (
			Comment( AI Headcode light 2 )
			Type ( 0 )
			Conditions	(
				Control ( 1 )
				Service ( 2 )
				Unit ( 2 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( a3ffcb98 )
					Position ( 0.41 1.965 10.39 )
                                        Azimuth ( 0.0 0.0 0.0 )
					Transition ( 0 )
					Radius ( 0.325 )
				)
			)
		)
          Light (
			Comment( AI Rear red light right )
			Type ( 0 )
			Conditions	(
				Control ( 1 )
				Service ( 2 )
				Unit ( 3 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( 0.93 1.59 -10.245 )
					Azimuth ( -180 154 154 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
            Light (
			Comment( AI Rear red light left )
			Type ( 0 )
			Conditions	(
				Control ( 1 )
				Service ( 2 )
				Unit ( 3 )
			)
			Cycle ( 0 )
			FadeIn ( 0.5 )
			FadeOut ( 0.5 )
			States ( 1
				State (
					Duration ( 0.0 )
					LightColour ( efe9252a )
					Position ( -0.92 1.59 -10.2475 )
					Azimuth ( -180 -154 -154 )
					Transition ( 0 )
					Radius ( 0.15 )
				)
			)
		)
    	)
	


#8 User is offline   slipperman 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 760
  • Joined: 09-February 12
  • Gender:Male
  • Location:North Nottinghamshire
  • Simulator:MSTS & ORTS
  • Country:

Posted 03 September 2019 - 12:23 AM

Hi Graeme,
As far as I've been able to make out, lights in Open Rails work in exactly the same way as those for MSTS with the Bin patch. I have been changing lights on quite a few units recently and have had no problems with OR. As supplied although 45048 expects the Bin patch to be installed to allow for cab-switching, the lights don't use any of the additional parameter values. Instead, the different 'H' switch settings (Dim & Bright) are used to switch the lights between the front and rear cabviews. IMO this could be coded in a much better way and, if no-one else comes up with a solution for you, I'll look at it later today :)

Cheers,
Ged

#9 User is offline   X3D 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 35
  • Joined: 28-January 19
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 03 September 2019 - 04:02 AM

I managed to add the Dim & Bright function to a bunch of locos that didn't have any working headlights within Open Rails:

These are from L&SE 415-416-201-205-207-414-MLV
The CEP-CIG-VEP just need the position 1.80 10.0 to be altered to 1.60 10.2

The following needs to be pasted in the .eng file above the line - Sound ( "..//..//MT

 Lights ( 1
       Light (
             comment( Bright Light Beam )
             Type  ( 1 )
             Conditions (
                   Headlight ( 3 )
                   Unit ( 2 )
             )
             FadeIn ( 0.5 )
             FadeOut ( 0.5 )
			 Cycle ( 0 )
             States ( 1
                   State (
                         Duration ( 1.0 )
                         LightColour ( ffffffdd )
                         Position ( 0.0 1.80 10.0 )
                         Transition ( 1 )
                         Radius ( 60.0 )
                         Angle ( 15.0 )
                   )
             )
       )
       Light (
              comment( Bright Headlight )
              Type  ( 0 )
              Conditions (
                    Headlight ( 3 )
                    Unit ( 2 )
              )
              FadeIn ( 0.9 )
              FadeOut ( 0.9 )
              Cycle ( 0 )
              States ( 1
                    State (
                          Duration ( 1.0 )
                          LightColour ( ffffffcc )
                          Position ( 0.0 1.80 10.0 )
                          Azimuth ( 0.0 0.0 0.0 )
                          Transition ( 1 )
                          Radius ( 0.5 )
                    )
	          )
       )
       Light (
             comment( Dim Light Beam )
             Type  ( 1 )
             Conditions (
                   Headlight ( 2 )
                   Unit ( 2 )
             )  
             FadeIn ( 0.5 )
             FadeOut ( 0.5 )
             Cycle ( 0 )
             States ( 1
                   State (
                         Duration ( 1.0 )
                         LightColour ( ffffffdd )
                         Position ( 0.0 1.80 10.0 )
                         Transition ( 1 )
                         Radius ( 20.0 )
                         Angle ( 15.0 )
                   )
             )
       )
       Light (
             comment( Dim Headlight )
             Type  ( 0 )
             Conditions (
                   Headlight ( 2 )
                   Unit ( 2 )
             )
             FadeIn ( 0.9 )
             FadeOut ( 0.9 )
             Cycle ( 0 )
             States ( 1
                   State (
                         Duration ( 1.0 )
                         LightColour ( ffffffcc )
                         Position ( 0.0 1.80 10.0 )
                         Azimuth ( 0.0 0.0 0.0 )
                         Transition ( 1 )
                         Radius ( 0.25 ) 
	               )
	         )
       )
 )
 


Any help tweaking the above code would be much appreciated.

Thanks Ged, I believe I will need some guidance with the changing cab feature on some of the other locos, I will experiment with the MSTS Bin numbers first though.

Thanks, Graeme

#10 User is offline   slipperman 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 760
  • Joined: 09-February 12
  • Gender:Male
  • Location:North Nottinghamshire
  • Simulator:MSTS & ORTS
  • Country:

Posted 03 September 2019 - 05:05 AM

Hi Graeme,
Attached is the complete lights section for NWC_45048. It is much shorter than the original because the author attempted to include the standard MSTS lighting with that for the Bin enhancements. If the loco had been used with a standard MSTS installation, several errors would have been reported and I doubt if the loco would have run!!

I have not touched the AI lighting as that seems to be OK. Please replace the whole of the original lights section (including the 4 x close brackets before the Sound line) with the attached, after you've unzipped it!

I have successfully tested the revised lights in MSTS+Bin and Open Rails. Pressing 'H' once (Dim) will cause the white front lights and red rear lights to be illuminated; pressing 'H' again will show the beam of light in front of the loco - the white and red lights will remain illuminated. If the cab is switched (using <Ctrl+E>), the same will occur, with the beam of light appearing in front of the switched-to cab.

If you wish the beam of light to appear in daytime as well as night time, remove the TimeOfDay ( 2 ) line from the Sphere of light sub-section.

I'll have a look at your other query - I believe it's from the London & South East route.

Cheers,
Ged

Attached File(s)



  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users