noRocks Redux


Removes rocks and trees as they spawn

Utilities
3 years ago
0.15 - 1.1
461

i small tip

6 years ago

small tip at the edge the function you use is very ups intensive, every time a radar detects or uncovers an area, the function will be executed which is quite lagging with time.

i mean this function

script.on_event(defines.events.on_chunk_generated, function(e)
-- remove everything we don't want
for key, entity in pairs(e.surface.find_entities(e.area)) do
if entity.type == "decorative" or
(entity.type == "tree" and settings.startup["noRocks_removeTrees"].value == true) or
(settings.startup["noRocks_removeRocks"].value == true and in_table(entityNamesToRemove, entity.name))
then
entity.destroy()
end
end

6 years ago
(updated 6 years ago)

In the latest version, which was uploaded before your reaction, I have changed that function to take the count_as_rock_for_filtered_deconstruction which should be slightly more UPS friendly, as it doesn't need to itererate a table on every entity.

Luckely it is only when a chunck is generated, which usually doesn't happen every few seconds. But I will try to make it more UPS friendly if I find the way to do so

New response