.csv ルートデータ形式

クイックリファレンス…

■ 概要

■ 1. 概観

CSVルートは、テキストファイルに記述することで路線データを作成できます。

ファイルは任意のエンコードで記述されたプレーンテキストですが encoding、好ましい選択としてはバイトオーダー付きのUTF-8です。 parsing model に用いる数字は ルーズ(特に明記しない限りは)ですが、 それでも出力にあたっては 厳密な 出力をすることが望ましいです。  ファイルは任意のフォルダに格納できますが、カレントフォルダもしくは相対パスは RailwayTrain フォルダ 以下に存在しなければなりません。 ファイル名は任意ですが、 拡張子は必ず .csv を用います。 ファイルは基本的に上から下に向かって解釈されていき、各行は式ごとに分割され、左から右に向かって解釈されていきます。

ルートファイルは、(Structure 名前空間)で定義された一連の命令セットにより、ルートデータ内で一貫して共通で利用されます 。 路線データ向けの追加のプロパティ、路線側が定義した既定の列車、沿線の背景のイメージファイルも同様に定義することができます。 最後に、ルートファイルは Track 名前空間でのコマンドにより指示します。 ここでは、 線路の座標 (殆どの場合、単位はメートル) を指定することにより、線路をカーブさせるタイミングや駅を設置したり、 壁や土手などを開始したり終わらせたりします。一般的には、 Track 名前空間はその他の名前空間を予め記述し、定義した後に記述する必要があります。

このフォーマットには、暗黙の規定として明示的に開始、または終了することが出来ない rail 0 があり、 それは路線の始端から終端まで常に存在します。 そしてそれはプレイヤーが走行するレールを示します。 rail 0 とその他の レールは 視覚的表示に用いられるだけでなく、 同様に Track Following Object にも用いられます。

幾何学的に、カーブや勾配は暗黙の rail 0 に対して作用しますが、 その他のすべてのレールは rail 0 に相対的に連動して定義され、 rail 0 のカーブや勾配に従って追従します。 オーバーライドされない限りファイルフォーマットではブロック長は25mの固定長で構築され、 特定のコマンドは25mのブロック単位でしか用いることができません。 オブジェクトの配置は、常に直線的に接続する非曲線座標系を想定しています。

CSV ルートフォーマットのクイックリファレンスも参照して下さい…

■ 2. 文法

ファイルの各行の ホワイトスペース は、各行の行頭と行末では無視されます。 この時、各行はコンマ(U+002C)で区切られた個々の式に分割されます。 従って、各行は次のような形式をとります。

1, 2, 3, …, n

次に、其々の式は次の形式のいずれかをとります:

● コメント

コメントはパーサーによって完全に無視されます。 コメントを記述するには行頭をセミコロン (U+003B)で始める必要があります。

● 軌道の位置と長さ
Position

負の数でない 厳密な 浮動小数点数で線路の距離程に対応します。 後続するすべてのコマンドは、Track名前空間からこの線路の距離程に関連付けられます。

パート1:パート2:…:パートn

これは、Options.UnitOfLengthと組み合わせて距離程の表現を用いるより複雑な方法です。 其々の パートi厳密な 浮動小数点数です。 パート1係数1と乗算し, パート2係数2など、 すべての要素に対して行われ、最終的な距離程をなします。 このパートは負でない数でなければなりません。 パートはコロン (U+003A)で分割されます。 要素の定義の詳細については Options.UnitOfLength を参照して下さい。

コマンド内において、長さを表す引数はどこにおいても、コロン表記で同様に記述することができます。 そのような場合は でハイライトされます。

n ユニットが Options.UnitOfLength を通じて定義されている場合でも、 いくつかのパラメータはコロン表記で記載されていても右側から結合されます。 つまり、左側のパラメータはスキップされます。 従って、 0:0:20:22 の表記は全て同様の意味を示します。

● コマンド

引数のないコマンド:

コマンド名

引数のあるコマンド:

コマンド名 引数1;引数2;引数3;…;引数n
コマンド名(引数1;引数2;引数3;…;引数n)

インデックスと引数を両方伴うコマンド:

コマンド名(インデックス1;インデックス2;…;インデックスm) 引数1;引数2;引数3;…;引数n
コマンド名(インデックス1;インデックス2;…;インデックスm).サフックス 引数1;引数2;引数3;…;引数n
コマンド名(インデックス1;インデックス2;…;インデックスm).サフィックス(引数1;引数2;引数3;…;引数n)

ルール:

コマンド名 は大文字と小文字を区別しません。 インデックスと引数はセミコロン (U+003B)で分割されます。 コマンド名 とインデックス、引数の周囲にあるホワイトスペースは無視されます。 カッコに囲まれているホワイトスペースも同様に無視されます。

インデックスを用いた場合、 開きカッコ (U+0028) と閉じカッコ (U+0029)で囲まれている必要があります。 最低一つの引数、もしくは サフィックス がインデックスを用いる場合必須となります。

引数のエンコード方法は2種類のバリエーションがあります。 $-ディレクティブ ($Chr, $Rnd, $Sub, …)を除き、 自由にバリアントを選択できます。 バリアント 1: 最初の引数は、少なくともコマンドから一つのスペース (U+0020) で、コマンド、インデックスもしくは サフィックス で区切られます。 バリアント 2: 引数は、開き括弧 (U+0028) と閉じ括弧 (U+0029) に囲まれます。 後者の場合、 サフィックス は インデックスと接続して用いる場合には必須です。 括弧に囲まれる其々のホワイトスペースは無視されます。

一部のコマンドにおいて、 サフィックス は、引数のエンコードに用いるスタイルに関係なく必須であることに注意して下さい。 その場合 サフィックス太字 で記述され、 オプションの場合は 灰色 になります。

With ステートメント
With プレフィックス

このステートメントの後、ピリオド (U+002E) で始まるすべてのコマンドは、 プレフィックスが付加されます。 例:

With Route
.Gauge 1435
.Timetable 1157_M

上記の例は以下と同じ意味をなします:

Route.Gauge 1435
Route.Timetable 1157_M

■ 3. 前処理

ルートファイルのコマンドが実際に解釈される前には、 式は事前に処理されます。 最初に行われる処理は、 $-ディレクティブに対応する表現に置き換えます。 $Chr 、 $Rnd 、 $Sub ディレクティブは入れ子にすることができますが、 他方で $Include 、 $If 、 $Else 、 $EndIf は別のディレクティブにさらに入れ子にすることはできません。

$-ディレクティブの文法は自由には選べず、以下に示す形で従わなければなりません。


$Include(ファイルパス)
$Include(ファイルパス:距離程のオフセット)
$Include(ファイルパス1; 確率1; ファイルパス2; 確率2; …)
ファイルパスi: メインとなるルートファイル (CSV/RW) と同一のルートファイル形式を持つ、単一のファイルのパス付きファイル名。 確率i: 正の浮動小数点数で、対応するファイルがインクルードされる確率を示します。

このディレクティブは、対応する確率に基づいて指定されたファイルからランダムに選択して、そのファイルの中身を指定されたメインファイルに含めます。 選ばれたファイルの中身は $Include ディレクティブの位置に差し替えられますので、それはすなわち例えば距離程と直前に使われたWithステートメントに注意を払わなければならないことを意味します。 引数処理において一番最後の確率が省略された場合、1として扱われます。

$Include ディレクティブは、大きなファイルを小さなファイルに分割したり、 共通のセクションのコードを複数のルートで共有したり、 大きなコードブロックからランダムに選択させたりするのに役立ちます。 インクルードされたファイルの中に更にファイルがインクルードされる場合がありますが、 それらが循環依存関係になっていないかどうかを確認し、注意する必要があります。 例えばファイル A が ファイル B をインクルードしている場合、 ファイル B がファイル A をインクルードしてしまっている場合などです。 (必要な場合を除き)インクルードファイルには.csvとは異なる拡張子を用いてユーザーが誤ってメインメニューから選択できないように考慮しておく必要があります。

ファイルi の後に :TrackPositionOffset が続く場合、 インクルードされるファイル内のすべての式は指定された距離程が メートル単位 でオフセットされます。 例えば、 $Include(stations.include:2000) は、part.includeがインクルードされる前に、ファイルに含まれるすべての距離程が2000メートル前方にシフトされます。 重要で理解しておかなければならないポイントとして、 “距離程” は$-ディレクティブが処理されるまでは実際に理解されないため、インクルードされるファイル内のすべての式は インクルードされた後実際の距離程に後にオフセットさせるためのフラグを内部的に立てるだけであることに注意して下さい。 即ちこれが意味する所として、インクルードされたファイル内に 1$Rnd(2;8)00 のような記述があったとして、まだ実際のオフセット後の距離程が形成されていない段階であっても、それらは正しくオフセットされます。

距離程のオフセット機能は release 1.2.11 以降に対応します。


$Chr(アスキーコード番号)
アスキーコード番号: 20 から 127までの整数値、もしくは 10、13のいずれかの整数値で、 ASCIIコード表の同じ番号に対応します。

このディレクティブは アスキーコード番号 で示される番号に対応するASCII 文字コードの文字へ置き換えます。 これは構文規則に用いる記号などを含めたりする場合や、除去したい場合に有用です。 関連するASCII文字のリスト:

ASCIIコード番号 意味 文字
10 改行 newline
13 改行 newline
20 スペース space
40 開き括弧 (
41 閉じ括弧 )
44 カンマ ,
59 セミコロン ;

$Chr(13)$Chr(10) のシーケンスは単一の改行として扱われます。 $Chr(59) が挿入された場合、 それが使用されている場所に応じてコメントの開始、もしくは引数の区切り文字として解釈されます。


$Rnd(下限の数値; 上限の数値)
下限の数値: 乱数の数値の下限を表す整数値 上限の数値: 乱数の上限を表す整数値

このディレクティブは 下限の数値 から 上限の数値 までのランダムな整数値を置き換えます。 これは例えば路線にランダム性を持たせたい時に有用です。

Example for the use of the $Rnd directive:
10$Rnd(3;5)0, Track.FreeObj 0; 1
Possible outcome from the previous example is exactly one of these lines:
1030, Track.FreeObj 0; 1
1040, Track.FreeObj 0; 1
1050, Track.FreeObj 0; 1

$Sub(インデックス) = 表現
インデックス: 変数のインデックスを表す負でない整数.
表現: 変数に格納される内容.

このディレクティブは単一の式としてのみ表示されます。 インデックス で割り当てられた場所へ、 表現 の内容で置き換えるために使用されます。 すべての割当が完了すると、 $Sub ディレクティブは空の文字列に置き換えられます。 $Rnd ディレクティブで生成された乱数値を変化させずに共用したい場合、それを保存したいときに有用です。 例については次の $Sub(インデックス) ディレクティブを参照して下さい。

実装にあたってのメモ

数値以外の文字列を格納することも可能ですが、 コンマを含める際に $Chr(44) を用いてもステートメントの区切りとして機能させることはできません。 ですが、 最初の文字として $Chr(59) 含めさせて、コメントとして機能させることは可能です。 条件式に用いる場合には、 $Include もしくは $If を用いる必要があります。


$Sub(インデックス)
インデックス: 呼び出される変数のインデックスを表す負でない整数。

このディレクティブは、 変数インデックスに格納されている内容に置き換えます。 変数は置き換えられる前に予め設定されていなければなりません。

Example for the use of the $Sub(Index)=Value and $Sub(Index) directives:
$Sub(0) = $Rnd(3; 5)
1000, Track.FreeObj $Sub(0); 47
1020, Track.FreeObj $Sub(0); 47
1040, Track.FreeObj $Sub(0); 47

先の例では、3つ全ての Track.FreeObj コマンドにおいて、生成された乱数値は全て同じ数値が用いられ、FreeOBJのオブジェクトが同じレール上に配置されることが保証されます。 もし其々のFreeOBJの命令で其々 $Rnd(3;5) ディレクティブを指定した場合、 各オブジェクトはそれぞれ毎回、別のレール上に配置される可能性があります。


$If(状態)
状態: ゼロの場合は false 、それ以外の場合は true に相当する数値を表します。

$If ディレクティブは、 状態が true (もしくは非ゼロの数値) と評価されたときのみ、後続の式を処理します。 $If の後に続く式の最後には、 $EndIf を記述しなければなりません。 オプションで、 $If と $EndIf の間に $Else ディレクティブを記述することができます。


$Else()

$Else ディレクティブは、 それに先行して記述された $If ディレクションで false (ゼロ) と 評価されたときのみ、後に続く処理を処理できます。


$EndIf()

$EndIf ディレクティブは、 その前に開始された $If ブロックの終了をマークするものです。

Example of $If, $Else and $EndIf
$Sub(1) = 0
With Track
$If($Sub(1))
    1020, .FreeObj 0; 1
    1040, .FreeObj 0; 2
$Else()
    1030, .FreeObj 0; 3
$EndIf()
Another example of $If, $Else and $EndIf
With Track
1050
$If($Rnd(0;1)), .FreeObj 0; 4, $Else(), .FreeObj 0; 5, $EndIf()

$If ブロックは、入れ子処理をすることができます。 (最初の例のように)、もし $If/$Else/$EndIf をそれぞれ別の行に配置した場合、インデントを使用して可読性を改善させることができます。


最後に、 $-ディレクティブの全ての処理を終えると、 ルートファイルにある全ての表現は、それに関連する距離程に従って自動的にソートされます。

Example of a partial route file:
1000, Track.FreeObj 0; 23
1050, Track.RailType 0; 1
10$Rnd(3;7)0, Track.Rail 1; 4
Track.FreeObj 1; 42
Preprocessing the $Rnd directive (assuming 3 is produced):
1000, Track.FreeObj 0; 23
1050, Track.RailType 0; 1
1030, Track.Rail 1; 4
Track.FreeObj 1; 42
Sorting by associated track positions:
1000, Track.FreeObj 0; 23
1030, Track.Rail 1; 4
Track.FreeObj 1; 42
1050, Track.RailType 0; 1

■ 4. Options 名前空間

この名前空間におけるコマンドは、その他のコマンドの処理において路線ファイル全体に渡って影響を与えるオプションを提供します。 他の名前空間でコマンドを用いる前に、この名前区間のコマンドを予め実行しておく必要があります。


Options.UnitOfLength FactorInMeters1; FactorInMeters2; FactorInMeters3; …; FactorInMetersn
FactorInMetersi: 其々のユニットの長さの単位を表す浮動小数点数 FactorInMeters1 の初期値は1で、それ以外は全て0です。

このコマンドを用いることで、他のコマンドで用いる長さの単位を指定できます。 汎用のユニット単位を Part1:Part2:…:Partn と入力すると、 其々の PartiFactorInMetersi に準ずる距離程に乗算され、 そののち全ての実体の距離程をメートル単位で生成します。 理想は Options.BlockLength を使用して、ブロック長を使用する単位の整数倍に設定すべきです。

単位の変換例:

希望するユニットの単位 閑散係数
mile 1609.344
chain 20.1168
meter 1
yard 0.9144
foot 0.3048

以下においては、 Options.UnitOfLengthの影響を受ける時はいつも、全てのコマンドの全ての引数は にハイライトされます。


Options.UnitOfSpeed FactorInKmph
FactorInKmph: 希望のユニットが持つ、一時間あたりのキロメートルの数を表す浮動小数点数。 デフォルト値は 1 です。

このコマンドは他のコマンドで使用する速度の単位をを指定して使用することが出来ます。閑散係数の例:

希望の単位 換算係数
meters/second 3.6
miles/hour 1.609344
kilometers/hour 1

以下においては、 Options.UnitOfLengthの影響を受ける時はいつも、全てのコマンドの全ての引数は にハイライトされます。


Options.BlockLength Length
Length: ブロック長を表す正の浮動小数点数。 by default デフォルトの単位は メートル です。 デフォルト値は 25 メートルです。

このコマンドを用いることで、ブロック長を指定できます。 これは路線全体の設定であり、途中で変更をすることは出来ません。 Length は、 Options.UnitOfLength が Options.BlockLength より前で使用されている場合、 Options.UnitOfLength で指定された単位でのみ表されます。


Options.ObjectVisibility Mode
Mode: オブジェクトの表示方法と非表示の方法を決定するモード。デフォルト値は0 (レガシー)です。

Mode で使用可能なオプション:

0: レガシーモード: オブジェクトが存在するブロックの最後の座標がカメラによって通過するとすぐに、オブジェクトが非表示になります。 これは、カメラを回転させるとうまく機能しません。 自己交差トラック (ループなど) は出来ません。
1: 線路ベース: カメラがオブジェクトの終わりを通過するとすぐに、オブジェクトは非表示になります。 これは線路の位置ベースで測定されます。 自己交差トラック (ループなど) は出来ません。

Options.SectionBehavior Mode
Mode: Track.Section コマンドの処理方法を決定するモード。デフォルト値は0 (デフォルト) です。

Mode で使用可能なオプション:

0: Default: In Track.Section Aspect0; Aspect1; …; Aspectn, any of the Aspecti refer to the aspect the section should have if i following sections are clear.
1: Simplified: In Track.Section Aspect0; Aspect1; …; Aspectn, the section bears the smallest aspect which is higher than that of the following section.

Options.CantBehavior Mode
Mode: The mode determining how cant in the Track.Curve command is processed. The default is 0 (unsigned).

Mode で使用可能なオプション:

0: Unsigned: The CantInMillimeters parameter in Track.Curve is unsigned, i.e. the sign is ignored and the superelevation is always towards the curve center (inward). Cant cannot be applied on straight track.
1: Signed: The CantInMillimeters parameter in Track.Curve is signed, i.e. negative values bank outward and positive ones inward on curved track. Cant can be applied on straight track, where negative values bank toward the left and positive ones toward the right.

Options.FogBehavior Mode
Mode: Track.Fog コマンドの処理方法を決定するモード。デフォルト値は0 (ブロックベース) です。

Mode で使用可能なオプション:

0: ブロックベース: 霧の色と範囲は Track.Fog が古い設定で使用されているブロックの最初から、新しい設定のブロックの最後まで補完されます。
1: 補間: 霧の色と範囲は、隣接する Track.Fog コマンドの間で補間されます。 この動作は Track.Brightness を模倣しています。

Options.CompatibleTransparencyMode Mode
Mode: カラーパレットの制限がある場合のBVE2/4のオブジェクトでの透明度の処理方法を決定するモード。 これは ‘Options’ で設定された値を上書きするために路線ごとに使用できます。

Mode で使用可能なオプション:

0: Off: 指定の色と明示的に一致させます。 指定された透明色がカラーパレット内に存在しない場合、透明度は追加されません。
1: On: ファジー選択。. テクスチャが制限されたカラーパレットを使用している場合、透明色はパレットで最も近い使用可能な色に自動的に設定されます。

Options.EnableBveTsHacks Mode
Mode: BVE2/4の路線データを修正するための様々な'ハック'が適用されるかどうかを指定するモード。 これは ‘Options’ で設定された値を上書きするために路線ごとに使用できます。

Mode で使用可能なオプション:

0: Off: ‘ハック’ を無効にします。
1: On: ‘ハック’ を有効にします。

■ 5. Route 名前空間

この名前空間のコマンドは、路線の一般的なプロパティを定義します。


Route.Comment Text
Text: メインメニューのダイアログで路線が選択された時に表示されるコメント。

テキストに改行やコンマ等を含めたい場合は $Chr ディレクティブを使用する必要があります。


Route.Image File
File: メインメニューの路線選択ダイアログで路線が選択された時に表示される画像。 路線フォルダを基準としたファイルのパス。

Route.Timetable Text
Text: デフォルトの時刻表の上部に表示されるテキスト。

テキストに改行やコンマ等を含めたい場合は $Chr ディレクティブを使用する必要があります。


Route.Change Mode
Mode: 路線の開始時に列車の保安装置を起動させるモード。デフォルトは実装固有です。

Mode で使用可能なオプション:

-1: 保安装置を 有効 にし、かつ 常用最大 ブレーキが適用されます。
0: 保安装置を 有効 にし、かつ 非常 ブレーキが適用されます。
1: 保安装置を 無効 にし、かつ 非常 ブレーキが適用されます。

Route.Gauge ValueInMillimeters
ValueInMillimeters: ミリメートル (0.001 meters)単位の、線路の幅を設定します。 デフォルト値は 1435です。
Note

Train.Gauge は Route.Gauge と同じ意味を持ちます。


Route.Signal(AspectIndex).Set Speed
AspectIndex: 信号が指し示す状態「アスペクト」を表す、負でない整数。 アスペクト 0 は赤を示します。
Speed: 対応するアスペクトが許容する速度を定義する浮動小数点数。 デフォルト の単位は キロメートル毎時 (km/h) です。

このコマンドを使用して、速度制限を信号の現示「アスペクト」に関連付けます。 アスペクト 0 は赤信号を示し、 値が大きいほど速度の許容度が高いことを表します。デフォルトの値(日本の信号システム)は次のとおりです:

インデックス番号 アスペクト 速度
0 0 km/h
1 ●● 25 km/h
2 55 km/h
3 75 km/h
4 無制限
5 ●● 無制限

Route.RunInterval Interval0; Interval1; …; Intervaln-1
Intervali: 運転する列車の時刻表とは別に作成される、別の列車の時刻表との間の時間間隔を表す浮動小数点数。 で表します。 正の値は運転する列車の前方の列車を示し、負の値は後方を示します。

このコマンドは、一つ以上の運転する列車の前後の列車を生成します。此等の列車は路線に表示され、完全に機能し、運転する列車と同じ外観を使用します。 他の列車は運転する列車と同じ時刻表に従いますが、 Interval によって時間的にオフセットされます。 Track.Sta コマンドにより、運転する列車のみ、または前後を走る列車のみが停止する駅を定義することが出来ます。 後続の列車は配置されたセクションが他の列車によってクリアされた後にのみ表示されますが、運転する列車は現在の信号セクションの状態に関係なく設置されます。 従って、路線の開始時に運転する列車が表示されるセクションを前後の列車がクリアしていることを確認する必要があります。

Note

Route.RunInterval は Train.Interval と同じ意味を持ちます。


Route.AccelerationDueToGravity Value
Value: メートル毎秒の二乗 (m/s²) で重力による加速度を表す正の浮動小数点数。 デフォルト値は 9.80665 です。

Route.Elevation Height
Height: メートル (m) で表される、海抜の初期の高さを表す浮動小数点数。 デフォルト値 は0です。

Route.Temperature ValueInCelsius
Value: 摂氏 の初期の温度を表す浮動小数点数。 デフォルト値は20です。

Route.Pressure ValueInKPa
ValueInKPa: kPa (1000 パスカル)の初期気圧を表す正の浮動小数点数。 デフォルト値は 101.325 です。

Route.DisplaySpeed Unit; ConversionFactor
Unit: 速度関連のメッセージが表示されるテキストの単位。 ConversionFactor: km/hに対するカスタム速度単位の間の変換係数。 mph の場合は 0.621371 になります。

このコマンドを使用すると、速度に関連するメッセージが表示された際(速度超過など)、カスタム速度単位、 mph等で表示することが出来ます。


Route.LoadingScreen Image
Image: サポートされている画像ファイルへのパス

このコマンドを使用すると、カスタム画像をロード画面の背景として使用することが出来ます。


Route.StartTime Time
Time: シミュレーションを開始する時刻

このコマンドを使用すると、シミュレーションの開始時刻を設定することが出来ます。

Note

この値が設定されていないか無効な場合、シミュレーションは始発駅に設定された到着時間に開始されます。


Route.DynamicLight Dynamic.XML
Dynamic.XML: ダイナミックライティングが定義されたXMLファイルへのパス

このコマンドは、 Route.AmbientLightRoute.DirectionalLight および Route.LightDirection コマンドの代わりとして使用できます。

これを用いることで、時間ベースのモデルを使用して照明を変化させることが出来ます。次のページで詳しく説明しています。

ダイナミックライティング


Route.AmbientLight RedValue; GreenValue; BlueValue
RedValue: 環境光の赤の要素を表す0から255までの範囲の整数。 デフォルト値は 160 です。
GreenValue: 環境光の緑の要素を表す0から255までの範囲の整数。 デフォルト値は 160 です。
BlueValue: 環境光の青の要素を表す0から255までの範囲の整数。 デフォルト値は 160 です。

このコマンドは、使用する環境光の色を定義します。 3D空間内の全てのポリゴンは、ライトの方向に関係なく、 環境光によって照らされます。


Route.DirectionalLight RedValue; GreenValue; BlueValue
RedValue: 指向性ライトの赤の要素を表す0から255までの範囲の整数。 デフォルト値は160です。
GreenValue: 指向性ライトの緑の要素を表す0から255までの範囲の整数。 デフォルト値は160です。
BlueValue: 指向性ライトの緑の要素を表す0から255までの範囲の整数。 デフォルト値は160です。

このコマンドは、使用する指向性ライトを定義します。 3D空間内のポリゴンは、ライトの方向が前面に差している場合にのみ、指向性ライトによって完全に照らされます。 背面に差している場合、指向性ライトは効果を与えません。 Route.LightDirection を設定して、光の方向を指定する必要があります。


Route.LightDirection Theta; Phi
Theta: ライトの方向のピッチを制御する の角度を表す浮動小数点数。 デフォルト値は 60 です。
Phi: ライトの方向の回転の面の の角度を表す浮動小数点数。 デフォルト値は -26.57 です。

このコマンドは、 自線の距離程0における初期の光の方向を定義します。 これは光が当たる方向で、 太陽が位置する方向とは反対の方向であることを意味します。 まず最初に、 Theta がピッチを決定します。 90 は下の方向を示し、 -90 は上方向を示します。 此等の値が極端な場合、 Phi の値は無関係になります。 Theta の値が0の時、後ろの水平線から始まる順方向を示します。 ピッチが Theta によって決定されると、 Phi が平面の回転を決定します。 値が0のときは回転せず、 90 の時は右方向に回転し、 -90 の時は左方向に回転します。 ThetaPhi を 180 と 0 、または 0 と 180 に設定することで、 逆方向を両方とも取得できます。 中間の値を取ることで、正確な光の方向をより正確に制御できます。

illustration_light_direction

Converting a spherical direction (theta,phi) into a cartesian direction (x,y,z):
ƒ x = cos(theta) * sin(phi)
y = -sin(theta)
z = cos(theta) * cos(phi)
Converting a cartesian direction (x,y,z) into a spherical direction (theta,phi) for y²≠1:
ƒ theta = -arctan(y/sqrt(x2+z2))
phi = arctan(z,x)
Converting a cartesian direction (x,y,z) into a spherical direction (theta,phi) for y²=1:
ƒ theta = -y * pi/2
phi = 0

In the formulas above, cos(x) represents the cosine, sin(x) the sine, arctan(x) the inverse tangent, arctan(x,y) the two-argument inverse tangent and sqrt(x) the square root. The formulas can be used to convert between spherical and cartesian coordinates if working with either one seems more intuitive than working with the other one. The formulas also serve as the official documentation on how the light direction is mathematically defined (using radians for the trigonometric functions).


Route.InitialViewpoint Value
Value: An integer defining the initial camera viewpoint mode. The following values are valid:
0 : The camera will be placed in the cab. (Default)
1 : The camera will be placed in ‘Track Camera’ mode.
2 : The camera will be placed in ‘Flyby Camera’ mode.
3 : The camera will be placed in ‘Flyby Zooming Camera’ mode.

This command allows the route developer to place the initial camera in one of the alternate camera modes.


Route.DeveloperID

This command is ignored by openBVE.

■ 6. The Train namespace

Commands from this namespace define route-train associations.


Train.Folder FolderName
Train.File FolderName
FolderName: The folder name of the default train to use on this route.

Train.Run(RailTypeIndex).Set RunSoundIndex
Train.Rail(RailTypeIndex).Set RunSoundIndex
RailTypeIndex: A non-negative integer representing the rail type as defined via Structure.Rail and used via Track.RailType.
RunSoundIndex: A non-negative integer representing the train’s run sound to associate to the rail type.

The train developer provides a repertoire of different run sounds. Use this command to associate these run sounds to the rail types you use in your route. In order for the correct run sounds to be played on any of your rail types, you need to coordinate your efforts with the train developer. Please see the page about standards for further information.


Train.Flange(RailTypeIndex).Set FlangeSoundIndex
RailTypeIndex: A non-negative integer representing the rail type as defined via Structure.Rail and used via Track.RailType.
RunSoundIndex: A non-negative integer representing the train’s flange sound to associate to the rail type.

The train developer provides a repertoire of different flange sounds. Use this command to associate these flange sounds to the rail types you use in your route. In order for the correct flange sounds to be played on any of your rail types, you need to coordinate your efforts with the train developer. Please see the page about standards for further information.


Train.Timetable(TimetableIndex).Day.Load FileName
TimetableIndex: A non-negative integer representing the timetable index.
FileName: The file name for the daytime version of the timetable, relative to the train’s folder (1st choice), or relative to the Object folder (2nd choice).

Use this command to load daytime versions of the timetable. Which timetable index to show starting with a particular station can be set in Track.Sta commands.


Train.Timetable(TimetableIndex).Night.Load FileName
TimetableIndex: A non-negative integer representing the timetable index.
FileName: The file name for the daytime version of the timetable, relative to the train’s folder (1st choice), or relative to the Object folder (2nd choice).

Use this command to load nighttime versions of the timetable. Which timetable index to show starting with a particular station can be set in Track.Sta commands.


Train.Gauge ValueInMillimeters
ValueInMillimeters: A floating-point number representing the rail gauge, measured in millimeters (0.001 meters). The default value is 1435.
Note

Train.Gauge is the same as Route.Gauge.


Train.Interval Interval0; Interval1; …; Intervaln-1
ValueInSeconds: A floating-point number representing the time interval between the player’s train and the preceding train, measured in seconds. The default value is 0.
Note

Train.ValueInSeconds is the same as Route.RunInterval.


Train.Velocity Speed
Speed: A positive floating-point number representing the maximum speed the preceding trains may travel at, by default measured in kilometers per hour, or 0 for infinite speed. The default value is 0.

This command defines the maximum speed limit the preceding trains may travel at. The actual speed limit may be reduced by Track.Limit commands. The player’s train is unaffected by this setting and may travel up to the limits defined by Track.Limit.


Train.Acceleration

This command is ignored by openBVE.


Train.Station

This command is ignored by openBVE.

■ 7. The Structure namespace

The commands in the Structure namespace define which objects to use in other commands. Generally, commands like Track.Rail, Track.FreeObj and so on create objects referenced by a StructureIndex. This StructureIndex is specific to that command, so you can define a set of objects specific to Track.Rail, Track.FreeObj and so on.

The general syntax for commands in the Structure namespace is:

Structure.Command(StructureIndex).Load FileName

StructureIndex is a non-negative integer. FileName is the object file to load, relative to the Object folder. Command is any of the following commands:

Command: Remarks
Ground Defines objects for Cycle.Ground and Track.Ground.
Rail Defines objects for Track.Rail, Track.RailStart and Track.RailType.
WallL Defines left objects for Track.Wall.
WallR Defines right objects for Track.Wall.
DikeL Defines left objects for Track.Dike.
DikeR Defines right objects for Track.Dike.
FormL Defines left platforms edges for Track.Form.
FormR Defines right platforms edges for Track.Form.
FormCL Defines transformable left platforms for Track.Form. No ANIMATED objects supported.
FormCR Defines transformable right platforms for Track.Form. No ANIMATED objects supported.
RoofL Defines left roof edges for Track.Form.
RoofR Defines right roof edges for Track.Form.
RoofCL Defines transformable left roofs for Track.Form. No ANIMATED objects supported.
RoofCR Defines transformable right roofs for Track.Form. No ANIMATED objects supported.
CrackL Defines transformable left objects for Track.Crack. No ANIMATED objects supported.
CrackR Defines transformable right objects for Track.Crack. No ANIMATED objects supported.
FreeObj Defines objects for Track.FreeObj.
Beacon Defines objects for Track.Beacon.

Generally, supported objects are B3D, CSV, X and ANIMATED. However, the FormCL, FormCR, RoofCL, RoofCR, CrackL and CrackR commands only accept B3D, CSV and X objects.

More information about forms, roofs and cracks…

Additionally, there is the Structure.Pole command, which has a slightly different syntax:

Structure.Pole(NumberOfAdditionalRails; PoleStructureIndex).Load FileName
NumberOfAdditionalRails: An non-negative integer representing the number of additional rails covered by the pole. 0 creates a pole for one rail, 1 for two rails, etc.
PoleStructureIndex: A non-negative integer representing the pole structure index.
FileName: The object file to load, relative to the Object folder.

Please note that all objects but the FreeObj are inserted at the beginning of a block and should thus extend from 0 to BlockLength (by default 25m) on the z-axis. For further information on usage, see the respective commands from the Track namespace.

■ 8. The Texture namespace

Commands from this namespace define which background images to use and how they are aligned.

illustration_background

The background image is displayed as a cylindric wall around the camera whose start (viewed from above) is 60 degrees to the left of the initial forward direction (at the 10 o’clock position). From there, the background image wraps clock-wise around the cylinder with a repetition count specified via Texture.Background(BackgroundTextureIndex).X, which by default creates 6 repetitions in a full circle.

The upper 3/4 of the image is displayed above the horizon, while the lower 1/4 is displayed below the horizon. Via Texture.Background(BackgroundTextureIndex).Aspect, you can choose whether to have a fixed cylinder height or to preserve the aspect ratio of the texture. If the image should have a fixed height, the cylinder has a height of 1/2 its radius, which corresponds to about 20 degree inclination to the top of the image, and about -7 degrees to the bottom of the image. If the aspect ratio of the image is preserved, this takes not only the width and height of the image into account, but also the repetition count.

Regardless of the repetition count you chose, you should make sure that the left and right edges of the textures fit seamlessly together. Please also take into account that top and bottom caps are created which sample from the top and bottom 10% of the image. You should avoid mountain peaks and similar extremes in the top 10% of the image in order for such extremes to not leak into the top cap.

The image loaded into Texture.Background(0) is displayed at the beginning of the route, unless a Track.Back command at the beginning of the route requests a different image.

As an alternative Dynamic or Object based backgrounds may be used. The implementation of these is described upon this page:

Dynamic & Object Based Backgrounds


Texture.Background(BackgroundTextureIndex).Load FileName
FileName: The texture file to load, relative to the Object folder.

This command loads a background image to be later used by Track.Back.

Note

If a dynamic or object based background is to be used, this must instead point to the appropriate XML file.


Texture.Background(BackgroundTextureIndex).X RepetitionCount
RepetitionCount: The number of times the background image is repeated in a full circle. The default value is 6.
Note

Ignored if using a dynamic or object based background.


Texture.Background(BackgroundTextureIndex).Aspect Mode
Mode: The mode of aspect ratio handling to use. The default value is 0 (fixed).

▸ Options for Mode:

0: Fixed: Use a fixed height for the cylinder.
1: Aspect: Preserve the aspect ratio of the image.
Note

Ignored if using a dynamic or object based background.

■ 9. The Cycle namespace

Cycle.Ground(GroundStructureIndex).Params GroundStructureIndex0; GroundStructureIndex1; GroundStructureIndex2; …; GroundStructureIndexn-1
GroundStructureIndex: A non-negative integer indicating the ground structure index for which a cycle is to be defined.
GroundStructureIndexi: A non-negative integer indicating a ground structure that has been previously loaded via Structure.Ground.

When usually using Track.Ground(GroundStructureIndex), the same ground structure object will be repeatedly placed in every block. Via Cycle.Ground, you can override this behavior and automatically cycle through a series of different objects when using Track.Ground(GroundStructureIndex). The cycle repeats indefinitely, where GroundStructureIndex0 starts at track position 0. Technically, the i in GroundStructureIndexi chosen for a particular track position p is Mod[p / BlockLength, n].

Cycle.Rail(RailStructureIndex).Params RailStructureIndex0; RailStructureIndex1; RailStructureIndex2; …; RailStructureIndexn-1
RailStructureIndex: A non-negative integer indicating the rail structure index for which a cycle is to be defined.
RailStructureIndexi: A non-negative integer indicating a rail structure that has been previously loaded via Structure.Rail.

Consider the following definition:

With Structure
.Ground(0) grass.csv
.Ground(1) river.csv
.Ground(2) asphalt.csv

The following two codes will produce the same output:

With Track
0, .Ground 0
25, .Ground 1
50, .Ground 2
75, .Ground 0
100, .Ground 1
125, .Ground 2
; and so on…
With Cycle
.Ground(0) 0; 1; 2
With Track
0, .Ground 0

■ 10. The Signal namespace

Commands from this namespace define custom signals.


Signal(SignalIndex__)__.Load AnimatedObjectFile
SignalIndex: A non-negative integer representing the signal index.
AnimatedObjectFile: A reference to an animated object file, relative to the Object folder.

Use this command to load signals directly from animated objects. The SignalIndex can be later referenced in Track.SigF commands to place the signal.


Signal(SignalIndex__)__.Load SignalFileWithoutExtension; GlowFileWithoutExtension
SignalIndex: A non-negative integer representing the signal index.
SignalFileWithoutExtension: A reference to a B3D/CSV/X object file representing the signal, relative to the Object folder, but without the file extension. Is required to be specified.
GlowFileWithoutExtension: An optional reference to a B3D/CSV/X object file representing the distance glow, relative to the Object folder, but without the file extension.

Use this command to load signals from a series of individual textures applied onto a common object. openBVE looks for X, CSV and B3D objects in this exact order. Textures are required to have the same name as the signal or glow, plus a non-negative aspect index, plus a file extension for textures. The SignalIndex can be later referenced in Track.SigF commands to place the signal.

For the SignalFileWithoutExtension, there should be the following files present (example):

SignalFileWithoutExtension.x
SignalFileWithoutExtension0.bmp
SignalFileWithoutExtension1.bmp
SignalFileWithoutExtension2.bmp
SignalFileWithoutExtensionn.bmp

The aspect indices from 0 through n represent successively more permissive aspects, where 0 is red. The built-in signals, for example, use the indices 0 (), 1 (●●), 2 (), 3 (), 4 () and 5 (●●). You can use as many as required.

All faces in the object will be applied the currently active aspect texture. This means that you cannot use any other texture in the object, but still have to assign texture coordinates appropriately. For the glow object, the above rules also apply. The glow object is usually a rectangle placed clearly in front of the signal, although you can also use different shapes.

The glow textures deserve special attention. All glow textures are pre-processed in the following way:

A B C D E F
illustration_glow_1 illustration_glow_2 illustration_glow_3 illustration_glow_4 illustration_glow_5 illustration_glow_6

The texture you start with should have a sharp shape, usually oval. The shape should be fully saturated in the core and blend into pure white at its outer rim. The surroundings of the shape can be either pure black (A) or pure white (B).

When openBVE loads the glow texture, it will replace all purely black pixels with purely white pixels, thus arriving at (B). From there, the image is inverted (C), then hue-shifted by 180 degrees (D). Compared to (B), this has the overall effect of inverting the lightness of the image, i.e. fully saturated pixels will be left unchanged (e.g. the core), while bright pixels (such as the outer rim of the shape) will become dark, and vice versa. Then, the image is gamma-corrected to further darken the dark parts (E), and finally, the image is blurred slightly (F).

The resulting texture is always additively blended. This means that instead of directly drawing the texture onto the screen, the pixels of the texture are added to the screen pixels. Here, adding black (0) does not change the screen pixels, while adding a fully satured color channel (1) will result in a fully satured color channel, e.g. adding white produces white. Keep in mind that when designing the textures, you will have to follow the inverse rules, e.g. design the image as depicted in (A) or (B), while having in mind how it will be processed afterward.

■ 11. The Track namespace

Commands from this namespace define the track layout. Commands from this namespace should appear after commands from any of the other namespaces, and they usually form the largest part of the route file.

Use of track positions

All commands from the Track namespace need to be associated to track positions. Once a track position has been defined, all subsequent commands are associated to this track position until a new track position is defined. If you do not explicitly state a track position before the first command of the Track namespace is used, 0 will be assumed. While you do not need to use track positions in ascending order, series of commands which are associated the same track position will be sorted into ascending order once the file is loaded. While track positions can be any non-negative floating-point number, many commands in the Track namespace are only to be applied at the beginning of a block, which is 25m by default. For the default situation, this means that some commands are only to be used at track positions 0, 25, 50, 75, 100, 125 and so on. All commands for which this restriction applies are marked as such.

● 11.1. Rails

Track.RailStart RailIndex; X; Y; RailType
RailIndex: A positive integer (>=1) indicating which rail index to use.
X: A floating-point number representing the horizontal distance from the player’s rail, by default measured in meters. Negative values indicate left, positive ones right.
Y: A floating-point number representing the vertical distance from the player’s rail, by default measured in meters. Negative values indicate below, positive ones above.
RailType: A non-negative integer referencing the rail type to use as defined by either a Structure.Rail or a Structure.Cycle command.

This command starts a new rail represented by the index RailIndex. Upon the point where this command is used, a rail of the same RailIndex must either not have been used so far in the route, or must have been ended via a Track.RailEnd command. If a rail of the same RailIndex was already used in the route, the default values of X, Y and RailType are the values last used by that rail, otherwise 0. If the rail is to be updated, use the Track.Rail command. If it is to be ended, use the Track.RailEnd command. You can end a rail of a given RailIndex and start a new rail of the same RailIndex at the same track position provided that the old rail is first ended and the new rail started afterward. For every block, a structure, determined by RailType, is automatically placed.

This command can only be used at the beginning of a block.


Track.Rail RailIndex; X; Y; RailType
RailIndex: A positive integer (>=1) indicating which rail index to use.
X: A floating-point number representing the horizontal distance from the player’s rail, by default measured in meters. Negative values indicate left, positive ones right.
Y: A floating-point number representing the vertical distance from the player’s rail, by default measured in meters. Negative values indicate below, positive ones above.
RailType: A non-negative integer referencing the rail type to use as defined by either a Structure.Rail or a Structure.Cycle command.

This command starts a new rail or updates an existing rail. The rail is represented by the index RailIndex. If a rail of the same RailIndex was already used in the route, the default values of X, Y and RailType are the values last used by that rail, otherwise 0. If the rail is to be ended, use the Track.RailEnd command. You can end a rail of a given RailIndex and start a new rail of the same RailIndex at the same track position provided that the old rail is first ended and the new rail started afterward. In each block, the X and Y values are repeated if a Track.Rail command is not used for that block. As a consequence, updating the X or Y values affects the layout of the rail from the preceding block only. Changing the RailType will affect the rail from the point on where this command is used. If this command is used multiple times on the same track position for the same rail, then the first instance of the command takes effect, while subsequent ones are ignored.

This command can only be used at the beginning of a block.

Using a RailIndex value of 0 is not valid for this command: Errata Note

Track.RailStart vs. Track.Rail

If you want to start a new rail, you can either use Track.RailStart or Track.Rail. When using Track.RailStart, you provide markup that a new rail is in fact to be started, which is invalid if the rail already exists. Using an explicit Track.RailStart will protect you from using a RailIndex which is already in use, in which case an error message is generated.


Track.RailType RailIndex; RailType
RailIndex: A non-negative integer indicating which rail index to change. The player’s rail can be referred to with index 0. The default value is 0.
RailType: A non-negative integer referencing the rail type to use as defined by either a Structure.Rail or a Structure.Cycle command. The default value is 0.

This command changes the rail type for an existing rail, represented by RailIndex. The rail must have been started with a Track.RailStart or Track.Rail command and must not have been ended by a Track.RailEnd command. Changing the RailType will affect the rail from the point on where this command is used.

This command can only be used at the beginning of a block.


Track.RailEnd RailIndex; X; Y
RailIndex: A positive integer (>=1) indicating which rail index to use.
X: A floating-point number representing the horizontal distance from the player’s rail, by default measured in meters. Negative values indicate left, positive ones right.
Y: A floating-point number representing the vertical distance from the player’s rail, by default measured in meters. Negative values indicate below, positive ones above.

This command ends an existing rail, represented by the index RailIndex. The default values of X and Y are the ones last used by the rail. Once this command is used for a specific RailIndex, the corresponding rail is considered to be non-existing afterward.

This command can only be used at the beginning of a block.

Using a RailIndex value of 0 is not valid for this command: Errata Note

Example of Track.RailStart, Track.Rail, Track.RailType and Track.RailEnd commands
With Track
1000, .RailStart 1; 3.8; 0.0; 0
1025, .RailType 1; 1
1050, .Rail 1; 1.9; 0.0; 0
1075, .RailEnd 1

In the preceding example, rail 1 starts with an x-value of 3.8 and bears a rail index which corresponds to an object intended to depict a straight rail. The rail keeps the x-value of 3.8 at track position 1025, where the rail type is changed to correspond to an object intended to depict an s-shaped curve. At track position 1050, the rail is redefined to have an x-value of 1.9, after which the rail is straight again until 1075, where it is ended, still having an x-value of 1.9.


Track.Accuracy Value
Value: A non-negative floating-point number representing the accuracy of the track. The default value is 2.

This command sets the accuracy of the track from this point on. Values should be in the range from 0 to 4, where 0 means perfect accuracy (no inaccuracy at all), 1 means very good accuracy (high speed lines), 2 means good accuracy, 3 means mediocre accuracy, and 4 means poor accuracy. Intermediate values are also possible. Currently, values below 0 are clamped at 0, and values above 4 are clamped at 4.


Track.Adhesion Rate
Rate: A non-negative floating-point number measured in percent representing the adhesion of the track. The default value is 100.

This command sets the adhesion of the track from this point on. As a reference, the value of 135 represents dry conditions, 85 represents frost and 50 represents snowy conditions. With a value of 0, the train will not be able to move at all.

● 11.2. Geometry

Track.Pitch Rate
Rate: A floating-point number measured in per thousands representing the pitch of the track. The default value is 0.

This command defines the pitch of all rails from this point on. Negative values indicate a downward gradient, positive ones an upward gradient. The value of 0 represents a level track. Rate can be calculated from a length difference X and a height difference Y in the following way:

Rate expressed through X and Y:
ƒ Rate = 1000 * Y / X

This command can only be used at the beginning of a block.


Track.Curve Radius; CantInMillimeters
Radius: A floating-point number representing the radius of the curve, by default measured in meters. The default value is 0.
CantInMillimeters: A floating-point number which represents the superelevation of a banked curve, always measured in millimeters (0.001 meters). The default value is 0. See also Options.CantBehavior.

This command defines the radius of the curve for the player’s rail from this point on. Negative values for Radius indicate a curve to the left, positive ones to the right. The value of 0 represents straight track. The CantInMillimeters parameter defines the cant (superelevation) in millimeters. If Options.CantBehavior is 0 (default), only the absolute value of CantInMillimeters is considered, and the superelevation is always towards the curve center (inward). Also, cant cannot be applied on straight track. If Options.CantBehavior is 1, CantInMillimeters is signed, i.e. negative values bank outward and positive ones inward on curved track. Also, cant can be applied on straight track, where negative values bank toward the left and positive ones toward the right.

This command can only be used at the beginning of a block.


Track.Turn Ratio
Rate: A floating-point number representing a turn. The default value is 0.

This command creates a point-based turn at the point of insertion. Ratio indicates the ratio between the length difference Z and the horizontal offset X in the following way:

ƒ Ratio = X / Z

A negative ratio represents a turn to the left, a positive one to the right. The value of 0 represents a straight track.

This command can only be used at the beginning of a block.

This command is deprecated - use Track.Curve instead.


Track.Height Y
Y: A floating-point number representing the height of the player’s rail, by default measured in meters.

This command defines the height of the player’s rail above the ground at the point of insertion. It influences the placement of the ground objects defined via Structure.Ground and changed via Track.Ground. The height is interpolated between adjacent Track.Height commands. For example, the following two codes produce equivalent results:

Example of a Track.Height command interpolated at 25m boundaries:
1000, Track.Height 1
1075, Track.Height 4
Example of Track.Height explicitly set each 25m to produce the same result:
1000, Track.Height 1
1025, Track.Height 2
1050, Track.Height 3
1075, Track.Height 4

This command can only be used at the beginning of a block.

● 11.3. Objects

Track.FreeObj RailIndex; FreeObjStructureIndex; X; Y; Yaw; Pitch; Roll
RailIndex: A non-negative integer representing the rail on which to place the object. The default value is 0.
FreeObjStructureIndex: A non-negative integer representing the object to place as defined via Structure.FreeObj. The default value is 0.
X: The x-offset from the (straight) rail, by default measured in meters. Negative values represent the left, positive ones the right. The default value is 0.
Y: The y-offset from the (straight) rail, by default measured in meters. Negative values represent below the top of the rails, positive ones above. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

This places a “free” object a single time on a specified rail. The object must have been loaded via Structure.FreeObj(FreeObjStructureIndex) prior to using this command.


Track.Wall RailIndex; Direction; WallStructureIndex
RailIndex: A non-negative integer representing the rail on which to start or update the wall. The default value is 0.
Direction: An integer indicating which wall to use as described below.
WallStructureIndex: A non-negative integer representing the object to place as defined via Structure.WallL and Structure.WallR. The default value is 0.

▸ Options for Direction:

-1: The WallL object (left wall) is used.
0: Both the WallL and WallR objects are used.
1: The WallR object (right wall) is used.

This starts or updates a wall on a specified rail. The object must have been loaded via Structure.WallL(WallObjectIndex) or Structure.WallR(WallObjectIndex) prior to using this command. The walls are placed at the beginning of every block until a corresponding Track.WallEnd ends the wall for this rail. Please note that walls are resurrected if a rail is ended via Track.RailEnd and then started again via Track.RailStart or Track.Rail unless the wall was also ended via Track.WallEnd.

This command can only be used at the beginning of a block.


Track.WallEnd RailIndex
RailIndex: A non-negative integer representing the rail on which to end an existing wall.

This ends an existing wall that was previously started via Track.Wall on a specified rail. The wall is not placed for the block in which this command is used.

This command can only be used at the beginning of a block.


Track.Dike RailIndex; Direction; DikeStructureIndex
RailIndex: A non-negative integer representing the rail on which to start or update the dike. The default value is 0.
Direction: An integer indicating which dike to use as described below.
DikeStructureIndex: A non-negative integer representing the object to place as defined via Structure.DikeL and Structure.DikeR. The default value is 0.

▸ Options for Direction:

-1: The DikeL object (left dike) is used.
0: Both the DikeL and DikeR objects are used.
1: The DikeR object (right dike) is used.

This starts or updates a dike on a specified rail. The object must have been loaded via Structure.DikeL(DikeObjectIndex) or Structure.DikeR(DikeObjectIndex) prior to using this command. The dikes are placed at the beginning of every block until a corresponding Track.DikeEnd ends the dike for this rail. Please note that dikes are resurrected if a rail is ended via Track.RailEnd and then started again via Track.RailStart or Track.Rail unless the dike was also ended via Track.DikeEnd.

This command can only be used at the beginning of a block.


Track.DikeEnd RailIndex
RailIndex: A non-negative integer representing the rail on which to end an existing dike.

This ends an existing dike that was previously started via Track.Dike on a specified rail. The dike is not placed for the block in which this command is used.

This command can only be used at the beginning of a block.


Track.Pole RailIndex; NumberOfAdditionalRails; Location; Interval; PoleStructureIndex
RailIndex: A non-negative integer representing the rail on which to start or update the pole. The default value is 0.
NumberOfAdditionalRails: A non-negative integer representing the amount of additional rails covered by this pole (i.e. this rail, plus NumberOfAdditionalRails rails). The default value is 0.
Location: If NumberOfAdditionalRails is 0, the side on which the pole is placed (see below), or the x-offset in multiples of 3.8 meters if NumberOfAdditionalRails is at least 1. The default value is 0.
Interval: An integer multiple of the block length specifying the interval in which poles are placed.
PoleStructureIndex: A non-negative integer representing the object to place as defined via Structure.Pole. The default value is 0.

This starts or updates a pole on a specified rail. The object must have been loaded via Structure.Pole(NumberOfAdditionalRails; PoleStructureIndex) prior to using this command. The poles are placed at the beginning of every block whose track positions are an integer multiple of the Interval (that is not necessarily at the same location this command is placed). If NumberOfAdditionalRails is 0, Locationindicates the side of the rail on which the pole is placed. If Location is less than or equal to 0, the pole is placed as-is (corresponding to the left side). If Location is greater than 0, the object is mirrored on the x-axis and then placed (corresponding to the right side). If NumberOfAdditionalRails is greater than or equal to 1, Location specifies the x-offset in multiples of 3.8 meters. Please note that poles are resurrected if a rail is ended via Track.RailEnd and then started again via Track.RailStart or Track.Rail unless the pole was also ended via Track.PoleEnd.

This command can only be used at the beginning of a block.


Track.PoleEnd RailIndex
RailIndex: A non-negative integer representing the rail on which to end an existing pole.

This ends an existing pole that was previously started via Track.Pole on a specified rail. The pole is not placed for the block in which this command is used.

This command can only be used at the beginning of a block.


Track.Crack RailIndex1; RailIndex2; CrackStructureIndex

This deforms a specified object to fill the space between two Rails.

RailIndex1: A non-negative integer representing the first RailIndex.
RailIndex2: A non-negative integer representing the second RailIndex.
CrackStructureIndex: A non-negative integer representing the object defined in Structure.Crack

Note: If RailIndex1 is to the left of RailIndex2 (e.g. it’s X-cordinate is smaller), then the object defined in Structure.CrackL will be used.
Otherwise, the objects defined in Structure.CrackR will be used.


Track.Ground CycleIndex
CycleIndex: A non-negative integer representing the cycle of ground objects to place as defined via Structure.Ground or Cycle.Ground.

This defines which ground objects to place from this point on. Ground objects are always placed at the beginning of a block at a certain height below the player’s rail (as defined via Track.Height). If no cycle was defined for CycleIndex, then the object loaded into Structure.Ground(CycleIndex) is placed. Otherwise, the cycle of ground objects as defined via Cycle.Ground(CycleIndex) is used.

This command can only be used at the beginning of a block.

● 11.4. Stations

Track.Sta Name; ArrivalTime; DepartureTime; PassAlarm; Doors; ForcedRedSignal; System; ArrivalSound; StopDuration; PassengerRatio; DepartureSound; TimetableIndex
Name: The name of the station. This is displayed in the timetable and in messages, so should not be omitted.
ArrivalTime: The time the player’s train is expected to arrive at this station. Special values may also appear - see below.
DepartureTime: The time the player’s train is expected to depart from this station. Special values may also appear - see below.
PassAlarm: Indicates whether the pass alarm device should remind the driver of stopping at this station. The default value is 0.
Doors: Indicates which doors should open at this station. The default value is 0.
ForcedRedSignal: Indicates whether the signal behind the last station stop should be red on a train approach. The default value is 0.
System: Indicates which built-in safety system should apply until the next station. The default value is 0.
ArrivalSound: The sound file to be played on arrival, relative to the Sound folder.
StopDuration: A positive floating-point number indicating the minimum stop duration in seconds, including door opening/closing times. The default value is 15.
PassengerRatio: A non-negative floating-point number indicating the relative amount of passengers in the train from this station on. As a reference, 100 represents a train with normal amount of passengers, while 250 represents an over-crowded train. Values in-between 0 and 250 should be used. The default value is 100.
DepartureSound: The sound file to be played before departure (departure time minus sound duration minus door closing time), relative to the Sound folder.
TimetableIndex: A non-negative integer representing the timetable to be shown from this station on as defined via Train.Timetable(TimetableIndex).

▸ Available options for ArrivalTime:

time: The train is expected to arrive at this particular time.
omitted: The train may arrive at any time.
P or L: All trains are expected to pass this station.
B: The player’s train is expected to pass this station, while all other trains are expected to stop.
S: The player’s train is expected to stop at this station, while all other trains are expected to pass.
S:time: The player’s train is expected to arrive at this particular time, while all other trains are expected to pass.

▸ Available options for DepartureTime:

time: The train is expected to depart at this particular time.
omitted: The train may depart at any time.
T or =: This is the terminal station. If ForcedRedSignal is set to 1, the departure signal will be held at red indefinately.
T:time: This is the terminal station. If ForcedRedSignal is set to 1, the departure signal will still switch to green before the specified time as if this was a regular station.
C: This is a station at which to “change ends”. See the description below.
C:time: This is a station at which to “change ends”. Changing ends will take place at the specified time unless StopDuration interferes. See the description below.
J:index: This is a station at which the train is “jumped” to the station specified by index. See the description below.
J:index:Time: This is a station at which the train is “jumped” to the specified by index. Jumping will take place at the specified time unless StopDuration interfers. See the description below.

▸ Available options for PassAlarm:

0: The pass alarm device does not remind the driver of stopping at this station.
1: The pass alarm device reminds the driver of stopping at this station.

▸ Available options for Doors:

L or -1: The left doors are expected to open at this station.
N or 0: No doors are expected to open at this station, i.e. the train should simply come to a hold.
R or 1: The right doors are expected to open at this station.
B: Both the left and right doors are expected to open at this station.

▸ Available options for ForcedRedSignal:

0: Signals are unaffected by this station.
1: The signal immediately following the last station stop is hold at red until the train reaches the stopping area and the departure time.

▸ Available options for System:

ATS or 0: ATS should be used from this station on. The following track is not be equipped with ATC.
ATC or 1: ATC should be used from this station on. The following track is equipped with ATC.

This command initializes a new station. It should be placed at the beginning of the station platform. In order to finalize the creation of a station, use the Track.Stop command to place stop points following this command. All following Track.Stop commands will be associated to this station. At least one Track.Stop command must follow if trains are expected to stop at this station.

Special Features:

Stations can be marked as “changing ends” in the departure time. At such stations, when the departure time has been reached, the train will automatically jump to the next station. This feature is intended to fake a reverse of traveling direction without the need to jump to stations manually from the menu.

Similarly, stations can be marked as a “jump point” in the departure time. At such stations, when the departure time has been reached, the train will automatically jump to the specified station index.

The first occuring station in a route may not be of the Terminal type.


Track.Station Name; ArrivalTime; DepartureTime; ForcedRedSignal; System; DepartureSound
Name: The name of the station. This is displayed in the timetable and in messages, so should not be omitted.
ArrivalTime: The time the player’s train is expected to arrive at this station. Special values may also appear - see below.
DepartureTime: The time the player’s train is expected to depart from this station. Special values may also appear - see below.
ForcedRedSignal: Indicates whether the signal behind the last station stop should be red on a train approach. The default value is 0.
System: Indicates which built-in safety system should apply until the next station. The default value is 0.
DepartureSound: The sound file to be played before departure (departure time minus sound duration minus door closing time), relative to the Sound folder.

▸ Available options for ArrivalTime:

time: The train is expected to arrive at this particular time.
omitted: The train may arrive at any time.
P or L: All trains are expected to pass this station.
B: The player’s train is expected to pass this station, while all other trains are expected to stop.
S: The player’s train is expected to stop at this station, while all other trains are expected to pass.
S:time: The player’s train is expected to arrive at this particular time, while all other trains are expected to pass.

▸ Available options for DepartureTime:

time: The train is expected to depart at this particular time.
omitted: The train may depart at any time.
T or =: This is the terminal station. If ForcedRedSignal is set to 1, the departure signal will be held at red indefinately.
T:time: This is the terminal station. If ForcedRedSignal is set to 1, the departure signal will still switch to green before the specified time as if this was a regular station.
C: This is a station at which to “change ends”. See the description below.
C:time: This is a station at which to “change ends”. Changing ends will take place at the specified time unless StopDuration interferes. See the description below.

▸ Available options for ForcedRedSignal:

0: Signals are unaffected by this station.
1: The signal immediately following the last station stop is hold at red until the train reaches the stopping area and the departure time.

▸ Available options for System:

ATS or 0: ATS should be used from this station on. The following track is not be equipped with ATC.
ATC or 1: ATC should be used from this station on. The following track is equipped with ATC.

This command initializes a new station. Prefer using the Track.Sta command, which includes more options. For the options of Track.Sta which are not offered by Track.Station, the following values apply:

PassAlarm 0 (not used)
Doors B (both doors must be opened)
ArrivalSound Not played
StopDuration 15
PassengerRatio 100
TimetableIndex Not affected

The command should be placed at the beginning of the station platform. In order to finalize the creation of a station, use the Track.Stop command to place stop points following this command. All following Track.Stop commands will be associated to this station. At least one Track.Stop command must follow if trains are expected to stop at this station.

Stations can be marked as “changing ends” in the departure time. At such stations, when the departure time has been reached, the train will automatically jump to the next station. This feature is intended to fake a reverse of traveling direction without the need to jump to stations manually from the menu.

The first occuring station in a route may not be of the Terminal type.


Track.Stop Direction; BackwardTolerance; ForwardTolerance; Cars
Direction: On which side to place a default stop post. The default value is 0.
BackwardTolerance: A positive floating-point number indicating the allowed tolerance in the backward direction, by default measured in meters. The default value is 5.
ForwardTolerance: A positive floating-point number indicating the allowed tolerance in the forward direction, by default measured in meters. The default value is 5.
Cars: A non-negative integer indicating for how many cars this stop point applies, or 0 for all cars. The default value is 0.

▸ Available options for Direction:

-1: A stop post is created on the left side.
0: No stop post is created.
1: A stop post is created on the right side.

This command places a stop point for the last created station. If there is more than one stop defined for a station, a train is expected to stop at the first Track.Stop command for which Cars is greater than or equal to the number of cars the train has, where a value for Cars of 0 indicates a stop point regardless of the amount of cars to be used as the last stop point for a station.

Example of a station with multiple stop points:
With Track
0100, .Sta STATION
0178, .Stop 1;;;4 ,; for 4 or less cars
0212, .Stop 1;;;6 ,; for 5 or 6 cars
0246, .Stop 1;;;8 ,; for 7 or 8 cars
0280, .Stop 1;;;0 ,; for 9 or more cars

Track.Form RailIndex1; RailIndex2; RoofStructureIndex; FormStructureIndex
RailIndex1: The RailIndex to which the platform is bound.
RailIndex2: The secondary RailIndex to which the platform will deform. Special values may also appear- see below.
RoofStructureIndex: A non-negative integer representing the object to be placed as defined via Structure.Roof
FormStructureIndex: A non-negative integer representing the object to be placed as defined via Structure.Form and Structure.FormC

▸ Available options for RailIndex2:

Any current RailIndex: The form is deformed to meet the specified RailIndex.
L: The specified FormL, FormCL and RoofL objects are placed without deformation.
R: The specified FormR, FormCR and RoofR objects are placed without deformation.

Note: If RailIndex1 is to the left of RailIndex2 (e.g. it’s X-cordinate is smaller), then the objects defined in Structure.FormL, Structure.FormCL and Structure.RoofL will be used.
Otherwise, the objects defined in Structure.FormR, Structure.FormCL and Structure.RoofR will be used.

● 11.5. Signalling and speed limits

Track.Limit Speed; Post; Cource
Speed: A positive floating-point number representing the speed, by default measured in km/h, or 0 to indicate no speed restriction. The default value is 0.
Post: The side on which to place a default Japanese-style speed limit post. The default value is 0.
Cource: The directional indication. The default value is 0.

illustration_limit

▸ Options for Post:

-1: The post is placed on the left side of the track.
0: No post will be placed.
1: The post is placed on the right side of the track.

▸ Options for Cource:

-1: The post applies for a left-bound track.
0: The post does not indicate a particular direction.
1: The post applies for a right-bound track.

This command defines the new speed limit from this point on. If the new speed limit is lower than the current speed limit, the new speed limit will take effect immediately. If the speed limit is higher than the current speed limit, the new speed limit will take effect only once the whole train has passed this point. By setting Speed to 0, the speed restriction is released. By setting Post to either -1 or 1, a default Japanese-style speed post is placed at the respective side of the track. Setting Course to either -1 or 1 includes a directional indication, which is usually used at railroad switches to indicate that the speed limit only applies if the respective direction is being taken. If Speed is set to 0, the setting of Course has no effect.


Track.Section a0; a1; a2; …; an
ai: A non-negative number specifying one of the section’s aspects.

This command starts a section, the functional part of signalling, to be used in conjunction with Track.SigF, which creates a visual representation of a section (a signal). The ai parameters specify the aspects the section can bear. An aspect of 0 corresponds to a red section which must not be passed by a train. The a0 term is mandatory.

Default versus simplified section behavior

There are two different modes of behavior on how to interpret the ai parameters. The mode can be set via Options.SectionBehavior. The following are separate descriptions for default and simplified behavior.

Default behavior:
The ai terms specify the aspect the section should bear depending on how many sections ahead are clear until a red one is encountered. The order of the terms is relevant. The same aspect may occur multiple times.

▸ Meanings of the ai terms:

a0: The aspect to show when this section is occupied by a train or otherwise hold at red.
a1: The aspect to show when this section is clear, but the immediately following section is red.
a2: The aspect to show when this section and the following section are clear, but the one immediately following the latter one is red.
an: The aspect to show when n sections are clear before a red one is encountered.

In the case more sections ahead are clear than indicated by the ai terms, the section will bear the aspect of an.

Simplified behavior:
The ai terms specify the repertoire of aspects the section can have. A section will bear the smallest of the ai which is greater than the current aspect of the upcoming section. If no such ai exists, the section will bear the aspect of an. The order of the ai is irrelevant. If the same aspect occurs multiple times, this has no effect.

Example of a Track.Section command in conjunction with a Track.SigF command:
With Track
1000, .Section 0;2;4, .SigF 3;0;-3;-1

Track.SigF SignalIndex; Section; X; Y; Yaw; Pitch; Roll
SignalIndex: A non-negative integer representing the signal to be placed as defined via Signal(SignalIndex).Load.
Section: A non-negative integer representing the section this signal is attached to, with 0 being the current section, 1 the upcoming section, 2 the section after that, and so on.
X: The X-coordinate to place the signal object, by default measured in meters. The default value is 0.
Y: The Y-coordinate to place the signal object, by default measured in meters. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

This command creates a non-function signal, that is, a visual representation of a section as defined via Track.Section. Setting Y to a negative number resets the y-coordinate to 4.8 meters and attaches a default signal post. Also see Track.Section.

If no object has been defined by Signal(SignalIndex), one of the default Japanese signals is used:

▸ Default signals for SignalIndex:

3: A three-aspect signal having aspects red, yellow and green.
4: A four-aspect (type A) signal having aspects red, ●●yellow-yellow, yellow and green.
5: A five-aspect (type A) signal having aspects red, ●●yellow-yellow, yellow, yellow-green and green.
6: A repeating signal equivalent to that created by Track.Relay.

Track.Signal Aspects; Unused; X; Y; Yaw; Pitch; Roll
Track.Sig Aspects; Unused; X; Y; Yaw; Pitch; Roll
Type: The number of aspects for this signal. The default value is -2.
Unused: This argument is not used by openBVE.
X: The X-coordinate to place the signal object, by default measured in meters. The default value is 0.
Y: The Y-coordinate to place the signal object, by default measured in meters. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

▸ Options for Type:

illustration_signals_small
2: A two-aspect (type A) signal having aspects red and yellow.
-2: A two-aspect (type B) signal having aspects red and green.
3: A three-aspect signal having aspects red, yellow and green.
4: A four-aspect (type A) signal having aspects red, ●●yellow-yellow, yellow and green.
-4: A four-aspect (type B) signal having aspects red, yellow, ●●yellow-green and green.
5: A five-aspect (type A) signal having aspects red, ●●yellow-yellow, yellow, yellow-green and green.
-5: A five-aspect (type B) signal having aspects red, yellow, yellow-green, green and ●●green-green.
6: A six-aspect signal having aspects red, ●●yellow-yellow, yellow, yellow-green, green and ●●green-green.

This command creates a functional signal. You can choose from the available options for Aspect to create any of the default Japanese signals. Setting X to 0 creates a functional but invisible signal similar to Track.Section. Setting X to a non-zero number and Y to a negative number resets the y-coordinate to 4.8 meters and attaches a default signal post.

Example of a four-aspect type B signal without a post at x=-3 and y=5:
1000, Track.Signal -4;;-3;5
Example of a four-aspect type B signal including a post at x=-3 and y=4.8:
1000, Track.Signal -4;;-3;-1

Track.Signal is similar to using Track.Section and Track.SigF in one command.


Track.Relay X; Y; Yaw; Pitch; Roll
X: The X-coordinate at which to place the object, by default measured in meters. The default value is 0.
Y: The Y-coordinate at which to place the object, by default measured in meters. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

This commands creates a default Japanese repeating signal. The repeating signal repeats the state of the upcoming signal. Setting X to zero does not create a repeating signal, but forces the command to be ignored. Setting X to a non-zero number and Y to a negative number resets the y-coordinate to 4.8 and attaches a default signal post.

● 11.6. Safety systems

Track.Beacon Type; BeaconStructureIndex; Section; Data; X; Y; Yaw; Pitch; Roll
Type: A non-negative integer representing the type of the beacon to be transmitted to the train.
BeaconStructureIndex: A non-negative integer representing the object to be placed as defined via Structure.Beacon, or -1 to not place any object.
Section: An integer representing the section to which the beacon is attached, namely 0 for the current section, 1 for the upcoming section, 2 for the section behind that, etc., or -1 for the next red section.
Data: An integer representing arbitrary data specific to the beacon type to be transmitted to the train.
X: The X-coordinate at which to place the object, by default measured in meters. The default value is 0.
Y: The Y-coordinate at which to place the object, by default measured in meters. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

This command places a beacon (transponder). The object must have been loaded via Structure.Beacon(BeaconStructureIndex) prior to using this command. When the train passes the beacon, the type of beacon and various data will be transmitted to the train, including the state of the referenced section.

It should be noted that the built-in safety systems also receive data from these beacons as Track.Beacon(Type) is roughly equivalent to Track.Transponder(Type). Please see the page about beacon standards for more information.


Track.Transponder Type; Signal; SwitchSystem; X; Y; Yaw; Pitch; Roll
Track.Tr Type; Signal; SwitchSystem; X; Y; Yaw; Pitch; Roll
Type: The type of the transponder. The default value is 0.
Signal: The signal this transponder references. The default value is 0.
SwitchSystem: Whether to automatically switch the safety system. The default value is 0.
X: The X-coordinate at which to place the object, by default measured in meters. The default value is 0.
Y: The Y-coordinate at which to place the object, by default measured in meters. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

▸ Options for Type:

illustration_transponders
0: An S-type transponder used by ATS-S. Usually placed 600m in front of a signal.
1: An SN-type transponder used by ATS-SN. Usually placed 20m in front of a signal.
2: An accidental departure transponder. Usually placed shortly behind a station stop.
3: An ATS-P pattern renewal transponder. Usually placed 600m, 280m, 180m, 130m, 85m or 50m in front of a signal, depending on the circumstances.
4: An ATS-P immediate stop transponder. Usually placed either 25m or 30m in front of a signal, depending on the circumstances.

▸ Options for Signal:

0: The upcoming signal is referenced.
1: The signal immediately behind the upcoming signal is referenced.
n: The n‘th signal behind the upcoming signal is referenced.

▸ Options for SwitchSystem:

-1: The transponder does not switch the train between ATS-SN and ATS-P.
0: The transponder automatically switches the train to ATS-SN for transponder types 0 and 1, and to ATS-P for types 3 and 4.

This command places a transponder, usually for the built-in safety systems ATS-SN or ATS-P. For more information about these systems and their transponders, see the user’s documentation about ATS.

It should be noted that custom safety system plugins also receive data from these transponders as Track.Transponder(Type) is roughly equivalent to Track.Beacon(Type). Please see the page about beacon standards for more information.

Go here to find out more about ATS-SN and ATS-P.

There is a tutorial available for the proper use of ATS-SN and ATS-P in route files, including all of the five transponders.


Track.AtsSn

This command places an S-type transponder for the built-in safety system ATS-SN, referencing the upcoming signal, and automatically switching to ATS-SN. The command is equivalent to Track.Tr 0;0;0. See there for more information.


Track.AtsP

This command places a pattern renewal transponder for the built-in safety system ATS-P, referencing the upcoming signal, and automatically switching to ATS-P. The command is equivalent to Track.Tr 3;0;0. See there for more information.


Track.Pattern Type; Speed
Type: The type of speed restriction.
Speed: A non-negative floating-point number representing the speed restriction, by default measured in km/h.

▸ Options for Type:

0: A temporary speed restriction.
1: A permanent speed restriction.

This command defines a speed restriction for the built-in safety system ATS-P.

A temporary speed restriction (Type=0) is to be inserted at the point where the speed restriction should apply. ATS-P will know about this speed restriction in advance and will brake the train so that the train meets the speed restriction at that point. Once the point is passed, the speed restriction no longer applies.

A permanent speed restriction (Type=1) is to be inserted at the point where the speed restriction should apply, however, ATS-P does not know about this limit in advance and will only brake the train from that point on. For a higher degree of realism, insert permanent speed restrictions at the same point as ATS-P transponders. A permanent speed restriction, as the name suggests, is remembered by ATS-P and is only released by a subsequent permanent speed restriction.


Track.PLimit Speed
Speed: A positive floating-point number representing the permanent speed restriction for ATS-P, by default measured in km/h.

This command is equivalent to Track.Pattern 1;Speed. See there for more information.

● 11.7. Miscellaneous

Track.Back BackgroundTextureIndex
BackgroundTextureIndex: A non-negative integer representing the background image to be displayed as defined via Texture.Background(BackgroundTextureIndex).

This command defines which background image to show from now on.

This command can only be used at the beginning of a block.


Track.Fog StartingDistance; EndingDistance; RedValue; GreenValue; BlueValue
StartingDistance: A floating-point number indicating the start of fog, by default measured in meters. The default value is 0.
EndingDistance: A floating-point number indicating the end of fog, by default measured in meters. The default value is 0.
RedValue: An integer ranging from 0 to 255 representing the red component of the fog. The default value is 128.
GreenValue: An integer ranging from 0 to 255 representing the green component of the fog. The default value is 128.
BlueValue: An integer ranging from 0 to 255 representing the blue component of the fog. The default value is 128.

This command defines the fog from this point on, or deactivates fog. If fog is to be enabled, StartingDistance must be less than EndingDistance. If fog is to be disabled, StartingDistance must be greater than or equal to EndingDistance.

Fog affects the coloring of objects. Objects before the starting distance appear as-is, objects after the ending distance appear in the fog color, and objects in-between blend linearly between those. The background image is affected by fog as well. For the fog calculations, the background image is assumed to be at 600 meters distance from the camera, regardless of the actual viewing distance.

Depending on Options.FogBehavior, there are two options how this command affects fog from this point on. In block-wise mode, the current fog blends from the beginning of this block to the new settings at the end of this block. The new setting is kept for following blocks. This is the default behavior. In interpolation mode, each Track.Fog command defines a control point for fog, where all of the settings (distances and colors) are interpolated linearly between the control points.

This command can only be used at the beginning of a block.


Track.Brightness Value
Value: A non-negative integer within the range from 0 to 255. The default value is 255.

This command marks a point which affects the brightness in the cab. Value is measured from 0 (dark) to 255 (light), and is linearly interpolated between successive Track.Brightness commands for any given point on the track. This command should be used for tunnels, bridges, station roofs, or anything else that would affect the brightness as perceived inside the cab.

Example:
With Track
1200, .Brightness 255 ,; before the bridge starts
1205, .Brightness 128 ,; directly under the bridge here
1210, .Brightness 255 ,; as soon as the bridge ends

Track.Marker FileName; Distance
FileName: The file name for the marker image, relative to the Object folder.
Distance: A non-zero floating-point number indicating the length for which the marker image is displayed, by default measured in meters.

▸ Behavior for Distance:

negative value: The marker image starts to display at the Track.Marker command, and ends -Distance meters after the Track.Marker command.
positive value: The marker image starts to display Distance meters before the Track.Marker command, and ends at the Track.Marker command.

This command shows a so-called marker image, which is displayed in the top-right corner of the screen. You can use these images for advisory or informational purposes. The RGB color of 64,64,64 inside the image is made transparent.


Track.Marker FileName.xml

A Track.Marker command, linking to a single XML file is also supported. These allow more control over markers than is available in the routefile commands.

These are fully described on the the XML Markers page…


Track.TextMarker Text; Distance; FontColor
Text: The marker text to display. (No special characters supported).
Distance: A non-zero floating-point number indicating the length for which the text is displayed, by default measured in meters.
FontColor: The font color for this marker text

▸ Behavior for Distance:

negative value: The marker image starts to display at the Track.Marker command, and ends -Distance meters after the Track.Marker command.
positive value: The marker image starts to display Distance meters before the Track.Marker command, and ends at the Track.Marker command.

▸ Available options for FontColor:

1: Black.
2: Gray.
3: White.
4: Red.
5: Orange.
6: Green.
7: Blue.
8: Magenta.

This command creates a simple textual marker, which is added to the list of messages in the upper left-hand corner of the screen.


Track.PointOfInterest RailIndex; X; Y; Yaw; Pitch; Roll; Text
Track.POI RailIndex; X; Y; Yaw; Pitch; Roll; Text
RailIndex: A non-negative integer representing the rail for the point of interest.
X: A floating-point number representing the horizontal offset from the rail, by default measured in meters. Negative values indicate left, positive ones right.
Y: A floating-point number representing the vertical offset from the rail, by default measured in meters. Negative values indicate below, positive ones above.
Yaw: The angle in degrees by which the view is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the view is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the view is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.
Text: A textual representation of the point of interest.

This command creates a point of interest which the user can jump to by pressing the CAMERA_POI_PREVIOUS (NUM 1) or CAMERA_POI_NEXT (NUM 7) keys. The camera will be placed at the specified location with the specified orientation. If Text is non-empty, a message will appear briefly showing the text.


Track.PreTrain Time
Time: The time at which the pretrain is at this track position.

This commands creates a position-time-association for an invisible preceding train in order to influence signalling. Contrary to a real preceding train as created by Route.RunInterval, the invisible preceding train created by Track.PreTrain is a way of scripting where the invisible preceding train is at any given time. The position-time-associations must be in increasing order, that is, at a later track position, the associated time must also be later. Before the first scripted time, the invisible preceding train resides at the first scripted position. In-between the first and last scripted time, the invisible preceding train moves (linearly) between the scripted points. After the last scripted time, the invisible preceding train is removed and thus clears signalling.


Track.Announce FileName; Speed
FileName: The file name for the sound to play, relative to the Sound folder.
Speed: The reference speed in km/h for speed-dependant sounds, or 0 to play the sound speed-independently. The default value is 0.

This command plays an announcement or other kind of sound in the cab once the player’s train crosses the point where this command is used. If Speed is set to 0 (default), the sound is played as-is. If a Speed is given though, the sound plays at is original pitch at the specified speed, and is pitch-modulated proportionally for other speeds, useful for custom flange sounds, pointwork sounds, etc.


Track.Doppler FileName; X; Y
FileName: The file name for the sound to play, relative to the Sound folder.
X: A floating-point number representing the horizontal offset from rail 0, by default measured in meters. Negative values indicate left, positive ones right.
Y: A floating-point number representing the vertical offset from rail 0, by default measured in meters. Negative values indicate below, positive ones above.

This command places an environmental sound effect at the specified location. The sound will play in a loop for the duration of the simulation and employs the doppler effect. (Note: All sounds in openBVE employ the doppler effect.)


Track.Buffer

This command places a bumper. The train can collide with the bumper in both the forward and backward directions. Place this command at the beginning and the end of the route. An object is not automatically created, so use Track.FreeObj to create a visual representation of the bumper if necessary.


Track.Destination Type; BeaconStructureIndex; NextDestination; PreviousDestination; TriggerOnce; X; Y; Yaw; Pitch; Roll
Type: Defines the types of trains for which this destination setter applies: -1 for AI trains only, 0 for all trains and 1 for the player train only.
BeaconStructureIndex: A non-negative integer representing the object to be placed as defined via Structure.Beacon, or -1 to not place any object.
NextDestination: An integer representing the destination value set when passing over this beacon in a forwards direction, or -1 to disable.
PreviousDestination: An integer representing the destination value set when passing over this beacon in a reverse direction, or -1 to disable.
TriggerOnce: If set to 0, this beacon will be triggered by all valid trains which pass over it. If set to 1, it will be triggered by the first valid train only.
X: The X-coordinate at which to place the object, by default measured in meters. The default value is 0.
Y: The Y-coordinate at which to place the object, by default measured in meters. The default value is 0.
Yaw: The angle in degrees by which the object is rotated in the XZ-plane in clock-wise order when viewed from above. The default value is 0.
Pitch: The angle in degrees by which the object is rotated in the YZ-plane in clock-wise order when viewed from the left. The default value is 0.
Roll: The angle in degrees by which the object is rotated in the XY-plane in clock-wise order when viewed from behind. The default value is 0.

This command places a special beacon, which sets the destination variable, available for use by plugins and animated objects. The object must have been loaded via Structure.Beacon(BeaconStructureIndex) prior to using this command.