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