Page 1 of 1

Looking for help on how to make changes to the file "constants.lua"

Posted: Sat Jan 04, 2025 4:30 pm
by Hoochie
Hi guys!
I'm looking for help with the following:
There is a mod that changes the rules of electric poles, and in the mod folder there is a file "constants.lua" that changes some connection rules:

Code: Select all

constants.EG_WIRE_CONNECTIONS = {
    ["small-electric-pole"] = {
        ["small-electric-pole"] = true,
        ["medium-electric-pole"] = true,
        ["small-iron-electric-pole"] = true
    },
    ["medium-electric-pole"] = {
        ["small-electric-pole"] = true,
        ["medium-electric-pole"] = true,
        ["small-iron-electric-pole"] = true
    },
}
The list is longer, I indicated it as an example.

Is it possible to make changes to this part of the code, via the file "data-final-fixes.lua" or "data-updates.lua"? I can't figure out how to do this.
What is this for?
When the mod is updated, all values ​​are also set to the original ones, but I change some rules for connecting electric poles for myself, and so that after updating the mod, every time I don't have to change this file manually ("constants.lua"), I would like to just throw the file "data-final-fixes.lua" or "data-updates.lua" into the folder with the mod, and continue playing :)

Re: Looking for help on how to make changes to the file "constants.lua"

Posted: Sat Jan 04, 2025 6:23 pm
by Natha
No, you can't access variables inside other mods