Checking for nearby objects
|
|
I still can't figure this out. I'm trying to make a proc that will make a plant mutliply basically. If there are more plants nearby, the chance is reduced. Anyway, this is the code I have.
proc Grow() if(Grow == 2) var/N = pick(0,0,0,0,1,2,3,4) var/X as num for(var/obj/Z in oview(1)) if(Z == /obj/Herb) X += 1 N -= X Again if(N > 0) var/obj/Herb/H = new(get_step(src,pick(NORTH,SOUTH,EAST,WEST,NORTHWEST,SOUTHWEST,NORTHEAST,SOUTHEAST))) --N H.Grow = -1 goto Again else return 0 src.Grow = 0 else ++src.Grow
The part that is supposed to limit cluster growth is...
var/X as num for(var/obj/Z in oview(1)) if(Z == /obj/Herb) X += 1 N -= X
but it doesn't do anything. Can someone help me please?
|
is that realy needed if there is no usr editing of the var? That might or might not be the problem.