I'd expect the x and y values to be random and thus the chart to be all over the place.
Code: Select all
local radius = 2.5
local x_offset = math.random(-250, 250)
local y_offset = math.random(-250, 250)
local position = {x_offset, y_offset}
local area = {{x_offset - radius, x_offset - radius}, {x_offset + radius, x_offset + radius}}
for _,force in pairs( game.forces )do
force.chart( game.surfaces[1], area)
end