openOMSI GitHub Discord
Trolleybuses

Docs / Routes and rail / Trolleybuses

Frog and crossing triggers

1 min readEdit this pagedocs/TROLLEYBUS.md

On this page
  1. Frogs
  2. Crossings

A bus script can react to its poles passing frogs and crossings. The triggers run before the step's {frame}, so what they write is read in the same frame.

Frogs#

When a shoe goes through a frog, the game fires:

Trigger When
Trolley_Pole<k>_Frog That pole crossed a frog
Trolley_Frog Once per frog, whichever pole crossed it
Trolley_Frog_<name> Once for that named frog (spaces in the name become _)

The poles are apart, so they cross a frog at different moments. Trolley_Frog and Trolley_Frog_<name> still fire once per frog.

{trigger:Trolley_Frog_Junction}
(L.L.crossed) 1 + (S.L.crossed)
{end}

Crossings#

Where two wires cross without joining (an insulated overhead crossing), the shoe goes over:

Trigger When
Trolley_Pole<k>_Joint That pole crossed a conductor
Trolley_Joint A conductor was crossed, whichever pole
Trolley_Crossing Once per physical crossing

Each conductor intersection fires Trolley_Joint and the pole's own trigger once. At a perpendicular crossing each of the two wires on one span crosses both on the other: four intersections. So Trolley_Joint fires four times and each pole's trigger twice for one physical crossing. Use Trolley_Crossing to react once.

  • This includes the inner conductor crossing between a frog's straight and branch legs.
  • The joined ends at a frog fire no joint triggers. Trolley_Frog reports the frog.
  • Either side triggers independently. Polarity does not matter.
  • A wire that passes above another flies over it and fires nothing.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open