turf
grass
icon = 'preset.dmi'
icon_state = "grass"
name = "grass"
New()
icon_state = pick("grass","grass2","grass3","grass4")
dirt
icon = 'preset.dmi'
icon_state = "dirt"
New()
var/dcount = 0
var/list/otherturfs=new()
for(var/turf/dirt/T in orange(1,src))
dcount++
for(var/turf/B in orange(1,src))
if(B != /turf/dirt)
otherturfs+=B
while(dcount << 2)
var/picked=pick(otherturfs)
new/turf/dirt(locate(picked))
dcount++
Problem description:
Now, I'm playing around with turfs, so don't ask me what in gods name am I doing with that code. I'm trying to make it so when a dirt turf is created it checks its range for anything that isn't a dirt and uses it as a suitable target for place its dirt brethren until it has enough dirt around it to be happy. However, I haven't seen... any results. At all. I'm probably just doing something stupid and not realizing it. Also, I have tried multiple ways of locating the new dirt, such as using the location of the picked turf but nothing is working.
Bah.
EDIT: You can also use istype() instead of type ==
EDIT#2: Using less than in your while loop will crash the game if you keep increasing dcount.