Elvas Tower: Possible Bug with Include Files - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Possible Bug with Include Files Freight Cars Don't Work Properly Rate Topic: -----

#1 User is offline   Traindude 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 666
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 08 May 2023 - 01:44 PM

After I discovered the use of include files, I was converting some UK freight cars (wagons, whatever you wanna call 'em...) to utilize these styles of include files, so I wouldn't have to modify each individual *.wag file when I want to make a change that affects all of the same type of car. However, I am noticing some unusual side effects...
[attachment=124083:Open Rails 2023-05-08 02-21-35.jpg]

In the case of the 13 mineral wagons (0-10 through 0-22), which have been modified to utilize include files, it seems to define a brake pipe even though I have coded them to be "unfitted" (Manual_Braking).

Here's an example of what the base *.wag file looks like for one of these mineral wagons:
SIMISA@@@@@@@@@@JINX0D0t______

Wagon ( BR_16T_Min_D105_4_anE
	Include( "/Include/BR_16T_Min_D105_4_GeneralData_anE.inc" )
	Name ( "BR_16T_Min_D105_4_anE" )
	Include( "../UK_Freight_Common_Include/UK_Freight_Common_Loose_Coupling.inc" )
        Include( "/Include/BR_16T_Min_D105_4_Resistance_Empty.inc" )
	Include( "../UK_Freight_Common_Include/UK_Freight_Common_9ftWB_Resistance_Curve.inc" )
	Include( "/Include/BR_16T_Min_D105_4_Brake.inc" )
        Include( "../UK_Freight_Common_Include/UK_Freight_Common_BrakeFriction_CastIron.inc" )
)


...and here's what the "BR_16T_Min_D105_4_Brake.inc" file looks like:

BrakeEquipmentType ( "Manual_brake, Handbrake" )
    BrakeSystemType ( "Manual_Braking" )
     MaxHandbrakeForce( 7.355kN )
     Comment ( Empty weight - 7.5t, Friction - 0.5 )
     NumberOfHandbrakeLeverSteps( 100 )


See? No mention of any brake pipe in there! So what gives?

There's even more odd side effects on the brake van:
[attachment=124084:Open Rails 2023-05-08 02-21-00.jpg]

Before I migrated everything to include files, I added a smoke effect to the stovepipe and modified the lights to have a flickering kerosene lamp effect. Everything worked as it should before migrating the common parameters to include files. However, after migrating all common elements to include files, I have no lights, no smoke, and no passenger view.

Here's the base *.wag file for the brake van:
SIMISA@@@@@@@@@@JINX0D0t______

Wagon ( BR_Brakevan_D504_VacPiped2_T&S
 Include( "/Include/BR_Brakevan_D504_GeneralData.inc" )
 Name ( "BR_Brakevan_D504_VacPiped2_T&S" )
 FreightAnim ( Tail&SideLamps2Bracket.s 0.0 3.0 0 )
 Include( "../UK_Freight_Common_Include/UK_Freight_Common_Loose_Coupling.inc" )
 Include( "/Include/BR_Brakevan_D504_Resistance.inc" )
 Include( "../UK_Freight_Common_Include/UK_Freight_Common_16ftWB_Resistance_Curve.inc" )
 Include( "/Include/BR_Brakevan_D504_Brake.inc" )
 Include( "../UK_Freight_Common_Include/UK_Freight_Common_BrakeFriction_CastIron.inc" )
 Include( "/Include/BR_Brakevan_D504_PassengerView.inc" )
 Include( "/Include/BR_Brakevan_D504_SpecialFX.inc" )
 
 Lights ( 10
  Light (
   comment( Rear tail light )
   Type ( 0 )
   Conditions (
    Headlight ( 2 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( 80ff0000 )
     Position ( 0.42 1.89 -2.655 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 6fff0000 )
     Position ( 0.42 1.89 -2.655 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 5eff0000 )
     Position ( 0.42 1.89 -2.655 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light (
   comment ( Rear left sidelamp red )
   Type ( 0 )
   Conditions (
    Headlight ( 2 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( 80ff0000 )
     Position ( -1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 6fff0000 )
     Position ( -1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 5eff0000 )
     Position ( -1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light (
   comment( Rear left sidelamp white )
   Type ( 0 )
   Conditions (
    Headlight ( 2 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 0.0 )
     LightColour ( aaffcc00 )
     Position ( -1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.0 )
     LightColour ( 99ffcc00 )
     Position ( -1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.0 )
     LightColour ( 88ffcc00 )
     Position ( -1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light (
   comment( Rear right sidelamp red )
   Type ( 0 )
   Conditions (
    Headlight ( 2 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( 80ff0000 )
     Position ( 1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 6fff0000 )
     Position ( 1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 5eff0000 )
     Position ( 1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light(
   comment( Rear right sidelamp white )
   Type ( 0 )
   Conditions (
    Headlight ( 2 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( aaffcc00 )
     Position ( 1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 99ffcc00 )
     Position ( 1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 99ffcc00 )
     Position ( 1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
  Light (
   comment( Rear tail light )
   Type ( 0 )
   Conditions (
    Headlight ( 3 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( 80ff0000 )
     Position ( 0.42 1.89 -2.655 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 6fff0000 )
     Position ( 0.42 1.89 -2.655 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 5eff0000 )
     Position ( 0.42 1.89 -2.655 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light (
   comment ( Rear left sidelamp red )
   Type ( 0 )
   Conditions (
    Headlight ( 3 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( 80ff0000 )
     Position ( -1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 6fff0000 )
     Position ( -1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 5eff0000 )
     Position ( -1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light (
   comment( Rear left sidelamp white )
   Type ( 0 )
   Conditions (
    Headlight ( 3 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( aaffcc00 )
     Position ( -1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 99ffcc00 )
     Position ( -1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.0 )
     LightColour ( 88ffcc00 )
     Position ( -1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light (
   comment( Rear right sidelamp red )
   Type ( 0 )
   Conditions (
    Headlight ( 3 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( 80ff0000 )
     Position ( 1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 6fff0000 )
     Position ( 1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 5eff0000 )
     Position ( 1.18 3.15 -2.73 )
     Azimuth ( -180 -180 -180 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 Light(
   comment( Rear right sidelamp white )
   Type ( 0 )
   Conditions (
    Headlight ( 3 )
    Unit ( 3 )
   )
   FadeIn ( 0.5 )
   FadeOut ( 0.5 )
   Cycle ( 0 )
   States ( 3
    State (
     Duration ( 2.0 )
     LightColour ( aaffcc00 )
     Position ( 1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 1.0 )
     LightColour ( 99ffcc00 )
     Position ( 1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
    State (
     Duration ( 0.1 )
     LightColour ( 88ffcc00 )
     Position ( 1.18 3.15 -2.5 )
     Azimuth ( 0 0 0 )
     Transition ( 0 )
     Radius ( 0.5 )
    )
   )
  )
 )
)


And here's the "BR_Brakevan_D504_SpecialFX.inc" file (which is responsible for the stovepipe smoke effect):

 comment ( **Smoke Effects** )
	Effects (      
   	SpecialEffects (
	comment ( **Stovepipe** )
   		WagonSmokeFX (
                           -0.745 3.575 -1.05
                           0 1 0
                           0.06
                     )
           )
       ) 


..and here's the "BR_Brakevan_D504_PassengerView.inc" file:

Inside (
 PassengerCabinFile ( BR_Brakevan_D504_VacPiped2.s )
 PassengerCabinHeadPos ( -0.6 2.6 -1.7 )
 RotationLimit ( 360 360 360 )
 StartDirection ( 0 180 0 )
 Sound ( "uk-swb-unfit-wag01.sms" )
 )


I see no problems there too!

My text editor sees no problems with these include files, and there's no mention of any errors in the LOG file. But since I have successfully modified locomotives and passenger cars/coaches without any of these problems occurring, it seems as though this is a bug that's specific to freight cars.

Is this a legitimate bug or did I just mistype something?

UPDATE: I think I found the problem--there was an extra close bracket in one of the other *.inc files.

#2 User is offline   engmod 

  • Open Rails Developer
  • PipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 1,791
  • Joined: 26-February 08
  • Gender:Male
  • Location:Eltham, Victoria, Australia
  • Simulator:ORNYMG
  • Country:

Posted 08 May 2023 - 03:28 PM

>Include( "../UK_Freight_Common_Include/UK_Freight_Common_Loose_Coupling.inc" )
Include( "/Include/BR_Brakevan_D504_Resistance.inc" )


Why 2 different locations?

#3 User is offline   ErickC 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,006
  • Joined: 18-July 17
  • Gender:Male
  • Location:Hastings, MN, US
  • Simulator:ORTS
  • Country:

Posted 08 May 2023 - 03:49 PM

View PostWeter, on 08 May 2023 - 02:22 PM, said:

I may be wrong, but IIRC, lights and effects shouldn't be defined via include files.

I haven't had issues with it.

#4 User is offline   Traindude 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 666
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 08 May 2023 - 04:07 PM

View Postengmod, on 08 May 2023 - 03:28 PM, said:

>Include( "../UK_Freight_Common_Include/UK_Freight_Common_Loose_Coupling.inc" )
Include( "/Include/BR_Brakevan_D504_Resistance.inc" )


Why 2 different locations?


Because it conserves disk space I don't have duplicates of the same "UK_Freight_Common_Loose_coupling.inc" file for every single car's include sub-folder. The "/Include/BR_Brakevan_D504_Resistance.inc" is in the brake van's local include folder, and the "../UK_Freight_Common_Include/UK_Freight_Common_Loose_Coupling.inc" is in an alias folder so that all cars/wagons that share the same parameters use one file. Otherwise, it eats up unneccesary disk space for what is essentially the same file.

It's kind of like aliasing sound and cab view files. ("Common.Cab" and "Common.Snd")

IOW, anything that shares these common parameters, such as couplings, rigid wheelbases, etc., regardless of if it's a brake van, mineral wagon, conflat, cattle wagon, etc., uses the same files in a centralized location.

UPDATE: I think I found the problem--there was an extra close bracket in one of the other *.inc files.

Page 1 of 1
  • 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