Road-hog123

System Triggers

In addition to user-defined triggers attached to key presses or clickable meshes there are also system triggers attached to game events.

Note: System Triggers are not defined in a text file like System and Predefined Local Variables or System Macros, so it is possible that this list is incomplete—[veh_tank][] is not listed on the official wiki, for example.

collision

Triggered when the boundingbox of the bus hits something—the coll_pos_* and coll_energy system variables can be used to get more information about the nature of the collision.

int_haltewunsch

Triggered whenever a passenger decides they want to get off, which can happen multiple times a second—you should implement some kind of filtering between this trigger and any bell/buzzer sound.

railbond_#

Triggered whenever an axle of a rail vehicle passes over a joint, with # being the axle index. No default vehicle uses higher than railbond_3 (the 6-axle diesel doesn't have joint sounds).

ai_scheduled_settarget

Triggered by an AI driver of a scheduled vehicle to set the destination display to their scheduled destination. The line string (as defined in the Editor) is in SetLineTo and the terminus index (in the HOF file) in AI_target_index.

ai_scheduled_setbusstop

Triggered by an AI driver of a scheduled vehicle to set the interior display to their next scheduled bus stop. The bus stop name (as defined in the Editor) is in act_busstop.

malfunction_gettime

Added in version 2.00.

Triggered when the user requests their bus be repaired so that the game knows how long it will take for the engineer to correct the defects (excluding travel time). The duration (in minutes) is returned via the top stack value!

malfunction_reset

Added in version 2.00.

Triggered if the user accepts the repairs. Collision damage and malfunctions should be repaired, but if the maintenance condition setting is less than perfect, who's to say the engineer does a perfect job? 😏

veh_tank

Triggered every frame that refueling is active.

The script is responsible for simulating the fuel tank, fuel consumption, refuelling and reporting the fuel level via the tank_percent variable.