This mod disables the built-in alerts that show when entities get destroyed, get damaged, or shoot at enemies. The mod then adds two new custom alerts that look like the vanilla destroyed/damaged alerts, but will only be shown if the destroyed/damaged structure is visible to the structure's owner.
The mod has been briefly tested in single-player. Multiplayer has not been tested, but it probably works. Use the discussion tab to report issues.
Non-combat alerts are unaffected. Alerts like logistics networks running out of bots, or trains running out of fuel, will still show up even outside vision range. Note you can disable those alerts completely using the /alerts
command or the Alert Toggler mod.
Mod compatibility: Mods that add items like radars or enemies will work fine. But mods that add custom alerts (such as Ammo Alerts) will not respect the visibility restriction - they will still give alerts for entities in non-visible chunks. Also, Alert Center will not track this mod's alerts.
Adding/removing the mod in an existing game: When adding the mod to an existing game it might look like it doesn't work at first, until existing alerts time out and get disabled. If you remove the mod from an existing game, the built-in alerts will still be disabled, so you will need to re-enable them using the Alert Toggler mod, or by using the /alerts command in the console with the commands: /alerts enable entity_destroyed
and /alerts enable entity_under_attack
and /alerts enable turret_fire
Limitations and things to add
You are welcome to send me a pull request, or to fix these issues and upload it as your own mod.
- Currently this mod doesn't aggregate alerts. For example where vanilla would say "6 buildings being damaged" this mod will instead have a list of 6 separate alerts like "Wall 1 being damaged". This could be fixed by doing some combination of get_alerts and removing/re-adding alerts. Since we can only have 1 location per alert, we should maybe only combine alerts like this if they are very close to each other.
- Currently the alerts are short-lived. The add_custom_alert API does not give any way to specify how long alerts should show up, and it seems Wube is not planning to add this, eg see here. Aggregating the alerts by deleting and re-creating alerts (see previous bullet point) would partly fix this situation. You could implement some timeout to repeat each alert when it times out the first time, to make it show up longer. A more complete fix might be to implement a custom GUI to show dead alerts, like the Alert Center mod which currently doesn't show custom alert types.