Lazy Gun Turret Supply

by ogatass

Adds a chest that remotely supplies ammunition and repair packs to gun turrets. If the chest does not contain the required items, they are automatically supplied from the turret owner’s inventory instead.

Utilities
9 hours ago
2.0
0
Combat
Owner:
ogatass
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
9 hours ago
Latest Version:
1.0.0 (9 hours ago)
Factorio version:
2.0
Downloaded by:
0 users

Automatic Supply

Adds the Gun Turret Supply Box, which automatically supplies ammunition and repair packs to gun turrets.
If the boxes do not contain the required items, they are supplied from the main inventory of the player who built the turret.

Only vanilla gun turrets are supported.
Mod-added ammunition is also supported if it can be used by the gun turret.

Gun Turret Supply Box

Crafted using 1 iron chest, 1 radar, and 4 repair packs.
No research is required; the recipe is available from the start of the game.

Supplies ammunition and repair packs to registered gun turrets in the same force, regardless of distance.
By default, supply boxes can supply turrets across all surfaces, including planets and space platforms.

When multiple boxes are available, they are used in rotation.
Boxes can be built and stocked by anyone, and can supply turrets even while the turret owners are offline.

Ammunition replenishment and repair prioritize the boxes. When the required items are unavailable, the online turret owner's main inventory is used.
Other players' inventories are never used.

Ammunition Supply

One magazine is loaded only when the turret's ammunition inventory is empty.
Existing ammunition is never replaced or topped up.

Compatible ammunition available from the supply source is ranked by direct damage, and the highest-damage ammunition is loaded first.
Area damage and damage over time are excluded from this comparison.

Ammunition from supply boxes takes priority.
The owner's inventory is used only when no compatible ammunition is available in the boxes.
Even if the owner carries stronger ammunition, ammunition in the boxes is used first.

Turrets are normally checked every 6 ticks. Failed supply attempts are retried after 60 ticks.
Box search results are cached for 60 ticks per force and supply scope: all surfaces when cross-surface supply is enabled, or each surface when disabled.
Newly placed boxes may take up to approximately one second to be detected.
Box contents are checked when items are needed.

Repair

Damaged gun turrets are gradually repaired by consuming repair-pack durability.

Repair speed and repair-pack consumption are equivalent to one player repairing manually per turret.
Using multiple boxes or the owner's inventory does not increase the repair speed.

Manual repairs and construction robot repairs can operate alongside this mod's automatic repairs.

Consumption Display

Items consumed from the owner's inventory are shown to that player, along with the amount consumed and the remaining inventory count.
Repair packs are reported only when completely used up.
Items consumed from supply boxes are not included in personal inventory consumption notifications.

When available supplies run out, the online turret owner is notified with a warning and a sound effect.
Notifications and warnings appear as floating text, rather than in chat.

Cross-Surface Supply

By default, both supply boxes and the owner's inventory can supply turrets across surfaces.
If supplying a space platform from a planet's surface feels too powerful, this feature can be disabled.

Go to Settings → Mod settings → Map and toggle Allow cross-surface supply.

When disabled:

  • Supply boxes only supply gun turrets on their own surface.
  • The owner's inventory only supplies gun turrets on the same surface as the owner's character.

This setting applies to both ammunition replenishment and automatic repair.

For personal inventory supply, the check uses the character's physical location, rather than the surface being viewed remotely.
Supply boxes only supply turrets in the same force, whether cross-surface supply is enabled or disabled.

Debug Commands

  • /LGTS-Debug: Displays the owner and personal inventory information for the gun turret under the cursor.
  • /LGTS-ammo: Displays compatible gun turret ammunition ranked by direct damage.

Artwork and Testing

The supply box artwork is AI-generated.
Multiplayer functionality has not yet been tested.