ID:169222
 
is there an easier way to scan a tile, for example in front of the mob, then this?

oh and the scan should distinguish between different turfs in that tile (like "oh there is a wall" or "oh there is water")

var/A
A = locate(/turf/wall) in block(locate(x,y+1,z),locate(x,y+1,z))
Yep.
if(locate(typepath) in get_step(reference,direction))
dostuff
In response to Ol' Yeller
... sometimes I can't see the forest because of the many trees

thank you so much
In response to Ol' Yeller
uh..
I tried it, but it doesn't work.
I placed a wall of that type in front of the mob but it can't find it.. (and yes, the mob is looking in the dir where the wall was placed)
if(locate(/turf/wall/watch_wall) in get_step(src,dir))
view() << "found the wall"
In response to Gerdan
> if(locate(/turf/wall/watch_wall) in get_step(src,dir))
> view() << "found the wall"
>


1: To tell who found the wall:

    view() << "[src] found the wall."


2: If you copied and pasted the code their might be errors, that compiling wont see.

--Chwgt
In response to Chwgt
1: actually I start the scan of the mob manually and therefore a
view() << "found it"
is enough
it's just a test phase

2: i didn't c&p the code..
src is right because the scan is in a proc of the mob which stands in front of the wall and dir is also right because the mob's direction points to the wall
In response to Gerdan
weird..

if(istype(get_step(src,dir),/turf/wall/watch_wall))
view() << "found wall"


this works o_O

maybe locate() couldn't find the wall because get_step() returned the wall already and "in" the wall is no other wall ^^