I have the creep working with the line below:
Code: Select all
function check_spawners()
if global.biterbase ~= nil then
for k,gen in pairs(global.biterbase) do
local tiles={}
local surface = gen.surface
for y=-(global.CreepSpread),(global.CreepSpread) do
for x=-(global.CreepSpread),(global.CreepSpread) do
if not string.match(surface.get_tile(gen.position.x+x,gen.position.y+y).name, "water") then
table.insert(tiles, {name="Creep", position={gen.position.x+x,gen.position.y+y}})
end
end
end
surface.set_tiles(tiles)
end
end
end