Full Power Coverage

by Morhe

Makes the supply area for small and medium electric poles match their wire reach. Slightly reduces connection range to force connection ranges to even numbers of tiles, then raises power coverage range to match. Automatically compatible with most mods that add their own power poles.

Tweaks
21 days ago
0.15 - 2.0
4.35K
Power

b Factorissimo2

7 years ago

mod prevents power delivery to factory buildings from Factorissimo2.
Tested with only creative mode mod (to generate new world and quickly give myself needed items), this mod, and factorissimo2. other mods that alter pole coverage such as config+ mod or other mods that add electric poles do not seem to have any issue transfering power into factories, but if this mod is installed, no power poles used can transfer power into them.

7 years ago

believe this is due, in part because the factories likely have a built-in power pole to supply power to everything inside. somehow, the code from this mod seems to make it not work.

6 years ago

Per the Factorrisimo 2 dev, you can fix the issue by modifying line 4 of this mod's data.lua file to this: v.supply_area_distance = math.max(v.supply_area_distance, math.floor( v.maximum_wire_distance / 2 ) + 0.5)

6 years ago

Thanks for this!

4 years ago
(updated 4 years ago)

I was wondering if this fix still needs to be applied for 0.17? I understand the variable names have changed (e.g v=value, max=maximum) so those variables would need to remain constant with the rest of the file.
Edit Also was wondering the point of the following equation:
math.floor( value.maximum_wire_distance / 2 ) * 2 + 1.5 -- why do you divide the distance by 2 and then multiply it by 2 in the same equation?
Couldn't you just achieve this with: math.floor( value.maximum_wire_distance ) + 1.5

4 years ago

I got it working for me by changing lines 3 and 4 to these:

value.maximum_wire_distance = math.floor( value.maximum_wire_distance / 2 ) * 3.25
value.supply_area_distance = math.max(value.supply_area_distance, math.floor( value.maximum_wire_distance / 2 ) + 0.5)

I tweaked the numbers so that if I make a square with the poles, the small factory fits inside the small poles, medium factory in the medium ones, and the substation is unchanged and still the right size for the large factory.

I never tried to fix anything before, so I hope it does work for others :)

3 years ago

I just rammed into this issue myself - it seems this mod changed Factorissimo2's factory power monitor's supply area to 1x1, which grants the extra annoyance of having to use poles inside of the factory.

3 years ago

Hmm... I don't run Factorissimo2myself so I've never really officially supported it. I could take a look at it, though. It sounds like Factorissimo2 just doesn't have wire distances on its power supplies since the interior theoretically shouldn't need them; this mod essentially rounds the supply area to match transfer distance.

If that's the case then adjusting the function to "round up" instead of "just round" should fix it, which would explain Nastro's method... I'll look into it.

3 years ago

Ok, I changed the candidate selection to be bounded based on the difference between each entity's connection and coverage ranges. It now respects Factorissimo2 Factories' right to have no connection range on their power supplies, and a nice side effect is that it should also be much better at detecting the difference between supply-style power poles and long-distance-transfer style poles even from mods with unusually large power supply entities like Factorissimo2.

3 years ago

Awesome, cheers for the speedy update.

New response