Code: Select all
local surface=game.player.surface
local pos=game.player.position
area = {{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}
for _, e in pairs(surface.find_entities_filtered{area=area})
do
game.print(e.type.." - ".. e.name)
-- here next values:
-- cliff - se-core-seam-fissure
-- resource - se-core-fragment-omni
-- smoke-with-trigger - se-core-seam-smoke-generator
end
for _, e in pairs(surface.find_entities_filtered{
area=area,
type={"resource","tree","decorative","simple-entity","cliff"}})
do e.destroy()
end
for _, e in pairs(surface.find_entities_filtered{area=area, type="smoke-with-trigger"}) do
game.print("smoke-with-trigger")
game.print(e.can_be_destroyed()) -- here true
e.destroy()
end
for _, e in pairs(surface.find_entities_filtered{
area=area,
name={"se-core-fragment-omni"}}) do
game.print("se-core-fragment-omni") -- do not printed. Script can't not found entity with this name
e.destroy()
end