Code: Select all
script.on_event(defines.events.on_chunk_generated, function(event)
--Some trivial code removed.
local tiles = {}
local index = 1
for x=event.area.left_top.x,event.area.right_bottom.x-1
do
for y=event.area.left_top.y,event.area.right_bottom.y-1
do
if math.abs(x)>global.distance_control.land_half_size or math.abs(y)>global.distance_control.land_half_size
then
tiles[index] = {name = "water", position = {x, y}}
index = index + 1
end
end
end
event.surface.set_tiles(tiles)
--Some trivial code removed.
end)
Code: Select all
script.on_event(defines.events.on_tick, function(event)
--Some trivial code removed.
local test_tile = game.surfaces[1].get_tile(some coord out side the 200 square)
game.print(tostring(test_tile.valid))
game.print(test_tile.name)
-- Sometimes the result is some land.
--Some trivial code removed.
end)