A way to get all the missing construction materials mentioned in alerts for a surface

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 232
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

A way to get all the missing construction materials mentioned in alerts for a surface

Post by Quezler »

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:
Screenshot 2025-02-07 at 11.34.49.png
Screenshot 2025-02-07 at 11.34.49.png (68.74 KiB) Viewed 172 times
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:
Screenshot 2025-02-07 at 11.38.31.png
Screenshot 2025-02-07 at 11.38.31.png (1.66 MiB) Viewed 172 times
Screenshot 2025-02-07 at 11.40.28.png
Screenshot 2025-02-07 at 11.40.28.png (169.33 KiB) Viewed 172 times
(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)
Post Reply

Return to “Modding interface requests”