Electric Grid

by 0n0w1c

An overhaul of the electric network, engineer an Electric Grid! The overhaul is optional.

Overhaul
a day ago
2.0
2.00K
Power

g (Resolved) A huge pole has disappeared

9 months ago

I didn't quite understand, but the latest changes removed the huge pillar from the game, for some reason it just disappeared.

9 months ago

Yeah, that's right, if you don't have the "No More Quality or No Quality" mods installed, the huge pillar disappears.
It seems to me that this is not entirely correct, since in this case the user will have to choose whether to play with this addon or with quality.

9 months ago
(updated 9 months ago)

The new behavior is correct. Quality adds a supply area to every pole. The supply area turns transmission only poles into distribution poles. Quality defeats the wiring rules and pole changes of the overhaul. If people want to play with Quality active, they can still use this mod but only the Transformator will added to the game. The overhaul is meant to change how power is distributed, to play differently.

9 months ago
(updated 9 months ago)

If the Devs change how the Quality bonus is applied to power poles or give the 2.0 API the ability to make transmission only poles, I will happily update the mod.

To explain too much, but maybe you would like to know the details:
Most Quality bonuses are applied by multiplying (ex. 30% bonus), however for electric poles, the bonus is added (ex. +4). So when this mod changes the base pole to 0 supply area, instead of it remaining 0 (0 x .3), it is set to 4 (0 + 4). As far as I know, this can not be changed. Without transmission only poles, the wiring rules make no sense. Will the Devs change this in the future? Maybe, but I doubt it.

9 months ago

Unfortunately, I don't have the basic knowledge of writing LUA to try testing different options...
For example, if the base uses addition (0 + 3 = 3) instead of multiplication (0 x 3 = 0), is it possible to specify in this mod for the pole that if a quality that adds +4 is used, then 4 should be added, but with a minus sign (-), then the result will be a negative value (0 + -4 = -4) (if the base allows negative values ​​in principle, otherwise it will be 0).
And since the pole does not use the power supply area, a negative value will not hurt.

P.S. Is it possible to test this way?

9 months ago

I had not thought to try negative numbers, oddly they are indeed acceptable. However, it does not work like we had hoped. Assigning -4 to the big pole, a pole with a -8 x -8 supply area is produced. But even if it did work as desired, it would only work for one quality level. In the base game, every entity has a prototype defined and the API allows many things to be changed, like the wire and supply area of an electric pole. However, Quality is coded differently, it is mathematically applied to the base prototype at runtime. There is no specific prototype to change, I am unable to set the max wire length or supply area of any pole other than normal, all of the higher quality poles are generated.

I did make a request for the devs to restore the ability to make transmission only poles. But don't expect anything to come from it. Transmission only poles are not a part of the game and electric network mods are not very popular.

9 months ago

Eh, it's a pity it didn't work out, but thanks for trying :)

9 months ago
(updated 9 months ago)

In this forum thread, Rseding91 replied:
"Quality was specifically not implemented as a bunch of prototype copies because that approach is messy and error prone for the rest of the game logic."

Quality greatly effects modding, but Quality is extremely popular as evidenced by the very low number of downloads of the mods that remove it.

9 months ago

I agree, quality is not a fundamental factor of the game, but it is still quite significant, and I would not like to choose between one and the other. Well, maybe some other thoughts will arise, I will definitely write :)

9 months ago

I have good news, my bug report was resolved, quality poles will be able to have no supply area.

9 months ago

Great news!
Because in every update I remove the lines of code that disable this feature :)

9 months ago

Boss, I need a little help...
Please tell me how to write the code in the file "data-final-fixes.lua", to make changes to this code:

constants.EG_WIRE_CONNECTIONS = {
["small-electric-pole"] = {
["small-electric-pole"] = true,
["medium-electric-pole"] = true,
["small-iron-electric-pole"] = true
},
...

9 months ago
(updated 9 months ago)

Sure, what do you wish to do?
I need to know more about what you want to change.

For an example, to allow another connection between small-electric-pole and big-electric pole:

    ["small-electric-pole"] = {
        ["small-electric-pole"] = true,
        ["medium-electric-pole"] = true,
        ["small-iron-electric-pole"] = true,
        ["big-electric-pole"] = true
    },

and then you must also add:

    ["big-electric-pole"] = {
        ["big-electric-pole"] = true,
        ["substation"] = true,
        ["eg-ugp-substation"] = true,
        ["eg-circuit-pole"] = true,
        ["small-electric-pole"] = true
    },

You must add to both poles, so the wire connection can be made starting with either pole.

9 months ago

I have other mods that add power plants, and I also have a mod that adds electric rails, and since the connection rules are explicitly stated here, they don't work correctly without changing the code.
For example, for electric rails, I change the code to the following:
constants.EG_WIRE_CONNECTIONS = {
["small-electric-pole"] = {
["james-rail-pole"] = true,
["james-track-pole"] = true,
["james-rail-signal"] = true,
["small-electric-pole"] = true,
["medium-electric-pole"] = true,
["small-iron-electric-pole"] = true

9 months ago
(updated 9 months ago)

I know how to add a rule, but I couldn't figure out how to specify it for the "data-final-fixes.lua" file.
That is, how to write code for this file so that it changes these rules in the original "constants.lua" file.

In more detail, I want to create a file "data-final-fixes.lua" that will indicate how to change the rules "constants.EG_WIRE_CONNECTIONS", and after each update of the mod, I will simply throw this file into the mod folder :)
Right now I have to open "constants.lua" and replace the lines of code.

9 months ago

Oh, you are modding my mod and you wish to add more allowed copper wire connections, to add poles from other mods?

9 months ago
(updated 9 months ago)

Oh, you are modding my mod and you wish to add more allowed copper wire connections, to add poles from other mods?

Yes, that's right, I just add permissions for other mods there, or when I install some new mod related to electric poles, I have to manually add these rules, just to test another mod.

For example, like this "floating-electric-pole", I had to ask you about it, so that you make changes on a permanent basis, but it takes time, and to try another mod, I can make these changes locally, on my own, but how to do it with the file ""data-final-fixes.lua""

9 months ago
(updated 9 months ago)

Ah, I do not think that is possible. I think you will need to modify this mod's code. With your mod, you can change the properties of entities/items/recipes of this mod, but there no access to the code of this mod like the constants.lua file. You can access it, as in "require" it to run with your code, but I do not know of a way to change it.

9 months ago

Ah, I do not think that is possible. I think you will need to modify this mod's code. With your mod, you can change the properties of entities/items/recipes of this mod, but there no access to the code of this mod like the constants.lua file. You can access it, as in "require" it to run with your code, but I do not know of a way to change it.

Do I understand correctly that it is not possible to make changes to the file "constants.lua" via the file "data-final-fixes.lua"?

9 months ago

No, it is not possible... at least not that I know of. You might ask on the Factorio Discord in the dev channels.

Are you looking to add support for James Fire's electric trains mod?

9 months ago

Eh... too bad. Yeah, I'll look for more info somewhere.
Yeah, but not just this mod with trains, I have 2 more mods with power plants. And there was one for electricity, but I deleted it, I didn't like it.
Thanks for the answers.

9 months ago

Power plants? Unless you connect a copper wire, non-vanilla power sources should work.

I am looking at Jame Fire's mod now... I am thinking to add support for it. At first glance, it appears adding the james-rail-pole is all that is required.

9 months ago
(updated 9 months ago)

Power plants?

Yes, other power plants:
["big-electric-pole"] = {
["big-electric-pole"] = true,
["substation"] = true,
["eg-ugp-substation"] = true,
["eg-circuit-pole"] = true,
["substation-2"] = true,
["substation-3"] = true

9 months ago
(updated 9 months ago)

While I can not make all of the changes you want to make, I did add support for James' Electric Trains Plus, version 1.7.2 has been uploaded.

9 months ago

Oh, thanks for that :)

Offtopic - how do I highlight the code here? Above in the messages you highlight it as code, but I just highlight it line by line

9 months ago

Hmm, not sure the name, 3 consecutive ` to start followed by 3 more to end it. I think it is maybe called the accent mark?
On my keyboard, shift plus the key makes the tilde ~

9 months ago

Factorio 2.0.29 (Experimental) is now available, the overhaul is now compatible with Quality.

New response