Allow other wires to behave like copper-cable

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Anachrony
Fast Inserter
Fast Inserter
Posts: 133
Joined: Thu Sep 21, 2017 10:55 pm
Contact:

Allow other wires to behave like copper-cable

Post by Anachrony »

I ran into an issue with my mod where I wanted to make the wire behave like copper-cable for the sake of electrical connections. After looking at the copper wire prototype, I thought the magic must be wire_count, but apparently it's not, and that's also set on red and green wire. I'm not looking to change how it's rendered or anything, but it seems a little uncharacteristic to require that one and only one item can have this ability and it must be called copper-cable. There are many mods with different types of wire beyond copper. In mine, copper is not unlocked until the end game, after launching rockets. It appears that my only option will be to override the localised_name and icon for copper-cable to appear to be one of my lower tech wire types, then search and replace all uses of that wire with copper-cable, and add a migration for previous releases. But even then I have to choose only one type of wire to have this behavior, remember the hacky name in future recipes, and FNEI search will now not be able to find the item if people look up the in game name.

Would it be possible to add some way to prototype an item to behave like copper cable for the sake of forming electrical connections? I'm not concerned about changing the graphics for how it's rendered. You do not get copper cable back when you remove an electrical connection, so there'd be no need to have it pick what wire item to give back if there were more than one option.

ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Re: Allow other wires to behave like copper-cable

Post by ss_Baum »

https://wiki.factorio.com/Prototype/Item.
That has a wire-count. But I don't know what will happen, if you set this to one.

Anachrony
Fast Inserter
Fast Inserter
Posts: 133
Joined: Thu Sep 21, 2017 10:55 pm
Contact:

Re: Allow other wires to behave like copper-cable

Post by Anachrony »

ss_Baum wrote:
Wed Feb 03, 2021 11:24 am
That has a wire-count. But I don't know what will happen, if you set this to one.
I mentioned wire_count in my post. As far as I can tell that field does nothing and just recognizes copper-cable by name. green-wire and red-wire also set that field to 1, but all 3 behave differently, and any other item that sets it does nothing. I think a reasonable interface would be if any item sets wire_count to a positive number it behaves like copper-cable, with the exception of red-wire and green-wire, which remain hardcoded.

ss_Baum
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Apr 04, 2018 10:58 am
Contact:

Re: Allow other wires to behave like copper-cable

Post by ss_Baum »

Did you set the connection points before trying it?
Just an idea.

User avatar
bormand
Fast Inserter
Fast Inserter
Posts: 201
Joined: Fri Jun 05, 2020 9:59 am
Contact:

Re: Allow other wires to behave like copper-cable

Post by bormand »

ss_Baum wrote:
Wed Feb 03, 2021 12:58 pm
Did you set the connection points before trying it?
Connection points are hardcoded to "copper", "red" and "green". So, wire item names are hardcoded too, I think. All their properties are similar, they differ mostly in name.

Post Reply

Return to “Modding interface requests”