crossing_signal

Pedestrian crossing signal for tram
Vars | |
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 |
Procs | |
find_tram | Finds the tram, just like the tram computer |
on_tram_travelling | Only process if the tram is actually moving |
set_signal_state | Set the signal state and update appearance. |
update_operating | Update 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

- Proximity threshold for red warning (running people will likely not be able to cross) This is specific to Tramstation and may need to be adjusted if the map changes in the distance between tram stops.
- This checks the distance between the tram and the signal, and based on the current Tramstation map this is the optimal number to prevent the lights from turning red for no reason for a few moments.
- If the value is set too high, it will cause the lights to turn red when the tram arrives at another station. You want to optimize the amount of warning without turning it red unnessecarily.
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.