The train.xml file format

NOTE:

This page is still under construction.

■ 1. Overview

The train.xml format is the native format for newer versions of OpenBVE, and is intended to replace the older train.dat format. It allows setting of many more properties, and is extensible.

It may either be constructed as a single file containing the properties of the entire train, or as a single consist definition, along with child car files.

■ 2. The Train section

Whether using child car files, or a single file, the first node in each train.xml file must be the node.

This supports the following properties:

<Car> CarProperties </Car>

This defines a car within the train.

CarProperties may either be a set of child nodes (if using the single file format) or a relative on-disk path to a child car file.

<NotchDescriptions> Notch </NotchDescriptions>

This overrides the in-game UI notch descriptions displayed.

Notch may be one or more child-nodes, with one of the following subjects: Power, Brake, LocoBrake or Reverser

A child-node must be of the following format:

<Subject> Descriptions </Subject>

Descriptions should be a comma-separated list, equal to the number of notches the train has for the subject.

■ 3. The Car section

Note

When using child car files, the node should be the first node in the file. All other details remain the same.

The node contains the properties for each induvidual train car.

This supports the following properties:

<CameraRestriction> Restrictions </CameraRestriction>

This sets any camera restrictions within the cab (Generally used for 3D cabs).

Restrictions may be one or more child-nodes, with one of the following subjects: Backwards, Forwards, Left, Right, Down or Up

A child-node must be of the following format:

<Subject> Distance </Subject>

Distance should be a distance in meters from the origin point 0,0,0 at the center of the cab object.

<Length> LengthInMeters </Length>

LengthInMeters should be the length of the car in meters.

<Width> WidthInMeters </Width>

WidthInMeters should be the width of the car in meters.

<Height> HeightInMeters </Height>

HeightInMeters should be the length of the car in meters.

<Mass> EmptyMass </EmptyMass>

EmptyMass should be the mass of an empty (unloaded) car in kilograms.

<MotorCar> IsMotorCar </MotorCar>

IsMotorCar sets whether the car is a motor car- If true, this car is set as a motor car.

<FrontAxle> Position </FrontAxle>

Position should be the position in meters of the axle from the center of the car.

<RearAxle> Position </RearAxle>

Position should be the position in meters of the axle from the center of the car.

<Object> ObjectFile </Object>

ObjectFile should be a relative on-disk path to the exterior 3D object to use.

<Reversed> IsReversed </IsReversed>

IsReversed sets whether the 3D exterior object is reversed. If true, the object is reversed.

<InteriorView> ObjectFile </InteriorView>

ObjectFile should be a relative on-disk path to the interior 3D object to use.

<VisibleFromInterior> IsVisible </VisibleFromInterior>

IsVisible controls whether the exterior object(s) for this car are visible from the interior of other cars. If true, objects will be visible.

<LoadingSway> Sways </LoadingSway>

Sways sets whether loading sway affects this specific car. If true, then whilst passengers are boarding at a station, the loading sway animation is used.

<DriverPosition> Position </DriverPosition>

Position should contain a comma-separated 3D vector, defining the position of the driver’s eyes within the car, relative to 0,0,0