Docs / Routes and rail
Trolleybuses
The overhead wire, poles, switches and the gear of a vehicle.
OMSI 2 itself has no overhead wire. Its trolleybus add-ons carry a plugin DLL that reads the bus's place out of Omsi.exe's memory and moves fake poles over wires that are only meshes on a map;
none of that can run in openOMSI. openOMSI therefore has its own trolleybus simulation, built into the game and described by two small text formats, so that a map can carry a real overhead wire and a vehicle real poles and a real drive:
- the wire of a map:
trolley.txtbeside itsglobal.cfg(section "The wire" below); - the gear of a vehicle:
[trolley_pole]and a drive in its.bus(section "The gear").
Everything is worked out from mechanics and electrics, with the numbers a real trolleybus has; the constants are in the vehicle's file, not in the game.
Real trolleybus add-ons for OMSI 2 carry no wire logic of their own; how they are read and run here is in TROLLEY_MODS.md. A map's wire splines are read as the wire when no
trolley.txtis given, and a bus withcp_SHTANGALEV/cp_SHTANGAPRAVpole meshes gets poles without a[trolley_pole]block, unless its.bussays[trolley_none].
Chapters
| 1 | What it does | Two wires a fixed distance apart, one of each polarity. A bus is powered only while one pole is on the positive and the other on the negative wire, an… | 8 min |
| 2 | Switch displays | A map author can use a scripted scenery object as a switch display. Declare these numeric variables in the object's [varnamelist]; the engine supplies… | 1 min |
| 3 | 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 O… | 3 min |
| 4 | The gear: blocks of a vehicle's .bus | Inside a block every line is key value ...; keys left out keep the default. [trolley_pole] one per pole side left left | right (or -1 | 1) pos -0.3 1.… | 6 min |
| 5 | Sounds | The gear makes six sounds of its own, from noise and decaying tones (no files): A vehicle plays its own recordings of the poles as OMSI 2 buses do the… | 5 min |
| 6 | Keys | In the cab R and T are the gearbox's: the poles answer the cab's own switch and Ctrl+R there. The game's auto-start (Shift+U) also puts the poles on t… | 1 min |
| 7 | Checking it offscreen | OMSI_TROLLEY_FILE=trolley.txt OMSI_TROLLEY_UP=1 OMSI_DEBUG_TROLLEY=1 OMSI_AUTOPILOT=40 \ openomsi --map maps/<map>/global.cfg --bus Vehicles/<bus>.bus… | 1 min |
| 8 | Limits | Only the player's bus has gear simulated; AI vehicles do not run on the wire. Crossings of two wires (an overhead crossing with insulated sections) ar… | 1 min |
| 9 | The mouse's hand on a pole | A click on the cab's pole switch (a plain OMSI 2 trolleybus: cp_SHTANGALEV, cp_SHTANGAPRAV or what its model calls it) takes that pole in hand. The ti… | 2 min |
Something wrong or missing? Fix it on GitHub or open an issue.