ID:272747
 
Alright I tried using...

area/randomObjs
New()
..()
new/obj/Object(src)


But it only creates one obj on the area tile that's closest to the 1,1 coordinate. How do I make it so it will create an object on every single one of those areas; almost like a for loop.

note: I also tried using a for() loop in the world/New() proc, but still nothing.
Mizukouken Ketsu wrote:
But it only creates one obj on the area tile that's closest to the 1,1 coordinate.

Well, that's because for the location, you're using an area. In the location sense, an area doesn't refer to a specific tile (like a turf), but to a collection of them. So you're not actually telling DM which tile you want, so it just uses the first one in that area. As you know, you need to use a turf to choose a specific tile.

How do I make it so it will create an object on every single one of those areas; almost like a for loop.

Not "almost like", exactly. :P
Read this and you'll get going. But note unless you've meant "turfs" instead of "areas", that should be in singular; it's a single area that's involved, it just spans across multiple turfs.

note: I also tried using a for() loop in the world/New() proc, but still nothing.

Eh, this one is kinda vague since you could have tried many things in a for() loop, but whatever.
In response to Kaioken
I wanted to use an area so that I could just span it over a small area (no pun intended) of turfs and have it generate the objs on each tile of the area. Do I absolutely have to change that area to a turf to use the for loop?
In response to Mizukouken Ketsu
Mizukouken Ketsu wrote:
Do I absolutely have to change that area to a turf to use the for loop?

No. Areas "contain" turfs, so you can grab the reference to them from there. That means you have to use turfs in the end, but can use the area in the beginning to access the turfs easy.
In response to Mizukouken Ketsu
What I meant is, you're going to loop through this var of the area. Read the bit down about areas there.
In response to Kaioken
So...

world/New()
..()
for(var/turf/T in randomVeins)
if(prob(50)) //50|50 chance to create a vein
new/obj/Vein(T)


I'd need to check if there's a turf 'in' the area, not 'at' the area, right?