A way to get all the missing construction materials mentioned in alerts for a surface
Posted: Fri Feb 07, 2025 10:40 am
Currently there is no support for getting the missing construction materials for a roboport network due to how the construction queue functions, periodically checking a player's alert queue is the next best thing.
However, what these 2 mods run into is that non-custom alerts only point to entities and never an item(count):
https://mods.factorio.com/mod/se-inters ... ulfillment
https://mods.factorio.com/mod/fulgora-l ... uction-hub
In order to get a feel for what a surface is missing one would need to grab all the missing construction materials through several api calls per entity: Furthermore you cannot really track how much is still missing very well based on that alerts are tied to entities, having a `player.get_missing_construction_materials_from_alerts()` would be quite neat since that would be just one api call to get what the player already sees in their gui.
This is what i would imagine it could look like, with optionally a surface argument/table to only check for that surface, it would take care of construction, upgrading & cliffs all in one: (devs: i have some prototype code for this, it wasn't perfect enough to submit yet but do reach out if you wish to study it or use it as a starting point for this)
However, what these 2 mods run into is that non-custom alerts only point to entities and never an item(count):
https://mods.factorio.com/mod/se-inters ... ulfillment
https://mods.factorio.com/mod/fulgora-l ... uction-hub
In order to get a feel for what a surface is missing one would need to grab all the missing construction materials through several api calls per entity: Furthermore you cannot really track how much is still missing very well based on that alerts are tied to entities, having a `player.get_missing_construction_materials_from_alerts()` would be quite neat since that would be just one api call to get what the player already sees in their gui.
This is what i would imagine it could look like, with optionally a surface argument/table to only check for that surface, it would take care of construction, upgrading & cliffs all in one: (devs: i have some prototype code for this, it wasn't perfect enough to submit yet but do reach out if you wish to study it or use it as a starting point for this)