Is there a way to find separate electric networks on a map? Base game or a mod would both be fine. I ask because during a recent survey of my biggest base, I found that there were a few hundred solar panels not connected to the rest of the network. It's possible there are other clusters of panels or accumulators that aren't attached yet.
Thanks!
Finding separate electric networks
-
- Fast Inserter
- Posts: 187
- Joined: Fri Jan 05, 2018 5:18 pm
- Contact:
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Finding separate electric networks
On the "maxi"-map you can enable showing connected power poles via the buttons on the right. Using the debug overlay (F4/F5/F6/F7) you can also enable "show-network-connected-entities" which will display the network number on every pole. If two poles have different numbers they're not on the same network. Though if two networks are connected via power switch they'll have different numbers.
I'm not aware of any mod that automatically shows this. Detecting it should be possible, but i'm not sure how a mod should communicate its findings to the user. Maybe map tags at the center of each network? That might work.
Edit: After some rummaging through the api i see no method to determine if two power poles are on the same network :/. Using .neighbour and a cache of all poles would work, i guess...
I'm not aware of any mod that automatically shows this. Detecting it should be possible, but i'm not sure how a mod should communicate its findings to the user. Maybe map tags at the center of each network? That might work.
Edit: After some rummaging through the api i see no method to determine if two power poles are on the same network :/. Using .neighbour and a cache of all poles would work, i guess...
Last edited by eradicator on Mon Oct 22, 2018 7:55 pm, edited 3 times in total.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 187
- Joined: Fri Jan 05, 2018 5:18 pm
- Contact:
Re: Finding separate electric networks
The debug overlay sounds like a good place to start, thanks!
Now I find myself wondering if such a mod could also find accumulators, panels, or other entities which are not connected to any network at all. I know about the blinking electric symbol when first installed, but I've been installing power by laying down bot blueprints and then forgetting about them, so if cliffs or water disrupted the blueprint there may be more unattached items.
Now I find myself wondering if such a mod could also find accumulators, panels, or other entities which are not connected to any network at all. I know about the blinking electric symbol when first installed, but I've been installing power by laying down bot blueprints and then forgetting about them, so if cliffs or water disrupted the blueprint there may be more unattached items.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Finding separate electric networks
See also the edit above. If networks are seperated by switches they won't have the same number. Just something to keep in mind.AngledLuffa wrote: Mon Oct 22, 2018 7:34 pm The debug overlay sounds like a good place to start, thanks!
Also finding unpowered entities is much easier:
Code: Select all
/c
for _,this in pairs(game.player.surface.find_entities_filtered{force=game.player.force}) do
if (not this.is_connected_to_electric_network()) and this.electric_buffer_size then
game.player.force.add_chart_tag(this.surface,{icon={type='virtual',name='signal-red'},position=this.position,orientation=0.2})
end
end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Finding separate electric networks
can we find all chart tags with icon {type='virtual',name='signal-red'}?eradicator wrote: Mon Oct 22, 2018 7:52 pm This will add a red square map icon on every unconnected entity. Be careful to not save the game after using this, or you will have to manually remove all the icons, which could be quite exhausting. Also if your map is very large the command might take a few seconds to run.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Finding separate electric networks
Theoretically? Sure. You can write that if you want.darkfrei wrote: Mon Oct 22, 2018 8:25 pmcan we find all chart tags with icon {type='virtual',name='signal-red'}?eradicator wrote: Mon Oct 22, 2018 7:52 pm This will add a red square map icon on every unconnected entity. Be careful to not save the game after using this, or you will have to manually remove all the icons, which could be quite exhausting. Also if your map is very large the command might take a few seconds to run.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Fast Inserter
- Posts: 187
- Joined: Fri Jan 05, 2018 5:18 pm
- Contact:
Re: Finding separate electric networks
Thanks, the suggestion on how to find disconnected items was perfect. Fixed a few more solar panels whose block was placed slightly over water and didn't have a power pole.