openOMSI GitHub Discord

Docs / Making content / HTML textures: modern engine

The route and the timetable

1 min readEdit this pagedocs/HTMLTEXTURE_MODERN.md

Everything about the current trip lives in omsi.vehicle.route.

path meaning
route.active true when the bus has a timetable (a duty)
route.source where the stops come from: "timetable", "ibis" or "none"
route.line the line text
route.destination the text on the destination sign
route.stops[i] one stop: index, name, arrival, departure ("HH:MM"), arrivalSec, departureSec (seconds after midnight), served, current
route.current the stop the bus is at or heading for (same fields as a stop)
route.terminus the last stop (same fields)
route.nextIndex index of the next stop. null when active is false
route.delaySec delay in seconds. Negative means early
route.ibis.line, .suffix, .routeIndex, .terminusIndex, .terminusCode the raw numbers the IBIS itself holds

A few things worth knowing:

  • served is true once a stop has been handled. When the last stop of a trip is served, the trip is over. A page can use that to start the return trip.
  • route.stops can be empty. If the bus has no timetable and nobody typed a route into the IBIS, there is simply nothing to show. Check stops.length before you draw.
  • Without a duty (active is false) the game doesn't advance the stops on its own. A page that wants to show progress then has to keep its own counter.

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

↑↓ to move↵ to open