
A few things to notice:
- There are strips of grass in the sand fields (presumably on the chunk borders)
- These strips aren't straight
- Somehow trees and ores are spawning on these strips
I'm not entirely sure what you mean by "add the neighbour tiles". Add them as themselves or add them if they are water tiles as well. I've tried adding them as themselves and that didn't work and adding neighbouring water tiles would be a flood fill, which would likely be too slow.kovarex wrote:I believe that this is not a bug.
All you have to do is to change add also the neighbour tiles of the water tiles to the list of the tiles you want to convert.
That's good to knowkovarex wrote:When the onchunkgenerated call is done, all the neighbour chunks have already finished tiles.
Code: Select all
idx = 1
local newtiles = {}
for x=x1-32,x2+32,1 do
for y=y1-32,y2+32,1 do
if x < x1 or x > x2 or y < y1 or y > y2 then
name = game.gettile(x, y).name
newtiles[idx] = {name = name, position = {x, y}}
idx = idx + 1
elseif (x < -hsize or x > hsize) or (y < -hsize or y > hsize) then
name = game.gettile(x, y).name
if name == "water" or name == "deepwater"then
newtiles[idx] = {name = "sand", position = {x, y}}
idx = idx + 1
end
end
end
end
game.settiles(newtiles)
Code: Select all
idx = 1
local newtiles = {}
for x=x1-32,x2+32,1 do
for y=y1-32,y2+32,1 do
if (x < -hsize or x > hsize) or (y < -hsize or y > hsize) then
name = game.gettile(x, y).name
if name == "water" or name == "deepwater"then
newtiles[idx] = {name = "sand", position = {x, y}}
idx = idx + 1
end
end
end
end
game.settiles(newtiles)