Advertisement
Sladki

Factorio island to continent

Dec 17th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. -- Поменять генератор
  2. /c local surface = game.player.surface
  3. local mgs = surface.map_gen_settings
  4. mgs.property_expression_names = {}
  5. surface.map_gen_settings = mgs
  6.  
  7. --УДОЛИТЬ чанки с водой
  8. /c
  9. local MIN_DISTANCE = 16
  10. local MIN_WATER = 1024 * 0.2
  11. local surface = game.player.surface
  12. for chunk in surface.get_chunks() do
  13.     local distance = chunk.x * chunk.x + chunk.y * chunk.y
  14.     if distance >= MIN_DISTANCE * MIN_DISTANCE then
  15.         water = surface.count_tiles_filtered({
  16.             area = {{chunk.x * 32, chunk.y * 32}, {chunk.x * 32 + 32, chunk.y * 32 + 32}},
  17.             collision_mask= "water-tile"
  18.         })
  19.         if water >= MIN_WATER then
  20.             surface.delete_chunk(chunk)
  21.         end
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement