Update LuaForce/LuaSurface with electric network stats

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
LordXaosa
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Jun 05, 2014 6:25 pm
Contact:

Update LuaForce/LuaSurface with electric network stats

Post by LordXaosa »

Hi!
I'm trying to fork graftorio2 mod for my needs and I stucked with bad approach to count electricity stats.
For now it's only possible to get such info from electric-pole type entities, so I need to scan all surfaces (hello Space Exploration!) for each electric pole to get all networks and then count this stats in loop.

As you can see scanning all surfaces for special type of entity is slow operation.
So my suggestions are:

update LuaForce and add here something like this
electric_networks_statistics :: dictionary int → array of LuaFlowStatistics where id1=surface_id and id2=network_id

or

update LuaSurface in same way, but there need to provide force info

so we could access all networks of force and get all needed information fast.

Post Reply

Return to “Modding interface requests”