Pollution Solutions: Space Age Refresh Patch

by TheDaud

Runtime stability patch for Pollution Solutions collectors on Space Age surfaces. Refreshes collectors after load/build events and optionally adds atmosphere-scaled supplemental collection. Does not replace the original mod or its loot system.

Content
a month ago
2.0
109
Planets Logistics Combat Enemies Environment Mining Fluids Circuit network Manufacturing Power Storage

Changelog

Version: 0.2.2
  Bugfixes:
    - Fixed a crash during rebuild-collectors refresh where runtime LuaEntityPrototype.max_health was read even though Factorio 2.0 exposes max health through LuaEntity.max_health or LuaEntityPrototype.get_max_health().
    - Hardened collector rebuilding so health, quality, and fluidbox restore use pcall-safe accessors instead of direct runtime prototype fields.
    - Raised script_raised_destroy during rebuilds so other mods can forget the old collector before this patch raises script_raised_built for the rebuilt collector.
  Changes:
    - Added English locale for all runtime settings and string setting values.
    - Added runtime setting-change handling so refresh queues are cleared or rebuilt when zpsa settings are changed mid-save.
Version: 0.2.1
  Bugfixes:
    - Supplemental collection now inserts fluid first and only removes the pollution that was actually inserted.
    - Fixed duplicate refresh-queue processing per tick.
  Changes:
    - Supplemental collection is enabled by default, staggered, capped per collector, and interactive without scanning every collector together.
Version: 0.2.0
  Features:
    - Reworks supplemental atmosphere collection as a staggered round-robin queue.
    - Adds collectors-per-tick budget to avoid all collectors collecting on the same tick.
    - Raises default supplemental interval to 300 ticks.
    - Adds atmosphere multiplier cache.
    - Adds center/cross/3x3 sample modes to trade accuracy for UPS stability.
  Bugfixes:
    - Collector tracking now updates on build, robot build, script build, revive, mining, death, and script destroy.