ID:857533
 
(See the best response by Nadrew.)
Is it possible?

like say i wanto get a list of mobs west of the character.
Yes, it's possible.

If you wanted to know how you would go about doing so, you could use block() and a for() loop to find the mobs, if you just want every mob to a certain direction, you just replace block() with world and check the x, y, and z vars to see if they're in the appropriate direction.

A quick example:

for(var/mob/m in block( locate( x, y - vertical distance/2, z ), locate( x + horizontal distance, y + vertical distance/2, z) )) 
moblist += m


This would return a list of mobs to the east of the character, the distance would depend on the vertical/horizontal distance values.
Best response
That would return a list of turfs, you'd have to loop over those turfs in a second loop to get the mobs within them.
when i replace block with world i get that it is a bad proc T.T and also Nadrew how would i do that?
In response to Nadrew
Nadrew wrote:
That would return a list of turfs, you'd have to loop over those turfs in a second loop to get the mobs within them.

Herp derp. Of course. I always make that mistake.

@goku

You would just change var/mob/m to var/turf/t and then use for(var/mob/m in t.contents) moblist += m

That way you're checking the contents of each turf in block().
Hmm

                    for(var/turf/T in block( locate( user.x, user.y - 375/2, user.z ), locate( user.x + 375, user.y + 375/2, user.z) ))
user << T.text


So far.. this is not even returning a list of turfs for me..
Nevermind I figured it all out thanks guys.