LTN - Logistic Train Network

by Optera
Adds new train stops forming a highly configurable, fully automated logistic network. With cargo ships installed also adds a logistic port for ships.
2 days ago
0.14 - 0.17
268878

Changelog

Version: 1.10.8
Date: 2019-04-21
  Bugfixes:
    - Stop distance cache is reset on version updates
              

Version: 1.10.7
Date: 2019-04-13
  Features:
    - Added on_dispatcher_no_train_found event #173
  Bugfixes:
    - Fixed nil error in debug log introduced in 1.10.6
              

Version: 1.10.6
Date: 2019-04-06
  Bugfixes:
    - Restore lamp color after fixing stop error #171
    - always start with stop updated after a config change, ensure consistent data and filled tables
              

Version: 1.10.5
Date: 2019-03-30
  Changes:
    - moved more functionality to Opteras Library
  Bugfixes:
    - signal names are generated properly for locomotives and wagons with localised_name
              

Version: 1.10.4
Date: 2019-03-19
  Changes:
    - moved functionality to Opteras Library
  Bugfixes:
    - renaming stops in editor can cause errors
              

Version: 1.10.3
Date: 2019-03-14
  Features:
    - added on_delivery_pickup_complete
  Changes:
    - removed get_ prefix and _event suffix from events
  Bugfixes:
    - fixed potential upgrade path errors
              

Version: 1.10.2
Date: 2019-03-07
  Features:
    - added Stack Thresholds, only for items of course
  Changes:
    - refactored code into modules
    - interface events return data formatted like base events, e.g. event.provided_by_stop, event.requests_by_stop
  Bugfixes:
    - fixed potential nil reference #157
              

Version: 1.10.1
Date: 2019-03-03
  Features:
    - recipes are more affordable with Bob Electronics
    - added circuit network as dependency for technology
    - fluid unloads signal fluids with constant -1 #154
  Changes:
    - switched dependency for creative-mode to the 0.17 re-release
              

Version: 1.10.0
Date: 2019-02-27
  Features:
    - updated to Factorio 0.17
    - new thumbnail
    - status lamp works without power
              

Version: 1.9.11
Date: 11.2.2019
  Changes:
    - removed placeholder dependency for Noxys Multidirectional Trains, use old versions at own peril
              

Version: 1.9.10
Date: 10.2.2019
  Features:
    - added interface on_delivery_completed_event, {delivery = delivery, trainID = trainID}
    - added interface on_delivery_failed_event, {delivery = delivery, trainID = trainID}
    - added Provided_by_Stop to on_dispatcher_updated_event
  Bugfixes:
    - mining or destroying a train carriage will once again fail attached delivery
    - Interface Stop data requestPriority always returned 0
    - typo reqestPriority in initialization
              

Version: 1.9.9
Date: 3.2.2019
  Bugfixes:
    - Desync from 1.9.8 changes to update interval and stop index
              

Version: 1.9.8
Date: 3.2.2019
  Features:
    - support for rewritten Noxys Multidirectional Trains https://github.com/CyaNox/Noxys_Multidirectional_Trains/pull/8
    - added Dispatcher.UpdateInterval to Interval
  Bugfixes:
    - Interface reported nil thresholds for error state stops
              

Version: 1.9.7
Date: 13.1.2019
  Features:
    - added setting "limit stops per tick"
    - invalid stops have IO entities and references removed when encountered during runtime
  Bugfixes:
    - trying to write or read from invalid stop IO entities no longer crashes
    - blueprints of ltn ports preserve circuit connections
    - placing stops next to each other no longer links the wrong IO entities
              

Version: 1.9.6
Date: 12.12.2018
  Features:
    - added logistic port if cargo ships is active
  Changes:
    - performance tweaks
  Bugfixes:
    - handle layered icons of different sizes
              

Version: 1.9.5
Date: 7.12.2018
  Changes:
    - license exempts streaming from no commercial
              

Version: 1.9.4
Date: 16.11.2018
  Features:
    - lamp colors can also be read through red wire
    - cables from hidden combinator to lamp no longer originate in the middle of the lamp sprite
              

Version: 1.9.3
Date: 23.10.2018
  Bugfixes:
    - fix corrupted stops in on_configuration_changed
    - remove corrupt stops if fixing fails
              

Version: 1.9.2
Date: 15.10.2018
  Bugfixes:
    - left over init from 1.9.0 caused error #141
  Changes:
    - renamed remote interface ltn-interface to logistic-train-network
              

Version: 1.9.1
Date: 14.10.2018
  Bugfixes:
    - stops are removed before surface deletion #139
    - added creative mode blacklisting to on_load
  Changes:
    - turned remote interface callbacks into events
    - added interface demo to /Interface_Demo/control.lua
              

Version: 1.9.0
Date: 11.10.2018
  Features:
    - added remote interface callbacks to recieve stop and dispatcher data
  Bugfixes:
    - Trains arriving at depots in error state will not be added to available train list
              

Version: 1.8.2
Date: 2.10.2018
  Bugfixes:
    - setting Stop timeout was missing some description
    - changing "Stop is Depot" signal to 0 didn't remove available train
    - deactivating a depot through circuit condition didn't remove available train
    - short circuited depot didn't remove available train
              

Version: 1.8.1
Date: 12.9.2018
  Bugfixes:
    - on_load checks for corrupt stops
              

Version: 1.8.0
Date: 17.8.2018
  Features:
    - added optional circuit conditions to schedules
  Changes:
    - enabled read from train for all ltn stops by default
    - enabled send to train for all ltn stops by default
    - generated schedules use ≥ (ltn stops still parse > for loading list output)
              

Version: 1.7.13
Date: 29.7.2018
  Features:
    - added notifications for skipping request processing due to no transport capacities in depot
    - spam filter works with no-train-found notifications #128
              

Version: 1.7.12
Date: 20.7.2018
  Bugfixes:
    - recreate stops missing from global stop list in on_configuration_changed
  Changes:
    - removed incompatible flag of there-is-my-ghost 0.16.7 seems to work well with LTN
    - removed creative mode from optional dependencies until it's updated to 0.16
              

Version: 1.7.11
Date: 15.7.2018
  Changes:
    - flagged there-is-my-ghost as incompatible until that mod stops messing up LTN's composite stop entity
              

Version: 1.7.10
Date: 17.6.2018
  Bugfixes:
    - Avoid nil error when station is renamed during build #122
  Changes:
    - pushed to 0.16.51 stable
              

Version: 1.7.9
Date: 31.5.2018
  Bugfixes:
    - newly created deliveries reset stop lamps from blue to yellow
    - FARL (and possibly other mods) could mine IO entities
              

Version: 1.7.8
Date: 23.5.2018
  Bugfixes:
    - crash Key "icon_size" not found #116
              

Version: 1.7.7
Date: 12.5.2018
  Changes:
    - pushed to 0.16.36 stable
    - added creative mode (fix for 0.16) to optional dependencies
    - added requester network id to provider not found message
    - added requester & provider merged network id to train not found and train found message
    - moved train not found message to from detailed to notification level
              

Version: 1.7.6
Date: 37.3.2018
  Features:
    - parked trains controlled by LTN are signalled with blue lamp #106
              

Version: 1.7.5
Date: 3.3.2018
  Bugfixes:
    - Nil reference Error when deconstructing stop with set network id #107
              

Version: 1.7.4
Date: 17.2.2018
  Changes:
    - Replaced lua signal merging with api function
              

Version: 1.7.3
Date: 10.2.2018
  Bugfixes:
    - Error when copy-pasting station names https://forums.factorio.com/viewtopic.php?f=214&t=57578 and #102
              

Version: 1.7.2
Date: 3.2.2018
  Features:
    - remove filters and locked slots from trains entering a depot
    - support entity icons with sizes other than 32x32 https://forums.factorio.com/viewtopic.php?f=48&t=57151
  Bugfixes:
    - renaming could cause wrong stations being removed from station name list https://forums.factorio.com/viewtopic.php?f=214&t=57371
  Removed:
    - Chinese translation, please use a language pack like https://mods.factorio.com/mod/zh-CN
              

Version: 1.7.1
Date: 20.1.2018
  Bugfixes:
    - automatically generated icons are always cropped to 32x32
  Changes:
    - Updated Chinese translation
              

Version: 1.7.0
Date: 20.1.2018
  Features:
    - Added binary encoded network ID
    - Encoded position signals have unique icons
    - Encoded position signals are properly grouped by locomotive and wagon types
  Changes:
    - Removed obsolete migration
              

Version: 1.6.4
Date: 14.1.2018
  Bugfixes:
    - Trains are reinitialized each configuration change to catch changes to locomotives and wagons
    - Trains where not properly removed from lookup table when leaving stops
              

Version: 1.6.3
Date: 7.1.2018
  Bugfixes:
    - Error when removing depot in state yellow #95
  Changes:
    - pushed base to 0.16.14
              

Version: 1.6.2
Date: 30.12.2017
  Features:
    - in game changelog
  Changes:
    - pushed base to 0.16.8
    - data phase item detection is more robust
    - migrating from versions older than 1.1.1 displays error message
              

Version: 1.6.1
Date: 20.12.2017
  Features:
    - hr graphics
    - yellow depot lamp color indicating a train with assigned delivery still being parked
  Removed:
    - migration support for versions < 1.1.1 (final Factorio 0.14 release)
  Changes:
    - stop timeout description no longer mentions inactivity #83
    - train references from MainLocomotive.unit_number to train.id
    - deliveries will be removed instantly if the assigned train changes composition e.g a wagon is removed
    - lamp colors update faster
  Bugfixes:
    - mining a single locomotive parked at an ltn stop would not update the stop
              

Version: 1.6.0
Date: 14.12.2017
  Features:
    - updated to Factorio 0.16
    - train composition signal for artillery wagon
              

Version: 1.5.5 - last build for Factorio 0.15
Date: 14.12.2017
  Features:
    - added depot inactivity setting
  Changes:
    - Mod Description includes LTN
              

Version: 1.5.4
Date: 8.12.2017
  Features:
    - option to reset delivery and schedule when trains leave requester
              

Version: 1.5.3
Date: 1.12.2017
  Features:
    - lamp outputs number of active deliveries as value of yellow signal (green wire only)
    - lamp outputs error code as values of red/pink signal (green wire only)
    - depots, short circuited and disabled stops reset stops active deliveries count completely (use to reset stops showing wrong counts)
  Bugfixes:
    - active deliveries to/from a stop sometimes isn't properly updated
              

Version: 1.5.2
Date: 13.11.2017
  Changes:
    - station time out from inactivity to time passed
    - reduced overhead in on_train_changed_state
    - pushed base to 0.15.37 (stable)
              

Version: 1.5.1
Date: 3.11.2017
  Changes:
    - updated Chinese translation
    - stops deactivated by circuit condition or other scripts are not updated
    - short circuited stops are skipped without reading circuit signals
    - short circuit and deactivated error state take priority over duplicate name
              

Version: 1.5.0
Date: 17.10.2017
  Features:
    - added request priority control signal #22
  Changes:
    - changed provider priority icon to be in line with request priority
    - changed provider prioritization to provider priority > #existing deliveries from provider > amount #69
  Bugfixes:
    - request threshold icon to show ≤ instead of ≥
    - locked slots where subtracted from total train slots instead of per wagon
              

Version: 1.4.14
Date: 13.10.2017
  Features:
    - added mod setting "Dispatcher Enabled"
              

Version: 1.4.13
Date: 6.10.2017
  Changes:
    - reverted base dependency to 0.15.34 (stable)
              

Version: 1.4.12
Date: 2.10.2017
  Features:
    - allowed negative provider priority again #64
  Changes:
    - pushed base to 0.15.35
              

Version: 1.4.11
Date: 29.9.2017
  Features:
    - thresholds are read as absolute values
    - ignore negative control signals except thresholds
              

Version: 1.4.10
Date: 15.9.2017
  Changes:
    - improved circuit signal read performance
    - pushed base to 0.15.34
              

Version: 1.4.9
Date: 26.8.2017
  Features:
    - added localized mod title and mod description
  Bugfixes:
    - fixed possible integer overflow from mod settings
    - limit max values on stop and delivery timeout to 1 hour
    - limit other int settings to 2^32 -1
              

Version: 1.4.8
Date: 18.8.2017
  Features:
    - added more details to debug log messages
  Changes:
    - "no provider found" warning message changed from message level 2 to 1
    - message level dropdown texts better reflect their behaviour
              

Version: 1.4.7
Date: 11.8.2017
  Bugfixes:
    - distance check could prevent better matching trains from being picked
    - error encoding train composition for trains longer than 31 carriages #55
              

Version: 1.4.6
Date: 6.8.2017
  Changes:
    - bumped required Factorio version to current stable
  Bugfixes:
    - Dispatcher picked trains closest to request stop instead of providing stop
    - local wagon capacity lookup table could potentially cause desync
              

Version: 1.4.5
Date: 1.8.2017
  Changes:
    - removed left over debug message
              

Version: 1.4.4
Date: 1.8.2017
  Changes:
    - performance optimizations
  Bugfixes:
    - deliveries where not properly reserved
              

Version: 1.4.3
Date: 30.7.2017
  Bugfixes:
    - fixed nil reference when no providers are available
              

Version: 1.4.2
Date: 30.7.2017
  Changes:
    - internally store train capacity for faster access when searching available trains
    - rewritten Dispatcher logic
              

Version: 1.4.1
Date: 30.7.2017
  Bugfixes:
    - Items where not removed from providers after being added to an order
    - orders where merged between different requester
              

Version: 1.4.0
Date: 17.7.2017
  Features:
    - Dispatcher is no longer limited to 1 train/s
  Changes:
    - Dispatcher goes through requests by age of requests/item instead of requests/stop
    - spread dispatcher update over 3 ticks
              

Version: 1.3.5
Date: 8.7.2017
  Features:
    - "message level" for console messages only (no level 4: debug)
    - "write debug logfile" checkbox for debug log generation into Factorio-current.log
  Removed:
    - "log level" and "log output" settings
  Changes:
    - provider prioritization making deliveries merge more reliably (#trains > provider priority > #existing deliveries from provider > amount)
  Bugfixes:
    - potential nil reference during stop update
              

Version: 1.3.4
Date: 21.6.2017
  Changes:
    - code cleanup
    - train state change and train created events are only active if LTN stops exist
              

Version: 1.3.3
Date: 18.6.2017
  Changes:
    - automatically set output combinator limit
    - exceeding output slot size results in some signals being not generated by the output and a console message
              

Version: 1.3.2
Date: 4.6.2017
  Changes:
    - Chinese translation
  Bugfixes:
    - fixed error with no longer existing items #43
              

Version: 1.3.1
Date: 2.6.2017
  Features:
    - added support for force merging
  Changes:
    - added force to deliveries
              

Version: 1.3.0
Date: 2.6.2017
  Features:
    - Request Threshold and Provide Threshold
    - Disable Warnings Messages control signal #34
    - limit messages to force where possible #40
    - workaround for fluid wagon residue #31
  Removed:
    - Minimum Delivery Size and Ignore Minimum Delivery Size
    - Best Effort, Provide Threshold = 1 does the same now
    - toggle to loading list, stops only show expected inventory after loading
              

Version: 1.2.8
Date: 24.5.2017
  Features:
    - added German locale
    - added 128x128 tech icon
    - overloaded trains no longer cause requesters to flip to providers during delivery #33
  Changes:
    - set expected train inventory to default to active
  Bugfixes:
    - bug in Chinese locale
              

Version: 1.2.7
Date: 19.5.2017
  Bugfixes:
    - potential nil references in first_signal and stop ghost entities
              

Version: 1.2.6
Date: 17.5.2017
  Bugfixes:
    - error when schedule is referencing non existing items
              

Version: 1.2.5
Date: 16.5.2017
  Changes:
    - replaced workaround with get_fluid_count and get_fluid_contents
              

Version: 1.2.4
Date: 13.5.2017
  Features:
    - added toggle between output of positive load, negative unload amount and expected train inventory after (un-)loading
    - added Chinese locale by 745275633
    - formated setting descriptions, should be less wall of text
  Bugfixes:
    - a crash when adding carriages to trains parked at provider or requester
              

Version: 1.2.3
Date: 9.5.2017
  Features:
    - duplicate names are checked across all train-stops instead of only LTN Stops
  Changes:
    - improved performance of checking duplicate names by using events introduced with 0.15
  Bugfixes:
    - desync https://forums.factorio.com/viewtopic.php?f=23&t=46873
    - dispatcher picks providers with incompatible train length
              

Version: 1.2.2
Date: 7.5.2017
  Changes:
    - overloading trains updates delivery size once per update interval (before update was only done once train leaves provider)
  Bugfixes:
    - overloading trains reserved too much of an item/fluid in provider
    - fluid deliveries where accidentally deleted at departure from provider
              

Version: 1.2.1
Date: 1.5.2017
  Changes:
    - updated mod setting descriptions
    - replaced floating-text hack to get inventory sizes with 0.15 functions
    - added support of icons{} to signal generation
              

Version: 1.2.0
Date: 29.4.2017
  Features:
    - updated to Factorio 0.15
    - added support for any Fluid Wagon for fluid transport
    - config.lua settings moved to options-mod settings
  Removed:
    - support of RailTanker (RailTankers will be ignored, removed fake item conversions)
    - removed grey detection signal from output
  Changes:
    - short circuit detection uses network id
              

Version: 1.1.3 - last version for Factorio 0.14
Date: 19.5.2017
  Bugfixes:
    - fixed error when schedule is referencing non existing items
    - fixed potential nil references in first_signal and stop ghost entities
              

Version: 1.1.1
Date: 24.4.2017
  Features:
    - speed up loading by skipping parts of initialization according to old_version
  Changes:
    - automatically remove orphaned lamp control entities
    - messages differing only in item count are treated as the same message by the message filter
    - decreased delivery-removed-timeout and delivery-removed-train-invalid from log level 2 to 1
  Bugfixes:
    - deconstruction of broken stops properly removes stop and surrounding I/O entities