Page 1 of 1

Console command to delete trees within a specific radius?

Posted: Fri Apr 15, 2016 3:40 pm
by MegaHamster7
Hi,

Trees are the worst enemy in this game.....

Is there a console command to delete trees within a specific radius? Or a mod? Or some really easy way that doesn't involve robots/capsules/any effort on my part?

Re: Console command to delete trees within a specific radius?

Posted: Fri Apr 15, 2016 4:58 pm
by orzelek
There is a mod called explosive termites.
You can grab it here:
viewtopic.php?f=91&t=4757#p36148

Re: Console command to delete trees within a specific radius?

Posted: Fri Apr 15, 2016 6:40 pm
by daniel34
I think Koub answered you here: viewtopic.php?f=25&t=23724#p148981 :lol:
Koub wrote:

Code: Select all

/c for _,entity in pairs(game.local_player.surface.find_entities_filtered{area={{game.local_player.position.x-100, game.local_player.position.y-100}, {game.local_player.position.x+100, game.local_player.position.y+100}}, name="Tree 7"}) do entity.destroy() end
Replace "Tree 7" by the name of the tree kind you want to delete (hover mouse over it, it appears in the right of the screen)
Do this for any kind of tree you have around.
Clears a square of 200x200 tiles centered on you.
I suggest instead of name="Tree 7" use type="tree", that will get all the trees and not just specific ones.

Re: Console command to delete trees within a specific radius?

Posted: Fri Apr 15, 2016 6:52 pm
by Koub
This is the topic I wanted to post this :

Code: Select all

/c for _,entity in pairs(game.local_player.surface.find_entities_filtered{area={{game.local_player.position.x-100, game.local_player.position.y-100}, {game.local_player.position.x+100, game.local_player.position.y+100}}, name="Tree 7"}) do entity.destroy() end
Replace "Tree 7" by the name of the tree kind you want to delete (hover mouse over it, it appears in the right of the screen)
Do this for any kind of tree you have around.
Clears a square of 200x200 tiles centered on you.

:lol:
But well ...

Re: Console command to delete trees within a specific radius?

Posted: Fri Apr 15, 2016 11:34 pm
by MegaHamster7
Amazing thank you! Just what I was looking for.

@orzelek Thanks for the mod link. I had come across that one and considered it but it just doesn't sit well with me on the lore front. I know I'm a hypocrite as I'm cheating but if you're going to cheat, may as well do it properly! After a couple of hundred hours on a map I don't want clearing goddamn trees to be the thing that stops me playing. =)

Re: Console command to delete trees within a specific radius?

Posted: Sat Aug 20, 2016 3:35 pm
by mrkoss
Sorry for bad english :D
So, there is no working console command to delete ALL trees in Factorio 0.13.xx on internet that i could find. After some searching and testing subject, finally i found it :D

Code: Select all

/c local surface = game.player.surface
for c in surface.get_chunks() do
for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, type= "tree"})) do
entity.destroy()
end
end
This command delete all types of trees (not only one or two) in all of discovered area.

Re: Console command to delete trees within a specific radius?

Posted: Tue Sep 27, 2016 7:46 pm
by Sacredd
mrkoss wrote:Sorry for bad english :D
So, there is no working console command to delete ALL trees in Factorio 0.13.xx on internet that i could find. After some searching and testing subject, finally i found it :D

Code: Select all

/c local surface = game.player.surface
for c in surface.get_chunks() do
for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, type= "tree"})) do
entity.destroy()
end
end
This command delete all types of trees (not only one or two) in all of discovered area.
Works fine. Thank you.

Re: Console command to delete trees within a specific radius?

Posted: Wed Sep 28, 2016 7:41 am
by Acarin
Cluster grenades are your friend (but not once the pin is pulled). Invented by Star$s to make instant coffee stirrers out of 3.14159 hectares of forest...

THe FARL mod is also your friend! Drive through a forest and turn it into lovely fuel so that your train can... drive through more forest!

Re: Console command to delete trees within a specific radius?

Posted: Thu Nov 03, 2016 10:50 am
by Jackalope_Gaming
If you want to only delete trees in a given area from your character, use

Code: Select all

/c for _, entity in ipairs(game.player.surface.find_entities_filtered{ area={{game.player.position.x-32, game.player.position.y-32}, {game.player.position.x+32, game.player.position.y+32}}, type="tree"}) do entity.destroy() end
That will clear a 64x64 area centered on you. You can make the area smaller by decreasing the 32's to a lower number, or increase to a higher number.