ID:178374
May 22 2002, 10:19 pm
|
|
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.
|
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 |
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 get_step() also returns a turf value. you can simplify your code to: check() |
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]"