ID:178374
 
I am having trouble with this. I've searched through the references and the demos/libraries, but I can't find any code that allows me to check a specific location for the turf on that tile. I want it to check to see if there is turf/water at a location. Or just have a list that contains the turf that is there. Thanks.
locate(X,Y,Z) returns the turf at that location.

var/turf/T = locate(1,2,3)
if(istype(T,/turf/water))
usr << "It's wet at 1,2,3"
usr << "[T] at 1,2,3 contains:"
for(var/X in T.contents)
usr << "[X]"
In response to Shadowdarke
Thanks. Now I have another problem, how do I get the usr's direction in NORTH/SOUTH/EAST/WEST etc. without lengthly code. When I use usr.dir it returns a number instead of the direction like I want it.
In response to Garthor
That's because NORTH, SOUTH, and all the rest are numbers. They are just standard constants in BYOND. I use the following code to get the text for a given BYOND direction:

sd_dir2text(dir as num)
/* accepts a direction and returns the lowercase text name of
the direction */
switch(dir)
if(NORTH) return "north"
if(SOUTH) return "south"
if(EAST) return "east"
if(WEST) return "west"
if(NORTHEAST) return "northeast"
if(SOUTHEAST) return "southeast"
if(NORTHWEST) return "northwest"
if(SOUTHWEST) return "southwest"
In response to Shadowdarke
The problem is, I need to be able to check what's in the turf in front of the character. The code I have is
    verb
check()
var/turf/T = locate(get_step(usr,usr.dir))
usr << "there is [T] in front of you"
and it just says "There is in front of you". usr.dir is a number and it needs to be NORTH/SOUTH/EAST/WEST etc. for the get_step to work.
In response to Garthor
Garthor wrote:
The problem is, I need to be able to check what's in the turf in front of the character. The code I have is
    verb
> check()
> var/turf/T = locate(get_step(usr,usr.dir))
> usr << "there is [T] in front of you"
and it just says "There is in front of you". usr.dir is a number and it needs to be NORTH/SOUTH/EAST/WEST etc. for the get_step to work.

get_step() also returns a turf value. you can simplify your code to:
        check()
var/turf/T = get_step(usr,usr.dir)
usr << "there is [T] in front of you"