Elvas Tower: Include files and engine controllers - Elvas Tower

Jump to content

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

Include files and engine controllers Some clarifications Rate Topic: -----

#1 User is offline   joe_star 

  • Fireman
  • Group: Status: Active Member
  • Posts: 191
  • Joined: 16-January 13
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 20 August 2020 - 11:02 AM

Hello

Lately I’ve been dabbling with setting up include files for some msts stock to update or addon the advanced features available in OR

It has been my understanding that open rails looks at both the original Eng file & the include, and implements any new parameters from the OR file as well as taking any of the Standard msts parameters From the include file rather than the .eng file

For eg, If I put wagon mass in the include file, this value is taken rather than the one in the Eng file

This seems to break down for engine controllers though. I have defined new brake Controller and combined control parameters In the include file. What I find is that these are not always being taken. At times OR switches back to the controller settings as defined in the Eng file. This has been observed to happen even in the same simulation session. Usually when it switches to the Eng settings, it remains that way for the entire session

I have then tried commenting out the engine controller section in the .eng file. Now doing this, the engine controller settings in the include file are the ones used.

This appears to be a bug to me, or perhaps it’s implemented so for some reason. I am trying to avoid editing with the original msts Eng files if possible, as I plan to use these include files in a addon concept similar to the std Eng Include files that have been prepared. Having to Edit the Eng files may break msts compatibility, and would addon more effort in applying the changes to many different locomotive

Anyone else successfully implemented engine controllers via include? Or any advice where I might be missing something would be much appreciated

#2 User is offline   Genma Saotome 

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

Posted 20 August 2020 - 12:02 PM

The last read of any parameter is the one that OR keeps. Sounds like you put the .inc file bearing hte controller data before the same lines in the .eng file. That's why they old stuff was kept.

Here is an example of what I'm doing:
SIMISA@@@@@@@@@@JINX0D0t______

Wagon ( S-2_SP_1356ts
	WagonShape ( S-2_SP_1356ts.s )

	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Fixed_Specs.inc"  )
	Include ( "..\\Common.Inc\\Fleet\\DHNelson\\Std_Late_Steam_Era_Diesel_Switcher_Coupler.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Weight.inc"  )
	Include ( "..\\Common.Inc\\Fleet\\DHNelson\\Std_Early_Road_Diesel_Independant_AB_Brake.inc" )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Lights.inc"  )
	Sound ( ALS4eng.sms )
)
Engine ( S-2_SP_1356ts
	Effects (
		DieselSpecialEffects
		(
			Exhaust1
			(
				-0.33 4.58 -0.89
				0 1 0
				.1
			)
		)
	)
	DieselSmokeEffectInitialMagnitude( 1 )
	DieselSmokeEffectMaxMagnitude( 2 )
	DieselSmokeEffectInitialSmokeRate( 1 )
	DieselSmokeEffectMaxSmokeRate( 4 )

	Wagon ( S-2_SP_1356ts )
	CabView ( GenSx-rear.cvf )
	Headout ( 1.6 3.4 -4.9 )

 	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Locomotive_Specs.inc"  )
 	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Locomotive_Controllers.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Monitors.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Air_Compressor.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Brakestand.inc"  )

	EngineBrakesControllerDirectControlExponent( 1 )

	Sound ( ALS4cab.sms )
	Name ( "SP S-2 1356 TS 1944 to 1946" )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Text.inc"  )
)

OpenRails (
	ClassificationTags (
		Ownership (
			Railroad ( "Southern Pacific" )
			Acquired ( 1947 )
			Retired ( 2011 )
			RRClass ( "Unknown" )
		)
		LocomotiveInfo (
			Builder ( "Alco" ) 
			Usage ( Switching )
			Truck_Configuration ( "4-4 ")
			CommonName ( "S-2" )
		)
		Skins (
			Initials ( "SP" )
			Number ( 1356 )
			Paint ( "Tiger Stripe " )
			PaintApplied ( 1944 )
			PaintReplaced ( 1958 )
		)
	)
)


Becuase I never use train.exe for anything I don't need to bother with any odd workarounds to make both work. So this is a pure OR-Only .eng file. All the lines after the final parens is a bunch of study I was trying out as tags. I wsn't satisfied so just ignore that.

#3 User is offline   Lamplighter 

  • Fireman
  • Group: Status: Active Member
  • Posts: 171
  • Joined: 24-January 18
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 20 August 2020 - 08:04 PM

Hi!
Is the ClassificationTags () parameter block Informative only? Or can it be displayed using some SW (eg TSRE5, ORTS)?

#4 User is offline   darwins 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,222
  • Joined: 25-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 20 August 2020 - 09:31 PM

Just a thought...

Just as in code you can have sub routines within sub routines - how about with include files? Can OR include an include file within another include file?


#5 User is offline   Genma Saotome 

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

Posted 21 August 2020 - 08:02 AM

View PostLamplighter, on 20 August 2020 - 08:04 PM, said:

Hi!
Is the ClassificationTags () parameter block Informative only? Or can it be displayed using some SW (eg TSRE5, ORTS)?


OR doesn't know a thing about that data. I was simply working out some thoughts.

#6 User is offline   Genma Saotome 

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

Posted 21 August 2020 - 08:08 AM

View Postdarwins, on 20 August 2020 - 09:31 PM, said:

Just a thought...

Just as in code you can have sub routines within sub routines - how about with include files? Can OR include an include file within another include file?


Yes, I did that a couple of times and decided I didn't care for it as it effectively buried the references. IMO placing all of the references in the .eng or .wag givees you a single view to what's going on.

But there is one place where it could make sense and that's with the lights. You could have one .inc file that is correct for the same class of locomotives but in that .inc file you could reference a bunch of other ,inc files that are pretty specific to the conditions that are available. By that I mean a bright cone of light is different than a dim cone of light so that's two .inc files, but each of those could be used by many different locomotive classes.

#7 User is offline   Genma Saotome 

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

Posted 21 August 2020 - 08:14 AM

One more thought. As you can see in the example I posted I kept in the .eng file those paramaters one could use to make one locomotive look different from another of the same class -- the stuff related to exhaust.

And of course within the common.inc folder I divided things between fleet-wide .inc files and those that were specific to the model. The later are only needed if you have several .engs or .wags of the same model. If the model is a one-of then I'd put those .inc files in the same folder as the model. The reasoning here is you don't want to be sharing .inc files in model folders... consider what happens if you move or delete that folder: the other .eng or .wag files break so for the most part I puy .inc files into \common.inc\models and then to be sure I don't screw up with models of the same thing from different people I add the name of the person who made the model as a folder and then add the name of the model itself. That should be clear when you look again at the example.

#8 User is offline   joe_star 

  • Fireman
  • Group: Status: Active Member
  • Posts: 191
  • Joined: 16-January 13
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 25 August 2020 - 01:59 AM

View PostGenma Saotome, on 20 August 2020 - 12:02 PM, said:

The last read of any parameter is the one that OR keeps. Sounds like you put the .inc file bearing hte controller data before the same lines in the .eng file. That's why they old stuff was kept.

Here is an example of what I'm doing:
SIMISA@@@@@@@@@@JINX0D0t______

Wagon ( S-2_SP_1356ts
	WagonShape ( S-2_SP_1356ts.s )

	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Fixed_Specs.inc"  )
	Include ( "..\\Common.Inc\\Fleet\\DHNelson\\Std_Late_Steam_Era_Diesel_Switcher_Coupler.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Weight.inc"  )
	Include ( "..\\Common.Inc\\Fleet\\DHNelson\\Std_Early_Road_Diesel_Independant_AB_Brake.inc" )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Lights.inc"  )
	Sound ( ALS4eng.sms )
)
Engine ( S-2_SP_1356ts
	Effects (
		DieselSpecialEffects
		(
			Exhaust1
			(
				-0.33 4.58 -0.89
				0 1 0
				.1
			)
		)
	)
	DieselSmokeEffectInitialMagnitude( 1 )
	DieselSmokeEffectMaxMagnitude( 2 )
	DieselSmokeEffectInitialSmokeRate( 1 )
	DieselSmokeEffectMaxSmokeRate( 4 )

	Wagon ( S-2_SP_1356ts )
	CabView ( GenSx-rear.cvf )
	Headout ( 1.6 3.4 -4.9 )

 	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Locomotive_Specs.inc"  )
 	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Locomotive_Controllers.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Monitors.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Air_Compressor.inc"  )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Brakestand.inc"  )

	EngineBrakesControllerDirectControlExponent( 1 )

	Sound ( ALS4cab.sms )
	Name ( "SP S-2 1356 TS 1944 to 1946" )
	Include ( "..\\Common.Inc\\Models\\Percy_&_Norton\\ALCO_S2\\S2_Text.inc"  )
)

OpenRails (
	ClassificationTags (
		Ownership (
			Railroad ( "Southern Pacific" )
			Acquired ( 1947 )
			Retired ( 2011 )
			RRClass ( "Unknown" )
		)
		LocomotiveInfo (
			Builder ( "Alco" ) 
			Usage ( Switching )
			Truck_Configuration ( "4-4 ")
			CommonName ( "S-2" )
		)
		Skins (
			Initials ( "SP" )
			Number ( 1356 )
			Paint ( "Tiger Stripe " )
			PaintApplied ( 1944 )
			PaintReplaced ( 1958 )
		)
	)
)


Becuase I never use train.exe for anything I don't need to bother with any odd workarounds to make both work. So this is a pure OR-Only .eng file. All the lines after the final parens is a bunch of study I was trying out as tags. I wsn't satisfied so just ignore that.


Thanks for sharing! What I have been doing is defining any parameters which I would like to correct as well as linking relevant include entries into the eng file in the OpenRails folder, but i had set it as well up as an include file rather than a replacement.

So if i understand correctly, by defining an eng file with the Simis file header and full structure as above in the OpenRails folder, the original MSTS .eng file in the main directory is completely ignored?

#9 User is offline   Genma Saotome 

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

Posted 25 August 2020 - 09:04 AM

View Postjoe_star, on 25 August 2020 - 01:59 AM, said:

So if i understand correctly, by defining an eng file with the Simis file header and full structure as above in the OpenRails folder, the original MSTS .eng file in the main directory is completely ignored?

I have no idea as I chose to not ever use the OpenRails folder because I see no need or desire to retain any backwards execution capability. There is a big difference between backwards compatibility for reading MSTS files and backwards execution capability in order to use train.exe.

I do maintain a library of stock MSTS .wags and .engs just in case I screw up my OR files and need to go back to square one.

#10 User is offline   joe_star 

  • Fireman
  • Group: Status: Active Member
  • Posts: 191
  • Joined: 16-January 13
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 26 August 2020 - 11:03 AM

View PostGenma Saotome, on 25 August 2020 - 09:04 AM, said:

I have no idea as I chose to not ever use the OpenRails folder because I see no need or desire to retain any backwards execution capability. There is a big difference between backwards compatibility for reading MSTS files and backwards execution capability in order to use train.exe.

I do maintain a library of stock MSTS .wags and .engs just in case I screw up my OR files and need to go back to square one.

Noted, and I think you mentioned the same in your original post. My intent is to create and provide some kind of standard ORTS compliant eng and wag files for Indian rolling stock, while allowing users to maintain MSTS compatibility as well. Many of the Indian users still use MSTS alongside Open Rails, so I'd like to preserve that crossfunctionality as much as possible.

I will experiment with the eng files more to see....

  • 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