Docs / Making content / HTML textures
Acting on the vehicle
omsi.setVar(name, value) |
Write a script variable. |
omsi.trigger(name) |
Press a trigger of the bus's scripts, like a button in the cab does. |
omsi.setRoute(index) |
Type route omsi.depot.routes[index] into the IBIS: line, route and destination, the way a driver would. |
omsi.setLine(text) |
Set a line by its text. The game takes the first route of that line in the depot file. It matches the whole text (any letter case) or the leading digits. |
omsi.setDestination(index) |
Only change the destination sign, using omsi.depot.destinations[index]. The line and route stay as they are. |
omsi.clearLine() |
Clear the IBIS: no line, no route. Use it before a route is chosen, or to throw the current one away. |
omsi.setNextStop(index) |
With a timetable: jump to stop index of the trip, forwards or backwards. Skipped stops are not served; going back makes them due again. |
Two details that trip people up:
setNextStopgoes both ways. Forwards, the stops in between are skipped. Backwards (a "back one stop" button), the stops fromindexon are due again andservedisfalsefor them. A request for the stop the bus is already heading for changes nothing. The game applies it on its next tick, soroute.nextIndexfollows a moment later.clearLine()only touches the IBIS. It does not end the duty in the game. If the page readsroute.activeafterwards it may still betrue, so don't switch screens based on that alone.
Calls like these are handed to the game, which applies them a moment later. They don't take
effect inside the same script run. Read omsi.vehicle again in the next update.
Something wrong or missing? Fix it on GitHub or open an issue.