Docs / Routes and rail / Trolleybuses
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, and both lie on wire a substation feeds. A section can be dead; between sections there is an insulator (a dead stretch around the joint, 0.8 m unless the file says otherwise).
-
Poles. Each is a boom hinged on the roof with an elevation and a swing, a spring pressing the shoe up against the wire (120 N at the working angle by default), its own mass and inertia, and a shoe whose groove holds the wire.
On the wire the shoe lies on it a boom's length from the hinge; the spring's force has to accelerate the boom along every rise of the wire. Where the wire rises faster than the boom can follow (a hanger, a kink, the wire's unevenness at speed) the shoe leaves it for a moment: the contact is open and an arc strikes if current flows. If the wire lifts out of the groove the pole has come off (bounce); it also comes off when
- the boom stands too far off the wire's direction seen from above (40 degrees by default: about 4 m off the line for a 6.5 m boom), which is what a bus leaving the wire's line, or a wrong switch position, does;
- a bend of the wire is taken too fast: the shoe cannot turn quicker than its sideways speed
allows (
kink_speed, 3 m/s: a 25 degree bend at 11 m/s is too much, at 3 m/s it is not); - the wire is out of the boom's reach or ends under the shoe. A pole that has come off springs up to its stop (80 degrees) and swings about under the bus's own motion until a rope holds it. A pole with a rope retriever pulls itself down to its hook half a second later.
-
By hand. Out of the cab, near the back of the bus (walking, the outside camera or the free camera) hold R: the rope of the pole nearest to you is in your hand and the boom rises and follows where you look (the cross-hairs of the view, the wire it meets within 1.4 m);
let go of R and the spring lifts the shoe into the wire, if you aimed it true (the shoe's horns catch a wire within 7 cm). A hand is not steady: a boom aimed at a wire from the ground wanders a few centimetres. T pulls the pole down on to its hook (on the wire it pulls the shoe off, with an arc if current flows).
Shift with either takes both poles. In the cab only poles with a motor (
motor 1) answer R and T, and they find the wire by themselves. -
Power. With no circuit the bus does not move: a vehicle with a modelled drive loses its force at once (the bus rolls on, slowing under its rolling resistance, and stops), and the torque of a scripted drive is switched off (a torque that brakes still works).
The voltage a bus finds is the substation's less what the feeder drops with the section's current, including other trolleybuses on the same section.
-
Rheostat drive (
[trolley_rheostat]): a series-wound DC motor solved against a stack of resistors; a controller steps the resistors out (14 steps) and then the field in (two weakening steps) while the current stays under what the pedal asks for, the resistors turn what they take into heat, and the contactors click;dynamic braking excites the motors from the line and drives a resistor (without the line only the mechanical brakes work).
-
Asynchronous drive (
[trolley_async]): an inverter with a force limit up to its corner speed and a power limit above it, faded out as the voltage sags and tripped in a deep sag;regenerative braking gives power back to the section as far as its feeder takes it (
regen_kwof the section plus what other buses draw), a brake resistor on the roof burns the rest; an optional battery ([trolley_battery]) moves the bus slowly (15 km/h, 30 kW by default) when it is not on the wire and charges from the line. -
Switches. With
mode powerormode indicator, a frog in the wire ([trolley_switch]) is set by a contact plate a few metres before it, when a shoe passes.In power mode the current the bus draws then says which way (power on takes the branch, coasting goes straight;
invert 1the other way), withmode indicatorthe bus's indicator on the branch's side takes the branch, withmode radiothe cab's left or right request (Trolley_Switch_Request) takes that way, and without a request the vehicle's route code (Trolley_Switch_Code) is looked up in the switch'sroutelines;a radio switch with a
channelhears only vehicles sending on it (Trolley_Switch_Channel), and with nothing it hears it keeps its position. Radio mode always receives requests inside its horizontalrange(150 m by default), including while the poles are down.It never reads a contact plate and does not wait for the power/indicator modes' 2.5 s lock: a new matching request changes the switch and its display state on the next simulation step.
Taking it the wrong way needs no rule: the shoe follows the branch while the bus goes straight on, and the pole comes off when the boom stands too far off the wire. A shoe entering a frog from either branch always goes on along the single wire.
Radio range is a circle around the frog measured from the vehicle's trolley reference position, not along the wire. There is no heading or approach filter: every radio switch in range on a matching channel can respond, even on a neighbouring road. Use channels to separate nearby receivers.
After its initial step, a vehicle transmits only on a change of direction request or route code, not continuously while holding the same selection. Releasing a request to
0transmits nothing, so a toggled or chosen switch is not handed back to the route code.A route code other than
0is also sent to each receiver as the vehicle enters its range, so the switches on a route set themselves as the bus arrives. Direction requests are never sent on entry.Loading a vehicle and changing the channel alone never transmit, and a direction selected outside reception range is not queued for later delivery. The last matching transmission sets the switch; another bus's stale selection does not immediately undo it. An unchanged position does not reset the display's change timer.
Leaving the circle, sending an unknown route or selecting another channel leaves the frog as it was. A momentary button can instead send
Trolley_Switch_Request = 2while pressed and0when released. Each press toggles the actual retained position of every matching receiver, not a remembered cab selection.Holding it does not repeat; entering range, changing the channel or changing the route while held does not toggle. Release and press again to send another toggle. A request already held when the vehicle is first stepped is not a press. Absolute left/right requests use the selection-change behavior above.
For manual-only radio control, keep the route code at
0and use a momentary toggle button. The driver reads the actual position from the roadside switch display. Range is configurable reception coverage, not a model of antenna propagation or a safety interlock. -
A shoe going through a frog. A bus's script can react to a pole crossing a frog: the crossing fires the script's triggers
Trolley_Pole<k>_Frog(that pole's own),Trolley_Frog(that frog, whichever pole crossed it) and, when the map gave the frog a name,Trolley_Frog_<name>(that frog, its spaces written as underscores).The frog's own two are fired once for each frog crossed, even when both poles crossed it: the poles are apart, so they cross a frog in steps of their own. The trigger runs before the step's
{frame}, so what it writes is read in the same frame:{trigger:Trolley_Frog_Junction} (L.L.crossed) 1 + (S.L.crossed) {end} -
A shoe going over a crossing. Where two wires cross without joining (an overhead crossing with insulated sections) the shoe goes over it: the crossing fires the script's triggers
Trolley_Pole<k>_Joint(that pole's own) andTrolley_Joint(a crossing, whichever pole).This includes the inner conductor crossing between a frog's straight and branch legs, even though those spans join at the frog. The joined endpoints themselves do not fire joint triggers;
Trolley_Frogreports passage through the frog separately. Each conductor intersection fires both triggers once.At a perpendicular crossing, each of the two conductors on one span crosses both conductors on the other span, resulting in four conductor intersections. Consequently,
Trolley_Jointfires four times and the corresponding pole-specific trigger each fire two times for one physical crossing.Trolley_Crossingfires once for that physical crossing, regardless of which pole crosses it; use it when the script should react once instead of once per conductor intersection. Either side can trigger independently; polarity is not required. A wire that passes above another flies over it and is not fired. -
Arcs and sound. Where current is broken - the shoe leaving the wire, a pole coming off, an insulator or a frog crossed under power - an arc burns
L I^2 / 2of the motor circuit's inductance (12 mH): the game draws a flash with sparks, lights the wire and the roof and cracks.Coasting through an insulator strikes none; power on through it a loud one. A frog or an insulator crossed with more than 3 A (a coasting bus's auxiliaries often draw more) arcs every time by default; a map's
[trolley_net]can make those arcs rarer, weaker or need more current (frog_arc_*,insulator_arc_*below).The chance is drawn per frog crossing and per insulator entry and exit, from the vehicle's seed (repeatable). Arcs of a shoe leaving the wire (see
roughness) and of a pole coming off are not affected.The shoes hiss on the wire, louder with the current and the speed (a loop with the rectifier's 300 Hz ripple); the contactors click, a shoe landing on the wire and a pole on its hook thud, a frog clatters. The sounds are made in the game unless the vehicle or the map gives its own (see Sounds below).
Something wrong or missing? Fix it on GitHub or open an issue.