ID:139378
 
Code:
area
icon = 'background.dmi'
density = 0
Click(var/M)
new/obj/dirt(M)

obj
icon = 'terrain.dmi'
dirt
density = 1
icon_state = "dirt"
New(var/area/M)
loc = M
grasscheck()
proc
grasscheck()
set background = 1
while(src)
world << "Yes"
var/nograss=0
var/random = rand(1,2)
for(var/a=usr.y,a<=64,a++)
for(var/obj/T in locate(usr.x,a,usr.z))
if(T)
nograss = 1
break
if(nograss==0)
if(random == 1)
icon_state = "grass"
if(nograss==1)
icon_state = "dirt"
sleep(rand(1,100))
grasscheck()
Click()
del src


Problem description:

The grasscheck proc isn't even activating. The world << "Yes" thing is just to tell me if it activated or not. Which it didn't! The New() proc isn't even working. How do I fix this? D:

New objects spawned via clicking an area works, but not the ones that are originally on the map!

(Note: I have 64 of this obj on the map.)

EDIT: I changed it to an obj, so might aswell update this.
Try moving the grasscheck() under the obj group. Not under dirt.
It immediately crashes when it reaches the line:

                   for(var/a=usr.y,a<=64,a++)


usr is null, so usr.y returns a "null.y" error. As a rule, usr is not valid in procs. Presumably, you want src instead?