Hiding the copper wire on poles (from hidden entities)

Place to get help with not working mods / modding interface.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Hiding the copper wire on poles (from hidden entities)

Post by TheSAguy »

Hi,

Does anyone know how I can remove/hide the copper wires that automatically get connected on power poles?
I'm using hidden power poles and would like not too show the wires. So they should still be connected, but I need to just remove the wire picture/make it invisible.

I've had some help from Rseding91 here.
He mentioned that Utility sprites are now defined fully in the core mod prototypes.
So it's located in the utility_sprites.lua "copper_wire" line 701.

The thing is, I want to only hide the wire on my custom pole I created, not all poles...
Here is my Power rail I'm trying to create. I'd like to hide that power lines from the hidden power poles:
Image
Thanks.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Hiding the copper wire on poles (from hidden entities)

Post by 321freddy »

This could be done with a little workaround:
All the electric-pole entities have a connection_points definition in which they define where the wires are connected.
I guess you could offset the connection points by a huge number so they are all offscreen which means they shouldn't be visible to the player.

Also it seems like your electric poles are colliding with the rails and therefore preventing them from being placed.
You should add a "collision_mask = { }" to your entity prototype.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Hiding the copper wire on poles (from hidden entities)

Post by TheSAguy »

321freddy wrote:This could be done with a little workaround:
All the electric-pole entities have a connection_points definition in which they define where the wires are connected.
I guess you could offset the connection points by a huge number so they are all offscreen which means they shouldn't be visible to the player.

Also it seems like your electric poles are colliding with the rails and therefore preventing them from being placed.
You should add a "collision_mask = { }" to your entity prototype.
Thanks 321freddy,
Yes I fixed the collision mask, thanks.
As for your idea... I think it would work for the rail itself, but might have an issue once you place an actual electric pole next to the rail to connect it to the grid. I think that line will then run from the pole to the point you defined very far away....

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Hiding the copper wire on poles (from hidden entities)

Post by 321freddy »

Do you want the invisible poles to connect to other visible poles? If not you could remove the copper wire coming in from other poles via script once they are placed. And then maybe add some kind of special rail entity like a power switch which connects the visible electric network to the rail network (again use a script to connect it with copper wire to the rail network). The power switch has two individual connection point definitions, so use this to only hide the wire of one side of the switch.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Hiding the copper wire on poles (from hidden entities)

Post by TheSAguy »

321freddy wrote:Do you want the invisible poles to connect to other visible poles?
I was not clear. The "Invisible rail poles" do need to connect to each other, but at some point, they are going to have to connect to the power grid via a real power pole. That's where I see the issue.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Hiding the copper wire on poles (from hidden entities)

Post by Choumiko »

i can't really think of any way to really hide them for only a certain pole.

Another hack that might reduce the ugliness is to make the max distance of your poles just big enough to connect to the next pole of a straight rail (the loco buffer would have to be big enough to be able to make it through curved rails)
That would in theory leave you with wires that don't hang out from the rails.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Hiding the copper wire on poles (from hidden entities)

Post by 321freddy »

TheSAguy wrote:I was not clear. The "Invisible rail poles" do need to connect to each other, but at some point, they are going to have to connect to the power grid via a real power pole. That's where I see the issue.
Then as I said, you could remove the copper wire coming in from other poles via script once they are placed. And then you let the player use copper wire himself to connect his "normal" power poles some kind of power network interface with a power switch type entity as I described in my previous post.

Post Reply

Return to “Modding help”