i need help please.
I created a mod that adds an ore field (rectangle) by placing an item. That works fine. Problem is that the item is in the center of the field.
I want that the the item is on the upper left side.
Most code is from Console Wiki
Code: Select all
local function on_stone ( entity )
   local ore=nil
   local size=28
   local size1=45
   local density=10000
   for y=-size, size do
	   for x=-size1, size1 do
		aaa=0
		a=(size1+1-math.abs(x))*10
		b=(size+1-math.abs(y))*10
		if a<b then
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))
		end
		if b<a then
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))
		end
   stoneore = entity.surface.create_entity{name="stone",amount=ore, position={entity.position.x+x, entity.position.y+y}, force=entity.force}
    
   end
   end
   end

