Electric Grid

by 0n0w1c

An overhaul of the electric network, engineer an Electric Grid!

Overhaul
4 days ago
2.0
2.67K
Power

g (Resolved) Compatible with Engineersvsenvironmentalist redux

17 days ago

https://mods.factorio.com/mod/Engineersvsenvironmentalist-redux

(i think this is the mod causing it, I just tried enabling this mod + it and my usual QoL mods..)

https://imgur.com/a/VXuGLma

17 days ago

Thank you very much for the bug report. I resolved the reported load error, only to find a more serious issue.
I uploaded version 1.23.1 which flags the mod as incompatible.

17 days ago

i just made the mod compat with your mod

17 days ago

The mods will load now without error, however they are not yet compatible. At least with very limited testing in cheat mode, the transformator graphics are overwritten. Basic functionality seems to be working, however I am unable to use the circuit wires to test with circuit conditions.

17 days ago

I'll get to fixing that

17 days ago

The mods will load now without error, however they are not yet compatible. At least with very limited testing in cheat mode, the transformator graphics are overwritten. Basic functionality seems to be working, however I am unable to use the circuit wires to test with circuit conditions.

give it a try now please

17 days ago

Hi, I found a compatibility issue between Electric Grid and Engineers vs Environmentalist Redux.

When Electric Grid is enabled, EvE’s tiered poles do not stay copper-connected properly. The issue appears to be that Electric Grid’s runtime wire-handling only allows known pole-name families, and EvE’s extra pole tiers are not included, so those connections get disconnected again after placement.

Repro:

  • Enable Electric Grid + Engineers vs Environmentalist Redux
  • Place EvE tiered poles in a line or mix them with normal poles
  • Example symptom: 2 poles connect, but adding a 3rd can cause the earlier wire to disconnect

The EvE pole names that seem to need compatibility handling are:

  • medium-electric-pole-2
  • medium-electric-pole-3
  • medium-electric-pole-4
  • big-electric-pole-2
  • big-electric-pole-3
  • big-electric-pole-4
  • substation-2
  • substation-3
  • substation-4

Would you be able to add these as valid Electric Grid pole families, using the same behavior/rules as their base families?

Suggested mapping:

  • medium-electric-pole-2/3/4 -> same as medium-electric-pole
  • big-electric-pole-2/3/4 -> same as big-electric-pole
  • substation-2/3/4 -> same as substation

I’m not asking for any gameplay rebalance, just compatibility so Electric Grid does not strip their normal copper-wire connections.

Thanks.

17 days ago

Thank you for your efforts toward compatibility.
The graphics issue seems to be resolved, however I am still not able to use the red and green circuit wires.

I will begin working on compatibility for the tiered poles.

16 days ago
(updated 16 days ago)

Thank you for your efforts toward compatibility.
The graphics issue seems to be resolved, however I am still not able to use the red and green circuit wires.

I will begin working on compatibility for the tiered poles.

dw i fixed it so the shortcuts work again, it was still been used ingame

16 days ago

Thank you for your efforts toward compatibility.
The graphics issue seems to be resolved, however I am still not able to use the red and green circuit wires.

I will begin working on compatibility for the tiered poles.

dw i fixed it so the shortcuts work again, it was still been used ingame, i'll upload the fix shortly

16 days ago

I have made the required changes for compatibility.

The connection points for the small-iron-electric-pole get changed. EG now reverts that in final-data-fixes. Not sure why that would be changed.

EvE modifies the copper wire connections, however this is against EG's intended behavior. While they are now technically compatible, the intended behavior for wire connections is not, they are opposites. EvE encourages connections, EG works to limit connections.

16 days ago

Hmm, with the new version there are a few more issues. Maybe we should not try to make them compatible.

16 days ago
(updated 16 days ago)

I reset the following in data-final-fixes.lua:

if mods["Engineersvsenvironmentalist-redux"] then
    local poles = data.raw["electric-pole"]

    -- restore the connection points
    poles["small-iron-electric-pole"].connection_points = table.deepcopy(poles["small-electric-pole"].connection_points)

    -- load error due to assigning next_upgrade to big-electric-pole-mk2
    poles["eg-huge-electric-pole"].next_upgrade = nil

    -- revert modifications to transformator poles
    for direction, _ in pairs(constants.EG_DIRECTION_TO_CARDINAL) do
        for _, pole_type in ipairs({ "high", "low" }) do
            local pole_name = "eg-" .. pole_type .. "-voltage-pole-" .. direction
            local pole = poles[pole_name]
            if pole then
                pole.next_upgrade                      = nil
                pole.rewire_neighbours_when_destroying = false
                pole.auto_connect_up_to_n_wires        = 0
                pole.draw_copper_wires                 = true
            end
        end
    end

    -- mods are not compatible in wiring behavior
    -- auto_connect_up_to_n_wires = 255,
    -- rewire_neighbours_when_destroying = true

    -- reset desired behavior
    for _, pole in pairs(poles) do
        if not (string.sub(pole.name, 1, 8) == "eg-high-" or string.sub(pole.name, 1, 7) == "eg-low-") then
            pole.rewire_neighbours_when_destroying = false
            pole.auto_connect_up_to_n_wires = nil
        end
    end
end
16 days ago

Hmm, with the new version there are a few more issues. Maybe we should not try to make them compatible.

let me know if your going to leave these as incompatible or anything i can do on my end

16 days ago

Version 1.24.0 has been uploaded, adding support for Engineers vs Environmentalist Redux.

15 days ago

let me know if your going to leave these as incompatible or anything i can do on my end

It would be nice, to not need to make the above changes. They are changes to repair what EvE is modifying and I am not sure why the changes are made. The last for loop, may be unavoidable. Changes to poles provided by EG, like the internal poles of the transformator, could be excluded?

15 days ago

Thanks for pushing that update and for laying out exactly what was conflicting!

You're completely right—my mod was doing a blanket loop over all electric-pole prototypes to apply EvE's wiring behavior and upgrade paths, which was accidentally catching your hidden transformator poles and the eg-huge-electric-pole. I completely understand why that breaks Electric Grid's intended mechanics.

I've just updated my code to explicitly filter out and ignore any poles starting with "eg-", as well as skipping the small-iron-electric-pole.

Once I push this next EvE update, you should be completely safe to remove that data-final-fixes.lua cleanup block on your end. Thanks again for working with me on this!

15 days ago

Thanks for pushing that update and for laying out exactly what was conflicting!

You're completely right—my mod was doing a blanket loop over all electric-pole prototypes to apply EvE's wiring behavior and upgrade paths, which was accidentally catching your hidden transformator poles and the eg-huge-electric-pole. I completely understand why that breaks Electric Grid's intended mechanics.

I've just updated my code to explicitly filter out and ignore any poles starting with "eg-", as well as skipping the small-iron-electric-pole.

Once I push this next EvE update, you should be completely safe to remove that data-final-fixes.lua cleanup block on your end. Thanks again for working with me on this!

should be fixed in 3.0.11

15 days ago

The issues remain with 3.0.11:

Failed to load mods: Error while running setup for entity prototype "eg-huge-electric-pole" (electric-pole): next_upgrade target (big-electric-pole-2) must have the same fast_replaceable_group (big-electric-pole != eg-huge-electric-pole).
Failed to load mods: Error while running setup for entity prototype "eg-high-voltage-pole-0" (electric-pole): next_upgrade can't be set when flag 'not-upgradable' is set.
15 days ago

The issues remain with 3.0.11:
Failed to load mods: Error while running setup for entity prototype "eg-huge-electric-pole" (electric-pole): next_upgrade target (big-electric-pole-2) must have the same fast_replaceable_group (big-electric-pole != eg-huge-electric-pole). Failed to load mods: Error while running setup for entity prototype "eg-high-voltage-pole-0" (electric-pole): next_upgrade can't be set when flag 'not-upgradable' is set.

very wierd it loads for me fine

15 days ago

That is because you are using my published version, which has the fixes in data-final-fixes.lua included.
Unzip my mod and rename the data-final-fixes.lua file and start the game again.

15 days ago

That is because you are using my published version, which has the fixes in data-final-fixes.lua included.
Unzip my mod and rename the data-final-fixes.lua file and start the game again.

ah, let me fix this on my end

15 days ago

That is because you are using my published version, which has the fixes in data-final-fixes.lua included.
Unzip my mod and rename the data-final-fixes.lua file and start the game again.

try now with 3.0.13

15 days ago
    for _, pole in pairs(poles) do
        if not (string.sub(pole.name, 1, 8) == "eg-high-" or string.sub(pole.name, 1, 7) == "eg-low-") then
            pole.rewire_neighbours_when_destroying = false
            pole.auto_connect_up_to_n_wires = nil
        end
    end

If EvE needs to modify all of the electric poles, this fix-up may be unavoidable. But I think the others should be resolvable without a fix-up.

New response