Electric pole wire connections

Place to get help with not working mods / modding interface.
Silophant
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Jan 26, 2017 5:11 am
Contact:

Electric pole wire connections

Post by Silophant »

I'd like to write a little mod that makes the power system work a little more realistically, without making it too tedious. Specifically, I'd like to make it so you have to use substations to transform power up to or down from high-voltage lines, so I need to make it so that big electric poles can only connect to each other and to substations, not directly to medium and small electric poles. My first thought was to create a separate wire type that only big electric poles and substations could connect to, and remove big poles ability to connect to copper wire, but reading through some threads here, it looks like the wire types are hardcoded into the core game and cannot be added to or modified. Can anyone confirm if that's the case or not, and if so, is there a workaround for that mechanic that I could use?
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Electric pole wire connections

Post by Adil »

You could use runtime scripting to simulate this behavior, you need to track on_entity_built, on_robot_built_entity events and make sure that no undesired connections between poles occurs. Also, during on_put_item event it is probably possible to prevent manual connections done by player. There's this mod that can be used as an example https://mods.factorio.com/mods/theRusty ... s-circuits.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
Silophant
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Jan 26, 2017 5:11 am
Contact:

Re: Electric pole wire connections

Post by Silophant »

Perfect. Thanks!
Post Reply

Return to “Modding help”