ID:176468
 
How would I make a new instance of an object on every turf within a certain range of the src?
maybe like this:
var/range //cahnge the range to whatever
for(var/turf/t in oview(range,src))
new /obj(locate(t.loc))
In response to Weedman
No, that doesnt work. Already tried it, all it does is create a new obj in the first instance of the turf found on the map.
In response to Jotdaniel
ok this should:
mob/verb
CreateObjs()
for(var/turf/X in range(src,1))
var/obj/blah/B = new /obj/blah
B.loc = X
obj/blah
icon = 'blah.dmi'
In response to Weedman
Still no, besides, that does the same thing as new(B.loc)
In response to Jotdaniel
It does work i Just tried it!
In response to Weedman
Whoops, typed it in wrong. Yeah that does work, thanks.
In response to Weedman
Weedman wrote:
maybe like this:
var/range //cahnge the range to whatever
for(var/turf/t in oview(range,src))
new /obj(locate(t.loc))

Nope. Since t is a turf, t.loc is an area; if you create something in the area, it'll find the first turf where it's safe to put an obj. That should be:
new/obj/thing(t)

Lummox JR