Re: Expansion base built alert from https://factorio.com/blog/post/fff-445
it would be nice if expansion base built alert also raise an event.
My use case is that when this event triggers, unit control sends a group of army to kill them.
I could do it by tracking build groups position and on_sector_scanned. But the performance overheads made me don't want to do it, because majority of the scans are invalid. This becomes a lot worse when other mods speed up the radar scan speed.
Raise an event for expansion base built alert.
Re: Raise an event for expansion base built alert.
There's an alert API. Why don't you just read the alerts?
Re: Raise an event for expansion base built alert.
with luaplayer.get_alerts()? The mod needs check it every few seconds on all players for the alert that "a radar's 'far scan' might catch them at the right time if you're lucky".
Na. it's waste of compute cycles. Majority of the checks will be invalid.
Na. it's waste of compute cycles. Majority of the checks will be invalid.
Re: Raise an event for expansion base built alert.
This alert is tightly coupled to `on_biter_base_built` event as the alert is added by the build base behavior right before raising this event. Alerts are added to all forces that spawner's force is not friendly with (LuaForce::is_enemy) and target force having vision on the chunk (LuaForce::is_chunk_visible). I am not convinced about adding this event as it would be virtually a duplicate of `on_biter_base_built` with extra conditions added that are custom for your use case.
Re: Raise an event for expansion base built alert.
Thanks boskid. That makes sense. At least this one checks only when they build. The other solutions need to run constantly.


