INC Files.. For Beginners
Aim - to users with an understanding of how to use INC files in the configuration of stock for Open Rails. Based upon information by Sanjay Das.
If you wish to provide any feedback on this page, please use the contact page. It would be great to have some feedback as this helps to ensure the accuracy of the information and models.
Index
Introduction to Open Rails Include Files
Advantages of using Include Files
Challenges with using Include Files
Multiple Call INC Files for Rolling Stock
Introduction to Open Rails Include Files
Include (
Open Rails uses configuration files with user-configurable parameters that define the appearance and behavior of rolling stock (
There are a couple of different ways to use the
- Multiple INC File Calls - in this method the original configuration file (
WAG ,ENG , etc) is modified to allow the use of multipleInclude statements to call various sub-configuration files for different components. - Single INC File Call - in this method the original configuration file is not altered, but instead a single
INC file is used to over write or replace various parameters from the original file. This method can also be used when running both the ORTS and MSTS simulators on the same route and rolling stock folders, as it preserves the original file for use by MSTS. This is described below in section "Single Call INC Files.".
Advantages of using Include Files
- Easier and faster maintenance of parameters and roll-out of common changes. Updating one
INC file saves a lot of time compared to updating each individual configuration file. - Lower the risk of making mistakes. Duplication of code across multiple files increases the risk of unintended differences. Using
INC files ensures that parameter definitions are the same across all configuration files. - Concentrating common parameters in
INC files saves some disk space.
Challenges with using Include Files
There are few restrictions on how to organize the content of
To overcome above mentioned challenges with
Given the many years of history that OR has, content developers have used a number of different approaches to structure
The Include Statement
The syntax of the
The Open Rails simulator reads the parameter declarations in configuration files from top to bottom. The common parameters defined in an

If the same parameter is declared multiple times in an
The filepath in the
Examples of relative file paths:
- the
INC file is located within the same subfolder as theWAG orENG :Include ( "filename.inc" ) INC file is located in a subfolder of the folder that contains theWAG orENG files:Include ( "/filepath/filename.inc" )- the
INC file and theWAG orENG file are in different subfolders of, for instance theTrainset folder:Include ( "../subfoldername/filename.inc" ) INC files should only be used where duplication of multiple parameters will be eliminated, for example where all the cars in a train use the same brake system, then the brake system can be defined as anINC file. Like theWAG orENG files that are discussed on the File Format and Layout page,INC files should be formatted consistently for ease of readability and finding relevant parameters.- The first line of the
INC file MUST be left blank! - Do NOT` include the
SIMISA@@@@@@@@@@JINX0D0t______ header that appears at the top of everyWAG orENG file. - It is recommended to insert a comment at the top of the
INC file with the correctInclude statement to that particular file. The statement can then simply be copied and pasted into the appropriateWAG orENG file. Comment ( Include ( filepath/filename ) ) - To avoid issues with the rolling stock simulation, please double check that all relevant data has been added to the
INC file and theWAG orENG files. - Make sure that all file contents and comments are clearly written to ensure readability for yourself and others.
- Try and keep the number of folder levels down to as few as possible, aim for no more then 2 levels, if possible. This will make it easier for users to check and read files.
- Universal (or Global)
INC files, contain standardized parameters for equipment used by all locos and rolling stock, for example common braking equipment, couplers, etc. - Class-specific
INC files, which contain data that is common to a specific class of equipment. Some examples might include a class of identical locomotives or wagons with different road numbers, or load configurations.
The double dot ".." steps back (or up) one folder level relative to the folder with the
INC File Content Principles
File Naming Principles
Although
Multiple Call INC Files
This paragraph provides guidelines for organizing
For the purpose of organizing
The
Universal (or Global)
Since most ORTS users likes to run different types of equipment from different regions of the world, these folders can be further subdivided into individual subfolders for each continent/country/region
Class-specific
When multiple locomotives within the same class - e. g.: several 4-6-2 type steam locomotives with different road numbers or other details - are stored in one class-specific subfolder within the
If a class or rolling stock shares a folder with several other classes, then each class gets their own Include subfolder:
An
See the Example Applications for examples of this type of application.
Single Call INC Files.
This method allows the user to keep the original configuration file unchanged and add additional information by adding an
To implement
Within the
Remember that the first line in this file must be blank.
When migrating large numbers of files, such as rolling stock from MSTS to ORTS it can be useful not having to adjust each filename reference in each
Example of using the
is equivalent to writing the full filename:
See Open Rails manual "OR-Specific Include Files for Modifying MSTS File Parameters" for further details.
See the Example Applications for examples of this type of application.
Example Aplications.
The following scenario examples have been modelled based upon stock used in the Zig Zag route Zig Zag railway route. (Note: The stock in the route is not currently set up with
Multiple Call - Universal INC files
Typical Universal INC files would be for common components used by the majority of the rolling stock.
For example in the ZZ route we have common components such as brake triple valves, drivers brake valves,
brake cylinders, reservoirs, compressors, etc.
To implement this we would establish a folder structure to accomodate the various components.
In the case of the ZZ it would look like the following:

Then we would create a WAG file that would look like the following to call these common components:
Comment ( ******************************* Brakes *******************************
Included in this section - Type, Force, Reservoir, Applicatiion, Release. etc
*********************************************************************** )
BrakeEquipmentType( "Triple_valve, Auxilary_reservoir, Handbrake" )
BrakeSystemType ( "Air_single_pipe" )
Include ( "../Common_Inc_Brake/Triple_Valves/au_triplevalve_quickaction_goods.inc" )
Include( "../Common_Inc_Brake/Brake_Cylinders/au_brake_cylinder_6_comb.inc" )
Comment ( ===Brake Pipe Properties=== )
BrakePipeVolume ( 0.15ft^3 ) Comment ( CTN calculator * 0.64 for 1 inch pipes )
Comment ( ===Foundation Brake Gear, Brake Shoe and Force Properties=== )
ORTSMaxBrakeShoeForce ( 31360.0lbf )
Comment (Assume empty weight of 14.0t-uk)
MaxHandbrakeForce ( 31360.0lbf )
ORTSNumberCarBrakeShoes ( 4 ) Comment ( *** Assumes One Shoe Per Wheel *** )
ORTSBrakeShoeType ( "Cast_Iron_P6" )
Note the combination of Include ( ) statements for the common components, and the other parameters which are specific to the
particular car that we are modelling.
Multiple Call - Class specific INC files
Typical Class specific INC files would be to eliminate significant
"duplication", when for example, a class of locomotives is configured with a model for each engine number.
For example in the ZZ route we have two locomotives from the P Class, ie P464 and P708.
To implement this we would establish a folder structure to accomodate the various "duplicate" components.
In the case of the ZZ it would look like the following:

Then we would create a ENG file that would call these "duplicate" components using commands like the following:
Comment ( ***************************** Cylinders *****************************
Included in this section - Number, Stroke, Diameter, steam usage, etc
*********************************************************************** )
Include( "/Include/P-Class/Cylinders.inc" )
Comment ( ************************** Engine Controls **************************
Included in this section - Controllers for Regulator, Reverser, Brakes, etc
*********************************************************************** )
EngineControllers (
Include( "/Include/P-Class/CabControls.inc" )
Include( "../Common_Inc_Brake/Loco/A6ET/au_Brake_Control_West_4.inc" )
)
Note, in this instance, also the call to a Universal common component in the Engine Controls section.
Universal INC files
Typical single use call INC files can be used to add parameters to route type files or stock type files.
For example in the ZZ route we have added a number of new components to the route (INC ) definition file.
To implement this we would establish a folder structure to accomodate the various components.
In the case of the ZZ it would look like the following:

Then in the OpenRails folder we would create a TRK file that would
insert the following parameters into the route TRK :
include ( ../au_great_zig_zag.trk )
ORTSSingleTunnelArea ( "26.84*(m^2)" )
ORTSSingleTunnelPerimeter ( 20.724m )
ORTSDoubleTunnelArea ( "49.536*(m^2)" )
ORTSDoubleTunnelPerimeter ( 28.497m )
ORTSUserPreferenceForestClearDistance ( 6 )
Comment ( Add Superelevation values - 1921 NSWGR Plate Laying Guide )
ORTSTrackSuperElevation ( 0.0 0.000 160.0 0.0635 270.0 0.0635 280.0 0.0762 390.0 0.0762 400.0 0.1016 590.0 0.1016
600.0 0.0889 790.0 0.0889 800.0 0.0635 990.0 0.0635 1000.0 0.0508 1190.0 0.0508 1200.0 0.0381 1590.0 0.0381 1600.0 0.0254
3190.0 0.0254 3200.0 0.0127 10000.0 0.0127 )
Comment ( Adds sounds for turntables )
ORTSDefaultTurntableSMS ( turntable.sms )
Comment ( Adds sounds to tracks, such as curve squeal )
ORTSSwitchSMSNumber ( 18 )
ORTSCurveSMSNumber ( 10 )
ORTSCurveSwitchSMSNumber ( 12 )