/tg/ Station 13 - Modules - TypesVar Details - Proc Details

crossing_signal

Pedestrian crossing signal for tram

Vars

amber_distance_thresholdProximity threshold for amber warning (slow people may be in danger). This is specific to Tramstation and may need to be adjusted if the map changes in the distance between tram stops.
malfunctioningAre we malfunctioning?
red_distance_threshold
signal_directionIf the signal is facing east or west
signal_stategreen, amber, or red.
tram_idThe ID of the tram we control
tram_refWeakref to the tram piece we control

Procs

find_tramFinds the tram, just like the tram computer
on_tram_travellingOnly process if the tram is actually moving
set_signal_stateSet the signal state and update appearance.
update_operatingUpdate processing state.

Var Details

amber_distance_threshold

Proximity threshold for amber warning (slow people may be in danger). This is specific to Tramstation and may need to be adjusted if the map changes in the distance between tram stops.

malfunctioning

Are we malfunctioning?

red_distance_threshold

signal_direction

If the signal is facing east or west

signal_state

green, amber, or red.

tram_id

The ID of the tram we control

tram_ref

Weakref to the tram piece we control

Proc Details

find_tram

Finds the tram, just like the tram computer

Locates tram parts in the lift global list after everything is done.

on_tram_travelling

Only process if the tram is actually moving

set_signal_state

Set the signal state and update appearance.

Arguments: new_state - the new state (XING_STATE_RED, etc) force_update - force appearance to update even if state didn't change.

update_operating

Update processing state.

Returns whether we are still processing.