The Spice Rack - Turret Inspector


The Spice Rack is intended to spice up the vanilla game by changing some well chosen details. Most changes can be disabled individually. Shows warnings for gun turrets, if ammo is low, almost empty and empty. CAUTION: Not tested in multiplayer! Interested in feedback

Utilities
2 years ago
1.1
108
Owner:
Jodokus31
Source:
https://github.com/jodokus31/factorio
Homepage:
https://forums.factorio.com/viewtopic...
License:
MIT
Created:
2 years ago
Latest Version:
0.0.1 (2 years ago)
Factorio version:
1.1
Downloaded by:
108 users

The Spice Rack

The Spice Rack is intended to spice up the vanilla game by changing some well chosen details. Most changes can be disabled individually.

The Spice Rack - Turret Inspector

The ammo levels of gun turrets are getting inspected:

  • If ammo is low a grey warning is shown on map.
  • If ammo is almost empty a yellow warning is shown on map.
  • If ammo is empty a red warning is shown on map.

Warnings for newly placed turrets are delayed by 20 seconds.
Warnings for turrets never appear, if they contain exactly the automatic ammo count loaded by an inserter (10 for regular turret)

Commands

There are some command line commands:

  • /spice_rack_active_turrets - displays a technical overview over turret data
  • /spice_rack_rebuild_turrets - rebuild turrets lists

Options:

  • Show turrets warnings - If disabled, no warnings are shown at all for current player
  • Low ammo indicator - If ammo is below this, the turret is marked grey
  • Almost empty indicator - If ammo is below this, the turret is marked yellow

Technical background

The mod keeps track over all placed turrets and investigates the inventory.

To ensure performance, the turrets are handled not all at once, but they are distributed over a timespan of ~10 sec. When a turret is added, it is assigned to an alternating slot. One slot is handled each interval of 26 ticks. The amount of slots is the prime value: 23. 26*23 ticks -> 598 ticks ~10 sec.