ID:1955693
 
(See the best response by Lummox JR.)
Code:
proc/GeneratePlots()
var
cur_y = plot_SeperationDistance
cur_x = plot_SeperationDistance

for(var/i = 1, i <= world.maxz, ++i)
for(var/rows = 0, rows < plot_Rows, ++rows)
for(var/columns = 0, columns < plot_Columns, ++columns)
CreateEmptyBoxFromBottomLeft(/obj/Utility/PlotBounds, plot_Size, cur_x, cur_y, i)
CreateFilledBoxFromBottomLeft(/obj/Grounds/Grass/Green, plot_Size+2, cur_x+1, cur_y+1, i)

cur_x = (columns == plot_Columns-1) ? (plot_SeperationDistance) : (cur_x + plot_Size + plot_SeperationDistance)
cur_y = (columns == plot_Columns-1) ? (cur_y + plot_Size + plot_SeperationDistance) : (cur_y)

proc/CreateFilledBoxFromBottomLeft(var/obj/Object, size, x, y, z)
for(var/X=x, X <= size, ++X)
for(var/Y=y, Y <= size, ++Y)
new Object(locate(X, Y, z))


Problem description:
For some reason, it'll create the first box, however, it doesn't create any of the other boxes (1/25). The PlotBounds all create properly (the sidewalks in the picture), along with the roads I have. I'm not sure what the issue is, everything looks like it should work properly.



In the picture: generated roads and sidewalks. The green is the box that is supposed to be created in the middle of them all. The brown texture is the dirt texture that is under the grass. In other words, if it's not green, the box wasn't generated.



Brown = no box
Green = box

Also to note, there's no tiles under the generated grass box.



EDIT:

"CreateFilledBoxFromBottomLeft was called 125 times."

The function is being called the proper amount of times (5 columns, 5 rows, and 5 planes). Not sure why nothing is being created at this point though.
It's probably because you're adding to cur_y for each row. You'll end up with all your plots along a northeast diagonal being grass and nothing else.
In response to Kaiochao
It's setting it equal to cur_y because the row doesn't need changed until the end of that iteration, then it sets the cur_y for the start of next row


EDIT: changed some wording with how i explained it lol



EDIT2:

It's creating the correct number of squares as well (841, 29x29), however, it's only doing it at the first one. I ran a loop through all of the objects of this type in the world and it returned 841 as well. It's running the proc 125 times (like it should), however, it's only creating 841 objects out of 105,125 (125 plots in total).
Best response
Examine the arguments you're sending to the proc each time. I'm guessing that cur_x and cur_y are not what you think they are. If either one of them exceeds size, the proc don't do anything when you call it.
In response to Lummox JR
Phew it was something simple that I overlooked (forgot some logic) lmao

Thanks Lummox

proc/CreateFilledBoxFromBottomLeft(var/obj/Object, size, x, y, z)
var
x_size = x + size
y_size = y + size
for(var/X=x, X <= x_size, ++X)
for(var/Y=y, Y <= y_size, ++Y)
new Object(locate(X, Y, z))

All fixed :)