Temsar Train Energy Distribution

by DATMs

Позволяет поездам равномерно распределять энергию между аккумуляторами вставленными в сетку оборудования. Важно!! Сам по себе мод добавляет только механику распределения энергии между аккумуляторами которые находятся в сетке оборудования железнодорожного состава.

Content
2 days ago
2.0
3
Trains

Changelog

Version: 2.0.0
Date: 06.09.2025
  Changes:
    - Updated for Factorio 2.0.60 compatibility
    - Added support for train.rolling_stock API
    - Added configuration change handler for smooth migration
    - Maintained backward compatibility with train.carriages where possible
    - Fixed crash due to surface.get_trains() API removal in Factorio 2.0
    - Replaced with find_entities_filtered approach to get locomotives and their trains
    - Added helper function get_all_trains() for proper train discovery

  Additional fixes & improvements (post-release):
    - GUI: main monitor button placement improved (tries top, then left, then screen) so button visible in sandbox/map-editor
    - GUI: added periodic live updates (script.on_nth_tick) for open monitor windows
    - GUI: made on_gui_click and update routines robust (safe element checks, fallbacks when global.trains is empty)
    - Equipment & carriage naming: use prototype.localised_name or carriage.localised_name when available, otherwise fallback to raw name to avoid "Unknown key" and LuaEquipment errors
    - Localization: added en/ru locale files and replaced hardcoded GUI strings with localised keys
    - Carriage and train headings reworked to build captions without %s-format placeholders (avoids localization format issues)
    - Added debug commands (/debug_trains, /debug_distribution) to aid diagnosis of distribution and train data
    - Settings safety: clamp transfer-rate and sensible min/max for tick rates to prevent extreme behaviour from invalid settings
    - Fixed logic causing energy to appear to only move into a single carriage in some configurations (improved transfer limiting and diagnostic output)
    - Miscellaneous UI fixes and defensive checks to prevent runtime errors in editor/sandbox modes
Version: 1.0.2
Date: 07.11.2021
  Changes:
    - Ignore carriages without a grid intead of crashing.
    - Added some optional depedencies for mods that give grids to carriages.
Version: 1.0.1
Date: 07.11.2021
  Info:
    - Whoops, missed a comma
Version: 1.0.0
Date: 07.11.2021
  Info:
    - Initial Release