ID:1029500
 
Code:
mob/verb/ChangeClimate()
for(var/turf/Genetic/Grass/G in oview(3))
if(G.icon_state=="Snow")
G.icon_state="Grass1"
for(var/X=1,X<world.maxx,X++)
for(var/Y=1,Y<world.maxy,Y++)
if(G in locate(X,Y,src.z))
G.icon_state="Grass1"
else
G.icon_state="Snow"
for(var/X=1,X<world.maxx,X++)
for(var/Y=1,Y<world.maxy,Y++)
for(var/turf/Genetic/Grass/GG in locate(X,Y,src.z))
if(GG.icon_state=="Grass1")
G.icon_state="Snow"


Problem description: I am trying to change climate and when it become snow all the grass turn into snow but only grass without anyturf over it become snow rest stays same.

Turfs with another turf over it in the map editor use all turfs under the top turf as underlays, you'd have to cycle through the underlays of all the turfs aswell.
tried this nothing found
mob/verb
ChangeClimateNew()
for(var/Y=y-3,Y<y+3,Y++)
for(var/X=x-3,X<x+3,X++)
var/turf/T=locate(x,y,1)
src<<"Found T: [T]"
for(var/turf/A in T.underlays)
src<<"Found [A]"
if(A.icon_state=="Grass1")
A.icon_state="Snow"
src<<"Found [A]"

and if i try this codes
atom/verb
CheckUnderlays()
set src in oview(3)
for(var/atom/A in src.underlays)
usr<<A
CheckOverlays()
set src in oview(3)
for(var/atom/A in src.overlays)
usr<<A

The check underlays and overlays replies nothing
As far as I'm aware, you can't have two turfs in the same location. When you lay a turf over another turf, it uses the previous turf's icon as an underlay for the new turf.

You're checking for turfs of type "/turf/Genetic/Grass". Are the turfs you're trying to modify of that same type?
In response to Kitsueki
Kitsueki wrote:
As far as I'm aware, you can't have two turfs in the same location. When you lay a turf over another turf, it uses the previous turf's icon as an underlay for the new turf.

You're checking for turfs of type "/turf/Genetic/Grass". Are the turfs you're trying to modify of that same type?

I am trying to figure out how can i change icon_state of a turf under 16x16 turf