AutoPause

v0.3.9

Targeted, per-building production limiter. Automatically pause when map-wide stored amount for a product crosses thresholds that you can customize.

Beta 10 hours ago MIT No source
Source code
No source provided
Tags
Quality of Life Production UI

Screenshot 2026-11-06 120934.png

Pause or unpause a pausable building from map-wide stored totals for one product
(StoredQuantityTotal, same signal as global resource UI). One rule per building; hysteresis
so it does not flap every tick.

Status: Initial public beta. Feedback welcome.

Usage

  1. Open a pausable building inspector (mine, machine, etc.).
  2. Expand AutoPause.
  3. Turn Enable AutoPause on, pick a product, set Pause ≥ and Resume ≤ (Resume ≤ must stay below Pause ≥).
  4. Copy rule / Paste rule copies product, thresholds, and on/off between buildings.

Manual pause on the building turns AutoPause off for that building (by design).

Config (mods/AutoPause/config.json)

Defaults for new rules, eval interval, +/- step, and inspector refresh rate (inspector_status_refresh_ms, 0 = status updates only when you change something).

Persistence

Rules are saved under the mod folder as autopause_rules.txt (entity id, product, thresholds, enabled). Not embedded in game saves yet; that may come in a later version.

Remove from save

Safe to disable the mod; any buildings the mod had paused stay paused in the save until you unpause them in-game.

Logs: %APPDATA%\Captain of Industry\Logs\ (lines prefixed AutoPause:)

Significant Update

Nov 07, 2026 v0.3.7

Several bugs squished and new save persistence added. Delete any remaining "autopause_rules.tx" file in your mod folder.

v0.3.9

Latest
Game version
0.8.4 - 0.8.8b
Released
Nov 07, 2026
File size
17.7 KB
License
MIT
Save-game: Add · Remove
Changelog
* Fix missed repause on resume +/−: snapshot now tracks the value before a raise (or pause lower) in the inspector
* Re-enable AutoPause: pause when stock is between resume and pause (`arm in band`)
* Do not drop `pausedByMod` on the first tick when `SetPaused` is slow; grace + retry, else log a warning
Loading forum…

v0.3.9 | 2026-11-07

* Fix missed repause on resume +/−: snapshot now tracks the value before a raise (or pause lower) in the inspector
* Re-enable AutoPause: pause when stock is between resume and pause (`arm in band`)
* Do not drop `pausedByMod` on the first tick when `SetPaused` is slow; grace + retry, else log a warning

v0.3.8 | 2026-11-06

* Threshold edits during a rules pass (many buildings) queue a second immediate eval so resume raises are not missed
* Repause: treat live `ResumeAt` vs `ResumeAtSnapshot` when the pre-pass snapshot lagged behind the inspector

v0.3.7 | 2026-11-06

Since v0.2.0 (consolidated release notes)

Persistence
* Rules live in each **game save** (GlobalDependency blob), not a shared rules file
* One-time import from legacy **autopause_rules.txt** when a save has no stored rules yet; **save the game** after import
* **Updating the mod in-game does not delete `autopause_rules.txt`.** After you have saved once on v0.3.x, delete or rename that file in `Mods\AutoPause\` yourself so other saves are not affected (safe to leave only if you use a single migrated save)
* `pausedByMod` and rule fields persist with the save; prunes stale rules for destroyed or non-building entities

Rules and hysteresis (map-wide StoredQuantityTotal)
* **Buildings only** (static, pausable); vehicles and non-targets are dropped from the rule list
* **Vanilla pause** turns AutoPause **off** on that building (Enable saved off); turning Enable **on** clears vanilla pause so the mod owns the next decision; status line shows **paused by AutoPause** vs **paused (vanilla)**
* Threshold edits while running: raise/lower **Pause ≥** and **Resume ≤** with correct unpause, repause in the hysteresis band, and floor override so raised-resume repause does not flap
* Inspector changes apply on the **next eval tick** (not only on the interval)

Stability
* Fix save **load crash** when deserializing an uninitialized rules store
* **Sim loop:** subscribe `Update` only on **new** games; loaded games restore the hook from save (no duplicate `onSimUpdate`)

Inspector UI
* **Resume ≤** (lower) on the left, **Pause ≥** (higher) on the right
* Collapsible panel, copy/paste rules, product picker dedupe, live status refresh (`inspector_status_refresh_ms` in config)

Housekeeping (0.3.7)
* Readme/version alignment; internal cleanup; floor-unpause log shows the correct floor value

---

v0.2.0 | 2026-11-06 — initial public beta

* Per-building auto pause/unpause from **map-wide** stored amount for one product (hysteresis, copy/paste in the building inspector)
* Verified on COI **0.8.8b**; rules were stored in **autopause_rules.txt** (replaced by per-save rules in v0.3.x)
This mod depends on

This mod has no dependencies.

Mods that depend on this

No other mods depend on this mod yet.