Docs / Routes and rail / Trolleybuses
The wire: trolley.txt
A map's trolley.txt sits in the folder of its global.cfg; another content root (a mod) may
hold maps/<name>/trolley.txt for a map that has none, and OMSI_TROLLEY_FILE names a file for
a test. Lines are key value, grouped in [block]s, // ends a line's meaning, coordinates
are the map's (x east, y north, z up, metres).
[trolley_net]
voltage 600 nominal line voltage (V)
spacing 0.6 distance between the two wires (m)
roughness 0.0012 unevenness of the contact wire (m); worn or icy wire: 0.003 and more
frog_arc_chance 1 chance (0..1) that a frog crossed under current arcs; 0: never
frog_arc_scale 1 multiplier of a frog arc's energy (0..10): its flash and crack
frog_arc_min_amps 3 least current (A) a frog crossing arcs with
insulator_arc_chance 1 the same for each entry into and exit from a section insulator
insulator_arc_scale 1
insulator_arc_min_amps 3
[trolley_section]
id 1
name Substation A
live 1 0: no substation feeds it
regen_kw 0 power its feeder takes back from a braking bus (kW)
feeder_ohm 0.05
[trolley_span] the centre line of the pair of wires, as many points as the wire has
section 1 bends and hangers, in the direction the positive wire is on the right of
spacing 0.6 (optional)
p 395.0 -185.4 6.10
p 392.0 -185.4 6.05
...
[trolley_switch] at a point where three spans meet
name Seeburger junction
pos 262 -185.4 6.1
mode radio power | indicator | radio | fixed
trigger 9 power/indicator: contact plate distance before the frog (m); ignored by radio
sense 12 the current that counts as power on (A)
invert 0
initial straight straight | branch | random (see below)
route 158 branch radio: route code 158 takes the branch (straight | branch | left | right)
channel 2 radio: only vehicles sending on channel 2 set it
range 150 radio: reception radius (m, 1..1000, default 150); never a contact plate
[trolley_insulator] at a joint of two spans
pos 300 -185.4 6.1
length 1.0 dead stretch (m)
[trolley_sounds] the overhead line's sounds (see Sounds): on | off | a file beside trolley.txt
frog sounds\frog.wav
switch sounds\switch.wavSpans that end within 25 cm of each other are joined. Where the sections of two joined spans
differ there is an insulator (0.8 m) unless a [trolley_insulator] gives its length.
A switch needs a joint of exactly three spans; which one is the toe (the single side) and which leaves straight or to the side is worked out from their directions. A pole can follow the wire through a joint, a switch and across spans, and a crossing of two wires that do not share a joint is not a connection.
A switch with initial random takes a way at random when the game first reads the map's wire. The game keeps that network until it quits, so placing a vehicle again or reloading the same map
keeps the positions the switches have by then; a new draw needs a restart.
In an online game
(serving, hosting or joining) the players' switches are not synchronized, so initial random
switches start straight there, the same for everyone. A room joined later on a map already
driven in the same run keeps that run's network and its positions, drawn or not.
The wire's masts and hangers are the map's own objects: the game draws the two wires (8.5 mm
thick) and nothing else, whatever vehicle is driven (a bus or a car sees the wire too; a map
without trolley.txt whose wire is read off its splines draws that wire itself). The sag
between hangers is in the points.
With trolley.txt, switches have no frog drawn over them;
OMSI_DEBUG_TROLLEY draws a marker at each, a tongue along the way it is set and a lamp
(green straight, amber to the branch), for testing. Spline-derived networks retain these
generated switch bodies, tongues and lamps in normal play, without requiring the debug flag.
OMSI_TROLLEY_DEAD=2,3 takes the sections of those ids off the supply for a run.
Something wrong or missing? Fix it on GitHub or open an issue.