ID:264931
 
Code:
mob
verb
Blind_Man_Stick()
for(var/turf/m in get_step(usr,usr.dir))
usr<<"You poke [m] with your slitck"
turf
wall
icon = 'Wall.dmi'
icon_state = "Wall"
density = 1


Problem description:

Any reason why this wont output the string? I am more then sure there is turf around me.. Does get_step not work with turf?
You have to do...

var/turf/T = get_step(src, dir)
I think get_step returns the location as a turf. So you're looking for a turf on a turf when you use for(turf in get_step). That's why if you forgo the for procedure and just set var/turf/m = get_step(usr,usr.dir). It will set m as the location you get, instead of looking for turfs inside of it.

Also i think i read before that only one turf can exist on a tile, having more than one is only for aesthetics. I'm not completely sure about that but if its true then for() has no purpose since it would only return one turf anyway.
In response to LordAndrew
what about adding trees to turf?
In response to Stonah_panda
Well, if the tree is a turf, when you add it to the map the turfs beneath the tree turf will be merged into its underlays. Only one instance of /turf can occupy one tile in BYOND.

var/turf/T = get_step(src, dir)


This will get a reference to whatever turf is directly in front of you. If you're looking for a specific one you'd do...

var/turf/tree/T = get_step(src, dir)

if(T) world << "Tree found."
else world << "[T] isn't a tree."


If the tree's just an obj you'd just use look for /obj/tree in get_step().
In response to Turles
Thank you very much
In response to LordAndrew
LordAndrew wrote:
This will get a reference to whatever turf is directly in front of you. If you're looking for a specific one you'd do...

> var/turf/tree/T = get_step(src, dir)
>
> if(T) world << "Tree found."
> else world << "[T] isn't a tree."
>

If the tree's just an obj you'd just use look for /obj/tree in get_step().

get_step() always returns whatever turf is in front of you (or null, I believe, if it's off the map). It doesn't implicitly take a type like locate() does, so you aren't guaranteed that T will be a tree in this case. You'll have to use istype() to confirm the turf is what you need it to be.
In response to DarkCampainger
this is what i have so far

tree
icon = 'tree.dmi'
density = 1