ID:149694
 
but... I still couldn't find help on this. I want it so that you can only pass a ball to someone if they are look at you. I know it probably has something to do with get_step and get_dir but I can't figure it out, can anyone help me or point me in the direction of a demo/tutorial/library?

and in order to make it so that certain mobs cant go past a certain point would I have to create an area, then set the areas density to 1 if the mob istype(type)?
What do you mean? Only if they are looking at you?

You COULD do it this way, but its kinda messy.

You could check to see if the mob you are passing to, is facing the opposite direction of you. like if(usr.dir == NORTH && M.dir == SOUTH) or something like that. Thats the only way i can think of.

As for the area, just have it non dense, and put something like this under it:
Enter()
if(istype(src,/mob))
return 0
else
..()


hope i helped

-Rcet
Quick answer:
for(var/mob/M as mob in oview([how far the guy can throw the ball]))
if(src.dir == get_dir(src,M)) //If the direction of the thrower (src) to the catcher (M) is the same as src's direction...
PassTheBallToTheNextPerson() //do this

The get_dir proc returns the direction of the first thing's position to the second thing's position, thus a get_dir(M,X) proc would return southeast:
    M
\
\
\
X

because the direction of M to X is southwest. Get it?
In response to WizDragon
thanks that is exactly what I wanted. If I ever become king of a small country I will knight you for your brave and valiant service to me.
In response to Rcet
thanks that entered thing works my way didnt.