ID:170217
 
area/loc1

Is it possible to do something like this: for(var/mob/m in loc1)world<<m

I was wondering if it's possible to check if there are people in a certain area and to have it display their name.
Looping through all mobs in the area would work, I think.
Zaltron wrote:
area/loc1

Is it possible to do something like this: for(var/mob/m in loc1)world<<m

I was wondering if it's possible to check if there are people in a certain area and to have it display their name.

Well, you wouldn't really be able to do it like that, you'd have to check its contents (turfs) and see if the turfs have mobs in their contents. And, for the for() loop, I'm not sure you can single out a single area by using types like that unless defined under var. But, what you could do I guess is use associative lists, individual variables, or tags.
In response to Teh Governator
Teh Governator wrote:
Well, you wouldn't really be able to do it like that, you'd have to check its contents (turfs) and see if the turfs have mobs in their contents.

Area/contents works slightly differently from other contents lists. It has every turf within the area, as well as all the movable atoms that are in those turfs.