Page 1 of 1

May I ask how to modify the drawing order of physical images

Posted: Thu Dec 26, 2024 5:05 am
by sdgmlj
I made a solid using a prototype of a heat pipe, but it is always obscured by the entity behind it. How can I modify it? thank you

Re: May I ask how to modify the drawing order of physical images

Posted: Thu Dec 26, 2024 5:07 am
by sdgmlj
{
filename = path.."heating-tower.png",
priority = "high",
width = 320,
height = 320,
shift = {0.03, -1.45},
scale = 0.5,
},

Re: May I ask how to modify the drawing order of physical images

Posted: Thu Dec 26, 2024 5:47 am
by sdgmlj

Code: Select all

local entity = util.table.deepcopy(data.raw["heat-pipe"]["heat-pipe"])
entity.name = name
entity.icon = path.."icon.png"
entity.flags = {"placeable-neutral", "placeable-player", "player-creation"}
entity.icon_size = 64
entity.minable = {mining_time = 1, result = name}
entity.max_health = 600
entity.corpse = "small-remnants"
entity.collision_mask = {layers={item=true, object=true, player=true, water_tile=true, elevated_rail=true, is_object=true, is_lower_object=true}}
entity.collision_box = {{-1.4, -1.4}, {1.4, 1.4}}
entity.selection_box = {{-1.5, -1.5}, {1.5, 1.5}}
entity.drawing_box_vertical_extension = 2.5
entity.heat_buffer =
    {
	max_temperature = 500,
	specific_heat = "100MJ",
	max_transfer = "100MW",
	minimum_glow_temperature = 200,
	connections = 
		{
        {position = {1, 0}, direction = defines.direction.east},
        {position = {-1, 0}, direction = defines.direction.west},
		},
    }
entity.connection_sprites = set_connection_sprites(false)
entity.heat_glow_sprites = set_connection_sprites(true)
entity.fast_replaceable_group = nil
entity.heating_radius = 16
data:extend({item,recipe,entity})
I guess it's related to the prototype of the heat pipe. Do all entities have a default display priority? Where can I modify it? Who can help me

Re: May I ask how to modify the drawing order of physical images

Posted: Thu Dec 26, 2024 6:03 am
by robot256
Some entities allow the use of picture sets that include draw layer specifications. It seems that heat pipes do not, since they use ConnectableEntityGraphics which only allows flat sprites that automatically get drawn at ground level. You'll need to use a different entity type to make the graphics you want.

Re: May I ask how to modify the drawing order of physical images

Posted: Thu Dec 26, 2024 6:19 am
by sdgmlj
robot256 wrote: Thu Dec 26, 2024 6:03 am Some entities allow the use of picture sets that include draw layer specifications. It seems that heat pipes do not, since they use ConnectableEntityGraphics which only allows flat sprites that automatically get drawn at ground level. You'll need to use a different entity type to make the graphics you want.
Thank you, I want to make a heating tower because only the heat pipes and reactor support "heating_radius". It's not easy to change the prototype of the reactor because some inputs and outputs cannot be turned off. Can I only use a shorter material as this method?

Re: May I ask how to modify the drawing order of physical images

Posted: Thu Dec 26, 2024 1:11 pm
by robot256
I'm not sure what the best solution for you is. You might need to make a composite entity, where the base is a heat pipe and the graphics are added/removed by scripts when the base is built/destroyed. There are other threads about how to do that.

Re: May I ask how to modify the drawing order of physical images

Posted: Fri Dec 27, 2024 6:21 am
by sdgmlj
robot256 wrote: Thu Dec 26, 2024 1:11 pm I'm not sure what the best solution for you is. You might need to make a composite entity, where the base is a heat pipe and the graphics are added/removed by scripts when the base is built/destroyed. There are other threads about how to do that.
Thank you, I followed your instructions and added a 'lamp', which is now functioning properly