ID:162361
 
I've just started today working on a way to get an NPC to move to a given obj, or area, or to ANYTHING for that matter. I'm using:

walk_to(src,/obj/Test,1)

I've found the source of the problem to be that you can't have /anytype/anything for the trigger. I realize I can use the for() proc and have you select the thing you want the NPC to travel to, but I want the NPC to go to a specific location without any help from a user.

Any help would be appreciated.
Use locate() to find the object.
In response to Garthor
By use locate() to find the object, do you mean simply place locate(/objhere) as the trigger? If I'm not mistaken, locate() simply returns a value of 1 upon finding the object, or 0 if it can't be found.
In response to Michael3131
locate() returns an actual object of that type, or if the args in locate() are a set of coordinates, will return the turf associated at that point.
In response to Feenux
If I define variable M to be locate(/obj/Test), then why am I unable to call M.loc for another variable?
In response to Michael3131
If you're defining M as var/M, M will not have a loc to be available. If you define it as var/atom/movable/M it will. You may want to read into syntax. If you want to use var/M you will have to use a ":" instead of a ".".
In response to Feenux
I think I see what you mean. It's working now too. ^_^

Thanks for your help.
In response to Michael3131
Glad I could help.

We're such a loving community :D