Code: Select all
local pos = position -- this is just the player position
local full_size = {width=10, height=10}
local full_area = {left_top = {x = pos.x - full_size.width / 2, y = pos.y - full_size.height}, right_bottom = {x = pos.x + full_size.width / 2, y = pos.y}}
local new_tiles = {}
for x, y in iarea(area) do
table.insert(new_tiles, {name = "water", position = {x, y}})
end
surface.set_tiles(new_tiles)
I've attached the mod, map save and log. Just load the save with the mod and place the smart chest.