[Rseding91] Modding: "copper_wire_picture" not working

This subforum contains all the issues which we already resolved.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[Rseding91] Modding: "copper_wire_picture" not working

Post 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.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: copper_wire_picture

Post 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.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: copper_wire_picture

Post 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)
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: copper_wire_picture

Post by Mooncat »

ah, I see. So it is a modding related problem. I don't even know this trick existed. :shock:
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Modding: "copper_wire_picture" not working

Post 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.
If you want to get ahold of me I'm almost always on Discord.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Modding: "copper_wire_picture" not working

Post 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.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post by TheSAguy »

Thanks guys!
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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).
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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.
If you want to get ahold of me I'm almost always on Discord.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Modding: "copper_wire_picture" not working

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Modding: "copper_wire_picture" not working

Post 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 :P
https://forums.factorio.com/44505 wrote:
  • Utility sprites are now defined fully in the core mod prototypes.
If you want to get ahold of me I'm almost always on Discord.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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!

Image

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
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post by Nexela »

Giving your prototype
collision_mask = {}
should fix the first problem
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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...
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post by TheSAguy »

Rseding91,

Anyway you could help me out here?

Thanks,
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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.
If you want to get ahold of me I'm almost always on Discord.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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!
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [Rseding91] Modding: "copper_wire_picture" not working

Post 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
Post Reply

Return to “Resolved Problems and Bugs”