Feature Api / Feature To Enable Mods To Query & Change Train/environment States

Discussion in 'Suggestions' started by coderbyday, Sep 16, 2024.

  1. coderbyday

    coderbyday New Member

    Joined:
    Sep 5, 2024
    Messages:
    5
    Likes Received:
    1
    For context, I would like to build a mod that queries all trains that are currently running in the world and make adjustments to their routes based on my own logic - the mod in question would be a "random failures and problems" mod.

    The logic would be at every set interval (say, 1 minute) the system would:
    1. Get all AI trains that are running/following a timetable within the current active session.
    2. Decide whether or not to trigger an event - this could be a random slow down of the service, or a breakdown of the service, etc.
    3. If an event is triggered - randomly select a train that gets this modification and either slow it down, command it to stop, etc.
    4. After some time has elapsed - the train resumes as normal.
    Internal state can be tracked by the mod, but the idea is that by using these APIs/commands the environment is more realistic - sometimes trains break down, sometimes trains have to run slower due to weather or disruption and can cause issues to the timetable. Rather than modifying the timetable system directly.
     

Share This Page