Entity filter for player.disable_alert()?
Posted: Sun Oct 27, 2024 5:59 am
Hi,
The only filter option currently provided for 'player.disable_alert()' is to filter by alert type. Would it be possible for this method to instead support the same filtering options that 'player.remove_alert()' has?
I'm particularly interested in disabling alerts by entity, it would fix a lot of problems for the mod I'm working on if I could disable 'no_material_for_construction' alerts for certain entities and not for others. It does sort of work to call `remove_alert()` instead, but the effect only lasts for a tick before the game updates and adds it back, and I don't think it would be practical to "fight" the game by constantly removing the alerts every tick as they get re-added. If I instead call `disable_alert()` the alerts do disappear for good, but of course that option is all or nothing, so it doesn't really work for me.
A prototype-based solution would also work for me, if that makes a difference (I'm picturing something like an 'EntityPrototype.disabled_alerts' property here)
Totally understand if the architecture doesn't allow for it, but I'm crossing my fingers for an easy solution here!
Thanks,
ceresward
The only filter option currently provided for 'player.disable_alert()' is to filter by alert type. Would it be possible for this method to instead support the same filtering options that 'player.remove_alert()' has?
I'm particularly interested in disabling alerts by entity, it would fix a lot of problems for the mod I'm working on if I could disable 'no_material_for_construction' alerts for certain entities and not for others. It does sort of work to call `remove_alert()` instead, but the effect only lasts for a tick before the game updates and adds it back, and I don't think it would be practical to "fight" the game by constantly removing the alerts every tick as they get re-added. If I instead call `disable_alert()` the alerts do disappear for good, but of course that option is all or nothing, so it doesn't really work for me.
A prototype-based solution would also work for me, if that makes a difference (I'm picturing something like an 'EntityPrototype.disabled_alerts' property here)
Totally understand if the architecture doesn't allow for it, but I'm crossing my fingers for an easy solution here!
Thanks,
ceresward