Currently there's no way to retrieve all logistic networks belonging to a force.
The existing API offers spatial queries like LuaSurface.find_logistic_networks_by_construction_area() and LuaSurface.find_logistic_network_by_position(), but nothing that maps forces to their networks directly.
Spatial queries become inefficient in scenarios like OARC where players from the same force can be spread across very large areas and multiple surfaces.
The only workaround is maintaining a custom cache by hooking into roboport build/destroy events and handling network merging/splitting manually.
Proposed addition:
A property like LuaForce.logistic_networks returning an array of LuaLogisticNetwork, or a surface-scoped method like LuaSurface.get_logistic_networks(force).
This would enable efficient force-level queries without requiring mod authors to implement custom caching infrastructure.
Expose logistic networks per force without spatial queries
Re: Expose logistic networks per force without spatial queries
Nevermind, I didn't do my research properly.
This already exists:
https://lua-api.factorio.com/latest/cla ... c_networks
Please close this request.
This already exists:
https://lua-api.factorio.com/latest/cla ... c_networks
Please close this request.
