Train Network for Players

by leeh

QoL and advanced functionality for players using trains for transport, including improved destination selection dialog and automated train calling.

Content
1 year, 7 months ago
0.17 - 1.1
5.99K
Transportation

Changelog

Version: 0.12.6
Date: 2022-09-12
  Changes:
    - allow manual mode key to toggle between auto/manual, not just manual
    - optimise handling of circuit network signals when looking for train stops
Version: 0.12.5
Date: 2022-03-19
  Changes:
    - speech bubbles for supply trains are now console messages when outside game
      view or the player has no character
    - fixes error when player has no character
Version: 0.12.4
Date: 2021-12-04
  Changes:
    - add support for tracking train id changes with checks for the Vehicle Wagon 2
      loading/unloading behaviour
    - fix logic when arrival timeout was set to zero via PR from Highlander37
Version: 0.12.3
Date: 2020-02-12
  Changes:
    - Fix error when trains get a no path event and destinations now invalid
Version: 0.12.2
Date: 2020-12-21
  Changes:
    - Fix error when a train can't path to a rail target
Version: 0.12.1
Date: 2020-12-19
  Changes:
    - Add new per-player setting to override vanilla temporary stops with a
      wait condition of 'Passenger Not Present'
      - If a second temporary stop is added that will automatically replace
        the current temporary stop
    - Allow boarding timeout setting to be 0, which then uses a wait
      condition of 'Passenger Present'
    - Fix a crash when cloning train schedules with rail targets
Version: 0.12.0
Date: 2020-12-12
  Changes:
    - Factorio 1.1 support - Pull Request from kryojenik
Version: 0.11.5
Date: 2020-12-15
  Changes:
    - fix a crash when cloning train schedules with rail targets
Version: 0.11.2
Date: 2020-07-27
  Changes:
    - Fix a schedule applying error when selecting a station already in the
      trains schedule
Version: 0.11.1
Date: 2020-07-26
  Changes:
    - Reimplement railtool dynamic stops using native 0.18 functionality for
      scheduling to a rail
    - Prioritise regular train stops above LTN stops for dispatch
Version: 0.11.0
Date: 2020-07-04
  Changes:
    - Update stationselect gui styling to be closer to factorio-0.18.  Now uses
      a draggable frame with standard gui styles where possible, with station
      lists inside tabs
    - Extend 'Modded Train Stop Dispatch Behaviour' setting to add an 'Ignore'
      option, which makes all modded train stops invalid for dispatch
Version: 0.10.6
Date: 2020-06-03
  Changes:
    - Fix arrival behaviour switch not working in newer 0.18 releases
Version: 0.10.5
Date: 2020-02-06
  Changes:
    - Fix errors when we've detected an invalid state during redispatch
    - Add extra validation during redispatch the train is the one expected
Version: 0.10.4
Date: 2020-01-21
  Changes:
    - Add factorio 0.18 support
Version: 0.9.5
Date: 2020-02-06
  Changes:
    - Fix errors when we've detected an invalid state during redispatch
    - Add extra validation during redispatch the train is the one expected
Version: 0.9.4
Date: 2020-01-21
  Changes:
    - Fix non-depot ltn stops being ignored
    - Improve logic for detecting train pathing events to railtool created dynamic
      stops when working out the direction of the stop
Version: 0.9.2
Date: 2020-01-08
  Changes:
    - Extend station selection gui so trains can be set to manual mode on arrival
    - Add a migration from station pins to more generic player preferences
Version: 0.9.1
Date: 2019-12-29
  Changes:
    - Extend supply train dispatching to support temporary stations, so supply trains
      can now be dispatched to rail segments as well as stations
    - Add a migration to cancel existing requests to temporary stops, to support the
      cleanup and refactoring around temporary stations
Version: 0.9.0
Date: 2019-12-21
  Changes:
    - Add supply train dispatching, so a train full of supplies (e.g. an outpost train,
      landfill, concrete, etc) can be dispatched to the players location independently
      of tnfp trains

      - Note: Theres been a lot of code cleanup and refactoring in this release so
        *be cautious*, ensure you have backup saves and maybe the ability to downgrade
        the mod.  It's been tested to a given degree, but trains are reaaaaally
        complicated things to interact with

      - First Steps:
        - Enable 'Provide TNfP Supply Train Rail Tool' in your shortcut bar, or go into
          the keyboard control settings and define a hotkey for it
        - In the keyboard control settings set 'Next Supply Train Station' to your
          preference.  It defaults to CTRL+EQUALS but CTRL+MOUSE_WHEEL_UP is better
        - Supply stations are added via the 'TNfP Supply Station' virtual signal, in
          the same way as normal tnfp stations.  The signal value will determine the
          order they're listed (lowest first)
        - Ensure you dont have duplicate signal values, it will ignore them
        - Trains must be in automatic mode waiting at a signalled supply station to be
          available

      - Usage:
        - Use the 'Provide TNfP Supply Train Rail Tool hotkey or shortcut to get a
          special railtool
        - Select the train you want to dispatch (using the 'Next Supply Train Station'
          keyboard shortcut, default CTRL+EQUALS)
        - Drag the railtool over a valid train stop and the train will be dispatched to
          that location.  On arrival it will switch to manual mode and reset its
          schedule
Version: 0.8.1
Date: 2019-12-09
  Changes:
    - Fix an error cleaning up deleted pinned stations
    - Fix pinned stations not appearing in the 'TNfP Stations' list
Version: 0.8.0
Date: 2019-12-04
  Changes:
    - Add support for using the railtool in alternate mode, triggered by holding shift
      Alt mode will change the way dispatch works so on arrival the schedule will still
      be reset -- but the train will instead switch to manual mode and then remain in
      place.  Works for both dispatch to the player and a redispatch from onboard a
      train
    - Add station name to arrival messages
    - Fix that if a trains schedule before redispatch was originally blank, we restore
      a blank schedule after rearrival.
    - Fix a potential error in train state pruning
Version: 0.7.0
Date: 2019-11-25
  Changes:
    - Add 'TNfP Home Station' virtual signal.  Stations with this signal will be pinned
      at the very top of the Station Select dialog, above normal pinned stations
    - Pressing enter to submit the search field in the Station Select dialog will now
      dispatch to the first station in the list [Github PR from coderanger]
    - Fix closest train detection logic when dispatching [Github PR from coderanger]
    - Provide candidate rails to closest train detection logic for temporary stations
    - Allow manual mode shortcut to apply to trains that have just arrived after
      dispatch
    - Block TSM requester stations from dispatch to avoid breaking TSMs train counter
Version: 0.6.0
Date: 2019-11-08
  Changes:
    - Add the ability to pin stations to the top of the 'All Stations' view
    - Add a configurable keyboard shortcut for setting the current train to manual mode
    - Add a configurable keyboard shortcut for providing a railtool and opening the map
    - Right clicking the station selects search bar will now clear the search field
    - Rework the station select gui so its more compact and cleaner
    - Rework the logic when a player boards/disembarks a train:
      - Exiting a train after it arrives at an onward destination is now treated the
        same as exiting whilst on the way
      - Add a special handler so if a trains onward destination is already in its
        schedule and its a tnfp managed train, it will just follow that wait condition
        and will not resume its previous schedule
      - Split completion messages so its clearer what a train will do next
Version: 0.5.1
Date: 2019-10-07
  Changes:
    - Add a mod setting to control the default view in the station select dialog
    - Amend dispatch logic so the train arriving at a different station than the one it
      expects but with the same name is handled gracefully
    - Fix localisation of mod setting dropdowns
Version: 0.5.0
Date: 2019-09-29
  Changes:
    - Add a search field to the Station Select dialog to filter the list of stations
      with a mod setting to automatically focus it.
    - Add a button to the Station Select dialog to open the map with a railtool in hand
    - The railtool will now automatically close the map and clear the cursor on success
    - Make the station select dialog use localised text strings
    - Updated railtool icon
    - Replace stdlib dependency with standard util.table.deepcopy()
Version: 0.4.3
Date: 2019-07-31
  Changes:
    - Fix an error since 0.17.59 with assigning an empty train schedule using an empty
      hash instead of nil.
Version: 0.4.2
Date: 2019-07-17
  Changes:
    - Fix a multiplayer desync issue and improve state management
    - Fix an error in multiplayer with the stationselect
Version: 0.4.1
Date: 2019-07-12
  Changes:
    - Add explicit support for LTN train stops, permitting dispatch to any LTN stop
      that is not a depot.  LTN Depots are ignored due to them rescheduling trains.
    - Add explicit support for TSM train stops, permitting dispatch to requester stops.
      TSM supplier stops are ignored due to them rescheduling trains.
    - Add general support for other modded train stops, with a configuration option to
      control whether these are treated 'safely' and ignored or dispatched to.
    - Fix a crash when using the railtool a second time over a temporary station.
Version: 0.4.0
Date: 2019-06-06
  Changes:
    - Add the TNfP Rail Tool (SHIFT+ALT+P or shortcut).  This is a selection tool which
      can create temporary train stops anywhere on the map:
      - Allows the player to request a TNfP train when they're not near a train stop.
      - Allows the player to send their current train anywhere they want from the map
        view.
      As with all train stops, only north-south or east-west rails are valid and
      the rail must be unsignalled.
    - Allow TNfP requests when on a non-TNfP train.  This means the station select can
      now be used for pocket trains, or 'borrowed' trains.
    - Pressing the input shortcut again (ALT-P) now cancels the request.
    - Draw a line from the player to the station we're dispatching to so its clearer
      where to go.  Can be turned off via mod setting.
    - Minor icon update.
    - Allow the station select to be triggered on trains with no schedule.
    - Significant refactoring to support the TNfP Rail Tool.
Version: 0.3.0
Date: 2019-06-01
  Changes:
    - TNfP is now beta rather than experimental.
    - Add support for requesting a train when already on a TNfP train which will then
      skip straight to redispatching.
    - Improve validity and error checking, particularly around driving state, stations
      and train statuses.
    - Initial multiplayer support.  We will now periodically clear requests for trains
      and players that become invalid, as well as avoid double dispatching trains or
      trains with passengers.
    - Add some additional log messages to make errors and completion clearer.
Version: 0.2.0
Date: 2019-05-30
  Changes:
    - Omit temporary stations when copying schedules, as they don't copy correctly
    - Remove arrival behaviour, as boarding timeout is now applied as a wait
      condition.
    - Handle stations we are dispatching to becoming invalid.
    - Improve redispatching for an onward journey so the default waitcondition is
      the passenger is no longer present.  We also now complete correctly if the player
      gets off the train.
    - Add handling of trains switched to manual mode when they're not moving.
Version: 0.1.0
Date: 2019-05-25
  Changes:
    - initial release