ID:175645
 
client
Center()


var/mob/M = locate(/mob) in get_dir(usr,mob)


this doesnt work. I want it so it locates M in the space infront of the client that called the center verb. Can anyone help?
Anyone...help? Honorable mention will be given to you when I release my next lib/demo using this snippet.
ETG
You're using get_dir() when you should be using get_step(). Also, usr and mob are the same thing for client/Center() so that won't help you at all. Try this:

client/Center()
var/mob/M = locate() in get_step(mob,mob.dir) //Look at one space in front of you
if(M) //Make sure you actually find something
//Do stuff
In response to tenkuu
thanks alot, credits will be given where deserved
Erdrickthegreat2 wrote:
client
Center()
var/mob/M = locate(/mob) in get_dir(usr,mob)
this doesnt work. I want it so it locates M in the space infront of the client that called the center verb. Can anyone help?

You're using the wrong proc, which is why this isn't working for you. get_dir() will return a direction, not a location; and since usr and mob are the same in client/Center(), the direction between them will be 0. What you need is get_step(usr,usr.dir).

Lummox JR