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

Place to get help with not working mods / modding interface.
sdgmlj
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

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

Post 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
Attachments
屏幕截图 2024-12-26 130049.jpg
屏幕截图 2024-12-26 130049.jpg (14.33 KiB) Viewed 267 times
屏幕截图 2024-12-26 130030.jpg
屏幕截图 2024-12-26 130030.jpg (24.03 KiB) Viewed 267 times
sdgmlj
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

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

Post by sdgmlj »

{
filename = path.."heating-tower.png",
priority = "high",
width = 320,
height = 320,
shift = {0.03, -1.45},
scale = 0.5,
},
sdgmlj
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

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

Post 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
robot256
Smart Inserter
Smart Inserter
Posts: 1062
Joined: Sun Mar 17, 2019 1:52 am
Contact:

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

Post 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.
sdgmlj
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

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

Post 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?
robot256
Smart Inserter
Smart Inserter
Posts: 1062
Joined: Sun Mar 17, 2019 1:52 am
Contact:

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

Post 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.
sdgmlj
Fast Inserter
Fast Inserter
Posts: 160
Joined: Sun Jul 04, 2021 11:12 pm
Contact:

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

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

Return to “Modding help”