Alternatively, is it possible for your mod to implement a pre-dispatch
event that allows any other mods who wish to alter the schedule to do a callback? The aim is to allow Cybersyn to maintain its vanilla behaviour (in this case, the add_available_train
call after a train completes its delivery).
- Pre-dispatch event will announce the train_id and schedule records.
- Any mod who wishes to modify it will callback with the modifications.
- Cybersyn will verify the schedule modification and then finalise it and dispatch the train.
add_available_train
will be called by Cybersyn after all stops have been served.
I see the architecture above suits the need for a clean-up mod too (or mods who want to modify wait conditions for stops), but a clean-up mod will probably have to modify the schedule only after delivery has been completed.
P/S: I am suggesting a pre-dispatch
event to minimise the amount of path revalidating a train has to do with each schedule change.