Docs / Routes and rail / Trolleybuses
Wire switches
A [trolley_switch] is a frog where three spans meet. Its pos must be within 3 m of such a
joint. Otherwise the log warns that it "has no joint of three spans".
| Key | Meaning | Default |
|---|---|---|
| name | Name, for displays and triggers | - |
| pos | x y z of the joint |
- |
| mode | power, indicator (or blinker), radio, fixed (or manual) |
power |
| trigger | Power/indicator: contact plate distance before the frog (m, 0.5 to 60) | 9 |
| sense | The current that counts as power on (A) | 12 |
| invert | 1: power on goes straight, coasting takes the branch | 0 |
| initial | straight, branch or random |
straight |
| route | Radio: <code> <way>, way is straight, branch, left or right. Repeatable |
- |
| channel | Radio: only vehicles sending on this channel set it | any |
| range | Radio: reception radius (m, 1 to 1000) | 150 |
Power and indicator modes#
A contact plate lies trigger metres before the frog. When a shoe passes it:
- power: the current the bus draws decides. Power on takes the branch, coasting goes straight
(
invert 1reverses it); - indicator: the bus's indicator on the branch's side takes the branch.
After a change the switch is locked for 2.5 s.
Taking a switch 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 continues on the single wire.
Radio mode#
A radio switch listens to vehicles within its range:
- The cab's left or right request (
Trolley_Switch_Request) takes that way. - Without a request, the vehicle's route code (
Trolley_Switch_Code) is looked up in the switch'sroutelines. - With a
channel, the switch hears only vehicles sending on it (Trolley_Switch_Channel). - With nothing it hears, it keeps its position.
Radio switches never read a contact plate and have no 2.5 s lock. A new matching request changes the switch, and its display state, on the next simulation step. They also receive with the poles down.
Range. The 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. Range is reception coverage, not a model of radio propagation or a safety interlock.
When a vehicle sends:
- After its first step, a vehicle sends only when its direction request or route code changes, not continuously.
- Releasing a request to
0sends nothing. A 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, or changing only the channel, sends nothing.
- A direction chosen outside range is not queued for later.
Which transmission wins. The last matching transmission sets the switch. Another bus's stale selection does not undo it. An unchanged position does not reset the display's change timer. Leaving the circle, sending an unknown route, or choosing another channel leaves the frog as it was.
Momentary toggle button. A button can send Trolley_Switch_Request = 2 while pressed and 0
when released:
- Each press toggles the actual position of every matching receiver, not a remembered cab selection.
- Holding does not repeat. Entering range, changing the channel or changing the route while held does not toggle. Release and press again to toggle again.
- A request already held when the vehicle is first stepped is not a press.
For manual-only radio control, keep the route code at 0 and use a momentary toggle button. The
driver reads the actual position from the roadside switch display.
initial random#
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. 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) switch positions are not synchronized, so
initial randomswitches 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.
Something wrong or missing? Fix it on GitHub or open an issue.