(This is not for Weter or other experts, it's just to show how I understand how the include() statement works)
Let's start with the original WVOGrain.wag:
SIMISA@@@@@@@@@@JINX0D0t______
Wagon ( WVOGrain
comment( WVO Covered hopper, hi-hip version)
comment( Physics by Chris Lee)
Type ( Freight )
WagonShape ( WVOGrain.s )
Size ( 3.243m 4.728m 17.503m)
comment( 23.776t empty, 106.747t full )
Mass ( 73.78t )
WheelRadius ( 36in/2 )
InertiaTensor ( Box (3m 3.6m 13.5m) )
Coupling (
Type ( Automatic )
Spring (
Stiffness ( 1e6N/m 5e6N/m )
Damping ( 1e6N/m 1e6N/m )
Break ( 5.1e8N 5.1e8N )
r0 ( 20cm 30cm )
)
comment( CouplingHasRigidConnection () )
Velocity ( 0.1m/s )
)
Buffers (
Spring (
Stiffness ( 1e6N/m 5e6N/m )
Damping ( 1e6N/m/s 1e6N/m/s )
r0 ( 0m 1e9 )
)
Centre ( 0.5 )
Radius ( 1 )
Angle ( 0.5deg )
)
Adheasion ( 0.2 0.4 2 0 )
DerailRailHeight ( 4cm )
DerailRailForce ( 2.5N/kg*23t )
DerailBufferForce ( 400kN )
NumWheels ( 8 )
Friction (
871N/m/s 0 1mph 3.26N/m/s 1.8
5.1N/rad/s 1 -1rad/s 0 1
)
Lights ( 2
Light (
comment( Rear red light flashing dim )
Type ( 0 )
Conditions (
Headlight ( 2 )
Unit ( 3 )
)
FadeIn ( 0.5 )
FadeOut ( 0.5 )
Cycle ( 0 )
States ( 2
State (
Duration ( 0.35 )
LightColour ( 80ff0000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
State (
Duration ( 0.35 )
LightColour ( 00000000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
)
)
Light (
comment( Rear red light flashing bright )
Type ( 0 )
Conditions (
Headlight ( 3 )
Unit ( 3 )
)
FadeIn ( 0.5 )
FadeOut ( 0.5 )
Cycle ( 0 )
States ( 2
State (
Duration ( 0.35 )
LightColour ( 80ff0000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
State (
Duration ( 0.35 )
LightColour ( 00000000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
)
)
)
BrakeEquipmentType( "Handbrake, Triple_valve, Auxilary_reservoir, Emergency_brake_reservoir" ) <----- THIS SECTION HAS SOME SORT OF ISSUE THAT I'M NOT GOING TO CHECK,
BrakeSystemType( "Air_single_pipe" ) <----- IN OPENRAILS THE BRAKES AREN'T RECOGNIZED
MaxBrakeForce( 22.13kN ) !
MaxHandbrakeForce( 22.13kN ) !
NumberOfHandbrakeLeverSteps( 100 )
!
EmergencyBrakeResMaxPressure( 110 )
TripleValveRatio( 2.5 ) !
MaxReleaseRate( 2.27 )
MaxApplicationRate( 1.717 ) !
MaxAuxilaryChargingRate( 1 )
EmergencyResCapacity( 2.604 )
EmergencyResChargingRate( 1 ) !
BrakeCylinderPressureForMaxBrakeBrakeForce( 64 ) <-----------------------------------------------------------------------
Sound ( "GenFreightWag1.sms" )
)
I then made a new brake system section and typed it in a STD_Wag_Brake.inc:
BrakeEquipmentType ( "Handbrake, Triple_valve, Auxilary_reservoir, Emergency_brake_reservoir" )
BrakeSystemType( "Air_single_pipe" )
MaxBrakeForce( 78kN )
MaxHandbrakeForce ( 57.2kN )
NumberOfHandbrakeLeverSteps( 100 )
EmergencyBrakeResMaxPressure( 110 )
TripleValveRatio( 2.5 )
EmergencyResVolumeMultiplier ( 1.461 )
MaxReleaseRate( 22.2 )
MaxApplicationRate( 13.9 )
MaxAuxilaryChargingRate( 20 )
EmergencyResCapacity( 2.025ft^3 )
EmergencyResChargingRate( 20 )
BrakePipeVolume ( 0.307ft^3 )
BrakeCylinderPressureForMaxBrakeBrakeForce( 90 )
(Yes, I know, same everything apart from the tweaked values but still.....)
At this point, I made an Openrails folder inside the WVOGrain folder, where I placed a text file with the following text called WVOGrain.wag (the well known include method, with my comments):
<----- REQUIRED EMPTY LINE
include ( "..\\WVOGrain.wag" ) <----- CALLS THE ORIGINAL WAG FILE
Wagon ( <----- THIS MEANS: INSERT THE NEXT LINES IN THE WAGON SECTION
include ( "..\\..\\Common.inc\\Wagons\\Std_Wag_Brakes.inc" ) <----- CALLS THE .INC FILE WITH THE NEW PARAMETERS
) <----- CLOSE THE WAGON SECTION
To note: this trick is in the manual, where it explains how to add instructions to remove the trees on rails in a route without touching the original .trk definition file.
The final result, if it would be visible, would be that:
SIMISA@@@@@@@@@@JINX0D0t______ <---- START OF THE ORIGINAL WVOGRAIN.WAG
Wagon ( WVOGrain
comment( WVO Covered hopper, hi-hip version)
comment( Physics by Chris Lee)
Type ( Freight )
WagonShape ( WVOGrain.s )
Size ( 3.243m 4.728m 17.503m)
comment( 23.776t empty, 106.747t full )
Mass ( 73.78t )
WheelRadius ( 36in/2 )
InertiaTensor ( Box (3m 3.6m 13.5m) )
Coupling (
Type ( Automatic )
Spring (
Stiffness ( 1e6N/m 5e6N/m )
Damping ( 1e6N/m 1e6N/m )
Break ( 5.1e8N 5.1e8N )
r0 ( 20cm 30cm )
)
comment( CouplingHasRigidConnection () )
Velocity ( 0.1m/s )
)
Buffers (
Spring (
Stiffness ( 1e6N/m 5e6N/m )
Damping ( 1e6N/m/s 1e6N/m/s )
r0 ( 0m 1e9 )
)
Centre ( 0.5 )
Radius ( 1 )
Angle ( 0.5deg )
)
Adheasion ( 0.2 0.4 2 0 )
DerailRailHeight ( 4cm )
DerailRailForce ( 2.5N/kg*23t )
DerailBufferForce ( 400kN )
NumWheels ( 8 )
Friction (
871N/m/s 0 1mph 3.26N/m/s 1.8
5.1N/rad/s 1 -1rad/s 0 1
)
Lights ( 2
Light (
comment( Rear red light flashing dim )
Type ( 0 )
Conditions (
Headlight ( 2 )
Unit ( 3 )
)
FadeIn ( 0.5 )
FadeOut ( 0.5 )
Cycle ( 0 )
States ( 2
State (
Duration ( 0.35 )
LightColour ( 80ff0000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
State (
Duration ( 0.35 )
LightColour ( 00000000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
)
)
Light (
comment( Rear red light flashing bright )
Type ( 0 )
Conditions (
Headlight ( 3 )
Unit ( 3 )
)
FadeIn ( 0.5 )
FadeOut ( 0.5 )
Cycle ( 0 )
States ( 2
State (
Duration ( 0.35 )
LightColour ( 80ff0000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
State (
Duration ( 0.35 )
LightColour ( 00000000 )
Position ( 0.0 1.2 -8.955 )
Azimuth ( -180 -180 -180 )
Transition ( 0 )
Radius ( 1.0 )
)
)
)
)
BrakeEquipmentType( "Handbrake, Triple_valve, Auxilary_reservoir, Emergency_brake_reservoir" )
BrakeSystemType( "Air_single_pipe" )
MaxBrakeForce( 22.13kN )
MaxHandbrakeForce( 22.13kN )
NumberOfHandbrakeLeverSteps( 100 )
EmergencyBrakeResMaxPressure( 110 )
TripleValveRatio( 2.5 )
MaxReleaseRate( 2.27 )
MaxApplicationRate( 1.717 )
MaxAuxilaryChargingRate( 1 )
EmergencyResCapacity( 2.604 )
EmergencyResChargingRate( 1 )
BrakeCylinderPressureForMaxBrakeBrakeForce( 64 )
Sound ( "GenFreightWag1.sms" )
BrakeEquipmentType ( "Handbrake, Triple_valve, Auxilary_reservoir, Emergency_brake_reservoir" ) <---- THIS IS THE ADDED SNIPPET FROM THE .INC
BrakeSystemType( "Air_single_pipe" )
MaxBrakeForce( 78kN )
MaxHandbrakeForce ( 57.2kN )
NumberOfHandbrakeLeverSteps( 100 )
EmergencyBrakeResMaxPressure( 110 )
TripleValveRatio( 2.5 )
EmergencyResVolumeMultiplier ( 1.461 )
MaxReleaseRate( 22.2 )
MaxApplicationRate( 13.9 )
MaxAuxilaryChargingRate( 20 )
EmergencyResCapacity( 2.025ft^3 )
EmergencyResChargingRate( 20 )
BrakePipeVolume ( 0.307ft^3 )
BrakeCylinderPressureForMaxBrakeBrakeForce( 90 ) <---- ...TO HERE
) <----- END OF ORIGINAL FILE
That's it!!!
Oh, you can add parameters in different sections too, look at this commented example where I added new values in an .eng file:
include ( "..\\WVOSD402.eng" ) <---- CALL THE ORIGINAL DEFINITIONS
Wagon ( <---- ADD LINES TO THE WAGON SECTION
include ( "..\\..\\Common.inc\\Locomotives\\Brakes\\Std_Loco_Brakes.inc" )
MaxBrakeForce( 200kN )
) <---- END THE WAGON SECTION
Engine ( <---- ADD LINES TO THE ENGINE SECTION
include ( "..\\..\\Common.inc\\Locomotives\\Std_Loco_Eng.inc" )
) <---- END THE ENGINE SECTION
If you're working on a copy of the original file not using the first include, then you won't need the wagon() and/or engine() statements, because the new code will be placed right at the spot where the new parameter's include() is.
I hope this explanation is clear enough to understand the include() statement, and it's useful to ay least one of you :)
(I'm almost sure it's somewhere in the manual too, but I couldn't find it).
Luca