Electric Grid Enforcer

by _-_-_

Enforces 90° angles for auto-connections when electric poles are placed.

Utilities
1 year, 11 months ago
1.1
2.92K

i [Added] Disable button

2 years ago

Would be possible to have a disable button on the tool bar for it?
Why? to ensure compatibility with other things, for instance the power rails from Bio_Industries, that are impossible to connect to the grid

2 years ago

That's a good idea. Next time I make changes, I'll add that.

2 years ago

I've added this, probably along with new bugs. It toggles per-force, so if one player on the force toggles it, it applies to the whole force. Please let me know if you run into any issues.

2 years ago

Oh, thanks man I'll definitely try it

2 years ago

It does the work when disabled, at least fixed the problem with powered rails from bio industries, but seems you can't really enable it again, for medium power poles they still connect with diagonal or other shapes.

when it is working, it does not connect to big electric poles for some reason, sure big electric ones have 4 tiles base and the medium only have 1, but it does not work with any possible position. For the map view, they should connect with the base tile if both are in the same line, something like

X = space
E = medium
B = big electric pole

XXXXXX
XXXXBB
EXXXBB
XXXXXX

something like this should connect.

2 years ago
(updated 2 years ago)

It does the work when disabled

This is on the latest version? There were some issues in MP with 0.0.5

when it is working, it does not connect to big electric poles for some reason, sure big electric ones have 4 tiles base and the medium only have 1, but it does not work with any possible position. For the map view, they should connect with the base tile if both are in the same line

I'll look into this - I had just been making connections when they share an x or y position but this would be different with differing sizes. I'll see what can be done, it annoys me too.

2 years ago

I'm on single player but seems like the sync fix on 006 solve the problem on single player as well, at least I was not able to make it stop working.

Would be awesome if we get the bigger pole to connect to the medium one, you can always manually connect but still annoying

2 years ago
(updated 2 years ago)

The root cause of the sync issue may have also been causing issues in SP, then. Good to know, either way. I'm looking at what it takes to modify the search to account for pole sizes but there's some annoying cases like having substations one tile offset - they technically overlap but shouldn't (imo) connect.

Image illustrating the example: https://pasteimg.com/images/2022/04/17/imagec73edea73326ebbb.png

2 years ago

Hmm, not sure how it would be in code but, lets say, if they have the same size 1x1, 2x2, 3x3 or whatever, just follow the current code, as they will work perfectly, those substation won't connect.

The thing would be how to make X to Y as they will never have a perfect place to be. I think the general case would be check if the smaller one is inside the bigger one in rows or columns

============PPP==================
=====PP=====PPP==================
=P===PP=====PPP==================
=================================
=====P========P==================

Some people don't like to much config and buttons but, A second one that enable/disable different size poles to connect might make things easier.
Won't be perfectly

2 years ago

I have added a tolerance that should handle these situations. Please let me know if you see any weirdness.

2 years ago

I think it is very good now, seems very consistent. It does not make a bunch of weird connections when you have some poles to close, which is good.
It connect nicely with medium/big power poles.

New response