ID:270925
 
for example:
mob/verb/Face(mob/M in oview(8)) //Just to test
usr.dir = ?

How can i make it so i face the mob.
Not move.
Example:
If i'm faceing East, there to my west and i use this. i'll turn west toards them. literally faceing them?
Used for anny direction. I want to face the mob.
How can i do it?
You can do this by using get_dir() to find the direction from one object to another. You can set the player's direction to whatever get_dir(your_player, your_destination) returns.

mob/verb/Face(mob/M in oview(8))
src.dir = get_dir(src, M)


However, if you want to have a more 'accurate' direction (since get_dir() returns diagonals whenever it can), then you can look at Lummox JR's implementation of a get_approx_dir() function, which will return a more 'realistic' direction. ([link])
In response to Unknown Person
thanks