Realistic Decoration Cleanup


Remove decorations prior to placing entities or tiles. In real life you would not build a house/road and leave the bushes below it, would you?

Tweaks
3 months ago
0.15 - 2.0
31.1K
Environment

i Add a recalculate button, please.

7 days ago
(updated 7 days ago)

When you add this mod to a world that already has buildings, the grass and bushes underneath them aren't removed. It would be cool if there was a button in the settings that would allow you to recalculate the placement of grass and bushes. Could you please try to add that?

7 days ago
(updated 7 days ago)

Unfortunately there is quite a lot going on in my life currently so I have been ghosting everyone here for a while and its unlikely to get better before the summer.
I am not going to enhance this mod, but get my Someone's Lua Console mod and run this code snippet (that way you dont lose achievements).

for _,surf in pairs(game.surfaces) do
    local cnt = 0
    for _, entity in pairs(surf.find_entities_filtered({force=game.player.force})) do
        if entity.type ~= "entity-ghost" and entity.type ~= "tile-ghost" and entity.prototype.selectable_in_game then
            surf.destroy_decoratives{area={{entity.selection_box.left_top.x-0.6, entity.selection_box.left_top.y-0.6}, {entity.selection_box.right_bottom.x+0.6, entity.selection_box.right_bottom.y+0.6}}}
            cnt = cnt + 1
        end
    end
    game.print("processed entities on "..surf.name..": "..cnt)
end

That should do basically what you want and remove all decoratives below buildings...
This would basically be the code I would add to your requested "button"-Functionality, except that I would need to add the handling of tiles too ... and documentation and release management.

To remove the bushes below concrete/stone floor I would like to suggest you to just tear the floor tiles down and ctrl+z it and let the bots tear down and rebuild everything, which would clear the paths.

6 days ago

Oh, hope you doing well, thank you anyway.

5 days ago

Not really. Anyway. Did the code work? ^.^

a day ago
(updated a day ago)

I didn't tried it yet, I would let you know as soon as I have some time for factorio)

New response