Page 1 of 1
[Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu Aug 25, 2016 4:47 pm
by TheSAguy
Has "copper_wire_picture" been removed from the electric-pole entity?
Does not seem to work.
Is there another way to remove the lines between poles?
Thanks.
Re: copper_wire_picture
Posted: Thu Aug 25, 2016 5:38 pm
by Mooncat
What do you mean by removed? Do you have an error?
Shift + Left click on the electric pole to disconnect its wires.
Use copper cable to connect it manually.
Re: copper_wire_picture
Posted: Thu Aug 25, 2016 5:53 pm
by TheSAguy
Shift Click is a manual process, what if you don't want to show the wire or change it's color?
I'm trying to add ghost.invisible entities that don't show a wire between them, even though it is there.
In the past this could be done with "copper_wire_picture", but not working anymore. (for me at least)
Re: copper_wire_picture
Posted: Thu Aug 25, 2016 6:29 pm
by Mooncat
ah, I see. So it is a modding related problem. I don't even know this trick existed.
![Shocked :shock:](./images/smilies/icon_eek.gif)
Re: Modding: "copper_wire_picture" not working
Posted: Fri Aug 26, 2016 1:10 pm
by Rseding91
The "copper_wire_picture" property was removed and converted into a utility sprite that all electric poles use.
I'll convert all of the "utility sprites" to be defined in the core game prototype files for 0.15 so the images can be set by mods.
Re: Modding: "copper_wire_picture" not working
Posted: Fri Aug 26, 2016 2:20 pm
by kovarex
Rseding91 wrote:The "copper_wire_picture" property was removed and converted into a utility sprite that all electric poles use.
I'll convert all of the "utility sprites" to be defined in the core game prototype files for 0.15 so the images can be set by mods.
And we should also make it possible to access it from the SpriteBank, so it can be used in the gui.
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Fri Aug 26, 2016 2:25 pm
by TheSAguy
Thanks guys!
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu Sep 22, 2016 12:46 am
by aubergine18
Will this allow additional wire colors to be added, for example if I want a blue wire in addition to red, green and copper? (Would also need to update the `defines.wire_type` and facilitate adding connector/shadow offsets for wires (but not mandating them, eg. I might only want specific entity prototypes to accommodate blue wires).
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu Sep 22, 2016 1:32 am
by Rseding91
aubergine18 wrote:Will this allow additional wire colors to be added, for example if I want a blue wire in addition to red, green and copper? (Would also need to update the `defines.wire_type` and facilitate adding connector/shadow offsets for wires (but not mandating them, eg. I might only want specific entity prototypes to accommodate blue wires).
No. The game only had internal logic for the 2 wire types. It will simply allow you to change the sprite(s) used.
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu Sep 22, 2016 2:39 am
by aubergine18
I'll convert all of the "utility sprites" to be defined in the core game prototype files for 0.15 so the images can be set by mods.
Would that change allow me to at least colorise/tint the wire via mod code? So player attaches any color to my entity, but then my code can see that and tint the wire blue?
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu Sep 22, 2016 3:00 am
by Rseding91
aubergine18 wrote:I'll convert all of the "utility sprites" to be defined in the core game prototype files for 0.15 so the images can be set by mods.
Would that change allow me to at least colorise/tint the wire via mod code? So player attaches any color to my entity, but then my code can see that and tint the wire blue?
No.
Re: Modding: "copper_wire_picture" not working
Posted: Tue May 02, 2017 9:57 pm
by TheSAguy
Rseding91 wrote:The "copper_wire_picture" property was removed and converted into a utility sprite that all electric poles use.
I'll convert all of the "utility sprites" to be defined in the core game prototype files for 0.15 so the images can be set by mods.
I was wondering if this was ever implemented. Would like to have power poles with no wires showing between them, even though connected.
Thanks.
Re: Modding: "copper_wire_picture" not working
Posted: Tue May 02, 2017 10:25 pm
by Rseding91
TheSAguy wrote:Rseding91 wrote:The "copper_wire_picture" property was removed and converted into a utility sprite that all electric poles use.
I'll convert all of the "utility sprites" to be defined in the core game prototype files for 0.15 so the images can be set by mods.
I was wondering if this was ever implemented. Would like to have power poles with no wires showing between them, even though connected.
Thanks.
Yep, it's even in the 0.15 changelog
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Wed May 03, 2017 3:12 am
by TheSAguy
Thanks Rsending91!
I was trying to figure this out, but am having difficulties. Hoping you or someone could help please.
I was able to remove the shadows, but not the copper connecting wires themselves. (see image below. No shadow, but lines)
In the code I just blanked out the connection points like this:
Code: Select all
connection_points =
{
{
shadow =
{
},
wire =
{
}
},
{
shadow =
{
},
wire =
{
}
},
{
shadow =
{
},
wire =
{
}
},
{
shadow =
{
},
wire =
{
}
}
},
What else do I need to do.
Also, I am creating a hidden entity, the power pole, to make my rails transmit power. Unfortunately, this hidden entity is causing the rails not to be able to cross each other. (see image below)
I thought the flag, "not on map" would resolve this, but it did not. What can I do to make the hidden entity not cause this issue?
Thanks!
Here is the code of the Power entity:
Code: Select all
------- Rail Pole
{
type = "electric-pole",
name = "bi_medium-electric-pole_for_rail",
icon = "__Bio_Industries__/graphics/icons/Bio_Farm_Cabeling.png",
--flags = {"placeable-neutral", "player-creation", "placeable-off-grid", "not-repairable", "not-on-map"},
flags = {"placeable-neutral", "placeable-off-grid", "not-repairable", "not-on-map"},
selectable_in_game = false,
max_health = 1,
resistances = {{type = "fire", percent = 100}},
collision_box = {{-0, -0}, {0, 0}},
maximum_wire_distance = 8,
supply_area_distance = 5,
pictures =
{
filename = "__Bio_Industries__/graphics/icons/empty.png",
priority = "low",
width = 0,
height = 0,
frame_count = 1,
axially_symmetrical = false,
direction_count = 4,
shift = {0.75, 0},
},
connection_points =
{
{
shadow =
{
},
wire =
{
}
},
{
shadow =
{
},
wire =
{
}
},
{
shadow =
{
},
wire =
{
}
},
{
shadow =
{
},
wire =
{
}
}
},
radius_visualisation_picture =
{
filename = "__Bio_Industries__/graphics/icons/empty.png",
width = 0,
height = 0,
priority = "low"
},
},
Here is the creation of the hidden entity in the control:
Code: Select all
function On_Built(event)
local entity = event.created_entity
--- Concrete Rail has been built
if (entity and entity.name == "straight-rail") or (entity and entity.name == "curved-rail") then
writeDebug("Concrete Rail has been built")
local surface = entity.surface
local force = entity.force
local position = entity.position
local rail_track = entity
local pole_name = "bi_medium-electric-pole_for_rail"
local create_rail_pole = surface.create_entity({name = pole_name, position = position, force = force})
create_rail_pole.minable = false
create_rail_pole.destructible = false
group_entities(cantor(position.x,position.y), { rail_track, create_rail_pole })
end
end
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Wed May 03, 2017 4:57 am
by Nexela
Giving your prototype
collision_mask = {}
should fix the first problem
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Wed May 03, 2017 1:29 pm
by TheSAguy
Nexela wrote:Giving your prototype
collision_mask = {}
should fix the first problem
Thanks Nexela, that did fix the second issue.
Now just how to get rid if the copper wires showing...
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Wed May 03, 2017 10:20 pm
by TheSAguy
Rseding91,
Anyway you could help me out here?
Thanks,
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Wed May 03, 2017 11:55 pm
by Rseding91
TheSAguy wrote:Rseding91,
Anyway you could help me out here?
Thanks,
It's defined in the core mod utilitysprites.lua "copper_wire" line 701.
You can mod it out to any other sprite using the same syntax as that file.
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu May 04, 2017 12:39 am
by TheSAguy
Rseding91 wrote:TheSAguy wrote:Rseding91,
Anyway you could help me out here?
Thanks,
It's defined in the core mod utilitysprites.lua "copper_wire" line 701.
You can mod it out to any other sprite using the same syntax as that file.
Cool, thanks for the reply!
Re: [Rseding91] Modding: "copper_wire_picture" not working
Posted: Thu May 04, 2017 2:32 am
by TheSAguy
Okay, so I see it there in the utility_sprites:
Code: Select all
data:extend(
{
{
type = "utility-sprites",
name = "default",
copper_wire =
{
filename = "__core__/graphics/copper-wire_tweak.png",
priority = "extra-high-no-scale",
width = 224,
height = 46
},
}
})
Is it possible though, to only change the copper wire on a custom power pole, without changing all copper wires?
All I want to do is remove the wire lines from my track that has a hidden pole:
![Image](https://forums.factorio.com/images/ext/ffaadb9d237324cc973273b095e12411.png)