Hero Turret Restock


Shortcut button that puts ranked hero turrets sitting in logistic storage back on the wall: the lowest-ranked placed turrets are marked for upgrade to the highest ranks in stock, and construction robots do the swap. Needs HeroTurretRedux or HeroTurretsReduxFork with the kill counter set to Fuzzy (the default).

Utilities
3 days ago
2.1
10
Owner:
Capta1n_n9m0
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
3 days ago
Latest Version:
1.0.1 (3 days ago)
Factorio version:
2.1
Downloaded by:
10 users

An add-on for HeroTurretRedux or HeroTurretsReduxFork.

When you extend a wall, ranked hero turrets get picked up and plain ones go down, so ranked turrets pile up in your logistic chests. This mod adds a shortcut-bar button that puts that stock back on the wall:

  • Per logistic network (found by construction area, since walls are usually outside the logistic area), per base turret and per quality, it pairs the highest ranks in storage with the lowest-ranked placed turrets.
  • Every pair where the stored turret outranks the placed one is marked for upgrade. Construction robots do the swap, and the replaced turret goes back to storage as an item.
  • Nothing is destroyed or created by script. Pressing the button twice is harmless: turrets already marked reserve their item.
  • Pairing the best stock with the worst placed turrets means a replaced turret never outranks what is left in stock. The wall ends up with the best turrets and the stock ends up as plain turrets, as far as the numbers allow.

A chat summary shows how many turrets of each type were marked, and how many ranked turrets stay in stock because no lower-ranked placed turret exists in that network.

Requirement: the hero turret mod's Kill counter setting must be Fuzzy (the default). With Exact, mined turrets become items with tags, which robots won't use for upgrades.

There is also a remote interface: remote.call("hero-turret-restock", "restock", "player").