The .rw route format - Quick reference

Notes:
  Arguments highlighted in green are affected by UnitOfLength in [Options].
  Arguments highlighted in blue are affected by UnitOfSpeed in [Options].
  Each command takes one line, except for commands starting in an @ sign, which can be chained together on the same line.


Track positions
Number
Number1 : Number2 : ... : Numbern

Preprocessing directives
$Include(File1; Weight1; File2; Weight2; ...)
$Chr(AsciiCode)
$Rnd(Minimum; Maximum)
$Sub(VariableIndex) = Value
$Sub(VariableIndex)
$If(Condition)
$ElseIf()
$EndIf()

[Options]
UnitOfLength = FactorInMeters1; FactorInMeters2; ...; FactorInMetersn
UnitOfSpeed = FactorInKmph
BlockLength = Length
ObjectVisibility = { 0 = legacy | 1 = track-based }
SectionBehavior = { 0 = index-based | 1 = value-based }
CantBehavior = { 0 = unsigned | 1 = signed }
FogBehavior = { 0 = block-wise | 1 = interpolated }

[Route]
Comment = Text
Image = FileName
Timetable = Text
Change = { -1 = service brakes (ATS) | 0 = emergency brakes (no ATS) | 1 = service brakes (ATS) }
Gauge = ValueInMillimeters
Signal(Aspect) = Speed
RunInterval = Interval0; Interval1; ...; Intervaln-1
AccelerationDueToGravity = Value
Elevation = Height
Temperature = ValueInCelsius
Pressure = ValueInKPa
AmbientLight = RedValue; GreenValue; BlueValue
DirectionalLight = RedValue; GreenValue; BlueValue
LightDirection = Theta; Phi

[Train]
Folder = FolderName
Run(RailTypeIndex) = RunSoundIndex
Flange(RailTypeIndex) = FlangeSoundIndex
Timetable(TimetableIndex).Day = FileName
Timetable(TimetableIndex).Night = FileName
Gauge = ValueInMillimeters
Interval = Interval0; Interval1; ...; Intervaln-1
Velocity = Speed

[Object]
Rail(RailStructureIndex) = FileName
Beacon(BeaconStructureIndex) = FileName
Pole(AdditionalRailsCovered, PoleStructureIndex) = FileName
Ground(GroundStructureIndex) = FileName
WallL(WallStructureIndex) = FileName
WallR(WallStructureIndex) = FileName
DikeL(DikeStructureIndex) = FileName
DikeR(DikeStructureIndex) = FileName
FormL(FormStructureIndex) = FileName
FormR(FormStructureIndex) = FileName
FormCL(FormStructureIndex) = FileName
FormCR(FormStructureIndex) = FileName
RoofL(RoofStructureIndex) = FileName
RoofR(RoofStructureIndex) = FileName
RoofCL(RoofStructureIndex) = FileName
RoofCR(RoofStructureIndex) = FileName
CrackL(CrackStructureIndex) = FileName
CrackR(CrackStructureIndex) = FileName
FreeObj(FreeObjStructureIndex) = FileName
Back(BackgroundTextureIndex) = FileName
Back(BackgroundTextureIndex).X = RepetitionCount
Back(BackgroundTextureIndex).Aspect = { 0 = fixed height | 1 = keep aspect ratio }

[Cycle]
GroundStructureIndex = GroundStructureIndex1; GroundStructureIndex2; ...; GroundStructureIndexn

[Signal]
SignalIndex = AnimatedObjectFile
SignalIndex = SignalFileWithoutExtension; GlowFileWithoutExtension

[Railway]

Rails:
@RailStart(RailIndex, X, Y, RailStructureIndex)
@Rail(RailIndex, X, Y, RailStructureIndex)
@RailType(RailIndex, RailStructureIndex)
@RailEnd(RailIndex, X, Y)
@Accuracy(Value)
@Adhesion(Value)

Geometry:
@Pitch(ValueInPermille)
@Curve(Radius, CantInMillimeters)
@Turn(Ratio)
@Height(Height)

Objects:
@FreeObj(RailIndex, FreeObjStructureIndex, X, Y, Yaw, Pitch, Roll)
@Wall(RailIndex, Direction, WallStructureIndex)
@WallEnd(RailIndex)
@Dike(RailIndex, Direction, DikeStructureIndex)
@DikeEnd(RailIndex)
@Pole(RailIndex, AdditionalRailsCovered, Location, Interval, PoleStructureIndex)
@PoleEnd(RailIndex)
@Crack(RailIndex1, RailIndex2, CrackStructureIndex)
@Ground(CycleIndex)

Stations:
@Sta(Name, ArrivalTime, DepartureTime, PassAlarm, Doors, ForcedRedSignal, System, ArrivalSound, StopDuration, PassengerRatio, DepartureSound, TimetableIndex)
@Station(Name, ArrivalTime, DepartureTime, ForcedRedSignal, System, DepartureSound)
@Stop(Direction, BackwardTolerance, ForwardTolerance, Cars)
@Form(RailIndex1, RailIndex2, RoofStructureIndex, FormStructureIndex)

Signalling and speed limits:
@Limit(Speed, Direction, Cource)
@Section(Aspect0, Aspect1, ..., Aspectn)
@SigF(SignalIndex, Section, X, Y, Yaw, Pitch, Roll)
@Signal(Aspects, Unused, X, Y, Yaw, Pitch, Roll)
@Relay(X, Y, Yaw, Pitch, Roll)

Safety systems:
@Beacon(Type, BeaconStructureIndex, Section, Data, X, Y, Yaw, Pitch, Roll)
@Transponder(Type, Signals, SwitchSystems, X, Y, Yaw, Pitch, Roll)
@AtsSn
@AtsP
@Pattern(Type, Speed)
@PLimit(Speed)

Miscellaneous:
@Back(BackgroundTextureIndex)
@Fog(StartingDistance, EndingDistance, RedValue, GreenValue, BlueValue)
@Brightness(Value)
@Marker(FileName, Distance)
@PointOfInterest(RailIndex, X, Y, Yaw, Pitch, Roll, Text)
@PreTrain(Time)
@Announce(FileName, Speed)
@Doppler(FileName, X, Y)
@Buffer