Hiding power line wire?

Place to get help with not working mods / modding interface.
Hetsin
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Apr 09, 2016 4:00 am
Contact:

Hiding power line wire?

Post by Hetsin »

Hello,

I've working on a mod that uses invisible pole poles (based off of Powered Entities by DedlySpider), but the wires are still visible. I've referenced 5dim's powered rail, but it seems that the copper_wire_picture, green_wire_picture, red_wire_picture and wire_shadow_picture parts of the electric-pole type are no longer functional. I assume that the wires are now done procedurally via the connection_points property/definition(?), but Factorio really didn't like it when I set the direction_count to 0 and dummied out connection_points.

Is there a way to disable or hide the wire, while still keeping the connection?
User avatar
StanFear
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Dec 15, 2013 2:49 pm
Contact:

Re: Hiding power line wire?

Post by StanFear »

have you tried making wire distance to 0 and connecting the poles manually using connect_neighbour(target) ?
Hetsin
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Apr 09, 2016 4:00 am
Contact:

Re: Hiding power line wire?

Post by Hetsin »

No joy, unless I'm (very likely) coding this wrong.

Code: Select all

local entity = event.created_entity

...

local positionX = entity.position.x
local positionY = entity.position.y
			
--look for invisible power poles around this space
local foundEntities = entity.surface.find_entities_filtered{area={{positionX-1, positionY-1},{positionX+1, positionY+1}}, name="tiny-invisible-electric-pole"}
			
--place invisible power pole
entity.surface.create_entity{name="tiny-invisible-electric-pole", position=entity.position, force=game.players[1].force}
			
local thisEntity = entity.surface.find_entities_filtered{area={{positionX-0.5, positionY-0.5},{positionX, positionY}}, name="tiny-invisible-electric-pole"}
			
for _ ,foundEntity in ipairs(foundEntities) do
	if (foundEntity == "tiny-invisible-electric-pole") then
		thisEntity.connect_neighbour(foundEntity)
	end
end
It doesn't throw up errors, but it doesn't connect them either. =\
User avatar
StanFear
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Dec 15, 2013 2:49 pm
Contact:

Re: Hiding power line wire?

Post by StanFear »

well, it doesn't seem to be working for me eather...
I do have an idea of a solution but ... it would not be clean at all ...

create a pole without reach, create one with reach, when the small one is created, create a big one on another surface at the same position, then connect the two (it seems you can't connect when the distance is biger than the reach) that way, you connect them but the cables run on another surface -> they are not visible, and since the distance between the two poles is 0 (same position) they can connect

but as I said, this is really not clean... as it would be CPU intensive to generate the surface and set it all to the same clean terrain
but, the solution is here, or you could ask for the possibility for it to work in the modding interface requests !
cooky173
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Apr 15, 2016 3:37 am
Contact:

Re: Hiding power line wire?

Post by cooky173 »

First of all, 5dims electric rails were broken and possibly still are. Once you fix them they show a wire connection.

Next my guess. Couldld you make a new wire that is transparent?
Post Reply

Return to “Modding help”