[2.1.12] lua api: rendering in chart mode is impossible above render_layer 190

Bugs which we just recently fixed in our development version and will reach you in the next release.
kuviman
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Feb 02, 2024 1:26 pm
Contact:

[2.1.12] lua api: rendering in chart mode is impossible above render_layer 190

Post by kuviman »

Trying to use rendering.draw_sprite using render_mode = "chart" works with only layers less or equal to 190 ("arrow").
If use render_layer above 190 (191 / 255 / "cursor"), nothing gets rendered.
Issue is only present in "chart" render_mode

Reproduced with a simple mod, just control.lua like this:

Code: Select all

script.on_event(
    defines.events.on_tick,
    function(event)
        for i, player in pairs(game.players) do
            if player.character ~= nil then
                rendering.draw_sprite({
                    sprite = "item.iron-plate",
                    x_scale = 100,
                    y_scale = 100,
                    time_to_live = 1,
                    target = player.character,
                    surface = player.surface,
                    render_mode = "chart",
                    render_layer = 191,
                })
            end
        end
    end)
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4818
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.1.12] lua api: rendering in chart mode is impossible above render_layer 190

Post by boskid »

What you are saying is partially true, there are layers 213, 214, 215 and 216 that are above 190 and are being rendered. This is tricky to decide because script rendering in order to work correctly has to hook into chart rendering, and chart rendering was not adjusted to make it draw all render layers but only those that are relevant to chart as there is also rendering of other sprites not strictly associated to render layers.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17415
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.1.12] lua api: rendering in chart mode is impossible above render_layer 190

Post by Rseding91 »

I decided to change the logic for the next release so it will render the remaining layers.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved for the next release”