Script SC22 Change train configuration (by adlet)
This script allows to change train configuration (remove or re-add cars).
This can emulate train coupling, without the complexity of actual coupling.
• Key features:
° Trigger upon line stop arrival or passing a signal
° Optional delay for configuration change at line stop arrival
° Can move the train along the stop platform if desired
° Retains desired configuration to restore after train reset
• Use cases:
° Light version of train coupling, cars removed temporarily. Use separate train/shift to spawn and dispatch removed cars if needed.
• IMPORTANT: Train reverts to configuration as-purchased on reset/intervention. Use signals or set additional line stops to restore the desired configuration after reset
• How it works:
° Add script to line stop where configuration change is desired. Indicate time delay and whether train needs to move along the platform
° Alternatively, change on passing a signal
° To be able to restore train configuration after reset/intervention, have script added to a signal(s) along the line. Restore will happen when train drives over any such signal. Or add configuration change to additional stops.
• Deployment notes:
° Configuration at line stop changes immediately if delay is 0. Otherwise, the earlier of set delay or 30s before departure. If less than 36s before departure, the change happens in 6s after arrival.
° Configuration change on passing signal is immediate.
° Signal struct can also be used to manually correct train configuration. Put temporary signal in front of train, uncheck box, set desired configuration.
° Push-pull trains retain flip state (driving head or tail forward)