Page 1 of 1

[1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's

Posted: Sat Mar 12, 2022 12:19 pm
by Muppet9010
In 1.1.55 and before you could obtain the the autoplace_specification from a tree LuaEntityPrototype, but in 1.1.56 this isn't obtainable and it isn't listed as an intentional loss in the 1.1.56 changelog. its also still in current documentation.
https://lua-api.factorio.com/latest/Lua ... cification

Prototypes being obtained via the below snippet:

Code: Select all

game.get_filtered_entity_prototypes({{filter = "type", type = "tree"}, {mode = "and", filter = "autoplace"}})

EDIT: on trying more code I think its an internal Factorio error on trying to get the autoplace_specification. As I get the below error when I try to check if autoplace_specifiation is nil:

Code: Select all

Value can't be NaN. in property tree at ROOT.coverage

Code: Select all

local treeEntities = game.get_filtered_entity_prototypes({{filter = "type", type = "tree"}, {mode = "and", filter = "autoplace"}})
for _, prototype in pairs(treeEntities) do
    if prototype.autoplace_specification ~= nil and prototype.autoplace_specification.peaks ~= nil then
        log(prototype.name)
    end
end

Re: [1.1.56] Removal/Error of autoplace_specification field from tree LuaEntityPrototype's

Posted: Sat Mar 12, 2022 3:23 pm
by Rseding91
Thanks for the report. This is fixed for the next release.