I made a helicopter, but it flies under trees

Place to get help with not working mods / modding interface.
Zuzak
Inserter
Inserter
Posts: 33
Joined: Sat Oct 04, 2014 6:09 pm
Contact:

I made a helicopter, but it flies under trees

Post by Zuzak »

I made a helicopter, but it flies under trees.
I made it, it functions, but even though it is using (temporarily for now) (scaled up)construction bot art, it goes under/behind stuff like the car does. It currently looks very silly going under things like that, as I want it to be a big, fast, gashogging blimp/helicopter.

I want this helicopter entity to be drawn always on top of buildings, shadows, rocks, trees, bots, everything else.

Is there such a piece of code to do so that I have overlooked for months?
Or is it a hardcoded property of a drivable entity?

In thanks I will release it.
Last edited by Zuzak on Tue Mar 03, 2015 7:03 pm, edited 1 time in total.
Pickle

Re: I have a helicopter, but it flies under trees

Post by Pickle »

You have to change the RenderLayer.

Look for "render_layer" in these file for an example.

"\data\base\prototypes\entity\demo-doodads.lua"
"\data\base\prototypes\entity\demo-entities.lua"
Zuzak
Inserter
Inserter
Posts: 33
Joined: Sat Oct 04, 2014 6:09 pm
Contact:

Re: I have a helicopter, but it flies under trees

Post by Zuzak »

finally got internet access for a few minutes.

Thank you. I will tinker with it when I get back home.
Zuzak
Inserter
Inserter
Posts: 33
Joined: Sat Oct 04, 2014 6:09 pm
Contact:

Re: I made a helicopter, but it flies under trees

Post by Zuzak »

The render layer specifies the order of the sprite when rendering, most of the objects have it hardcoded in the source, but some are configurable.
desired code narrowed down to
render_layer = "air-object",
final_render_layer = "air-object",

Sadly, type car seems to be one of the harcoded ones, to lower-object
(layer narrowed down via editing wall corpse final_render_layer = "remnants", multiple times)
I think it very strange that type = corpse, decorative doodads, and smoke to be the only types not hardcoded
I messed around a bit with a few other entities and seems only objects that have render layer already in their code (corpses, doodads, and smoke) seem to respond to changing it. Adding it to one without gets ignored. Possibly it might be different for more current factorio as for lack of home internet for months has left me stuck with v11.6.
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: I made a helicopter, but it flies under trees

Post by SHiRKiT »

Zuzak wrote:
The render layer specifies the order of the sprite when rendering, most of the objects have it hardcoded in the source, but some are configurable.
desired code narrowed down to
render_layer = "air-object",
final_render_layer = "air-object",

Sadly, type car seems to be one of the harcoded ones, to lower-object
(layer narrowed down via editing wall corpse final_render_layer = "remnants", multiple times)
I think it very strange that type = corpse, decorative doodads, and smoke to be the only types not hardcoded
I messed around a bit with a few other entities and seems only objects that have render layer already in their code (corpses, doodads, and smoke) seem to respond to changing it. Adding it to one without gets ignored. Possibly it might be different for more current factorio as for lack of home internet for months has left me stuck with v11.6.
Actually if requested, they can expose and change this behaviour.
Post Reply

Return to “Modding help”