ID:155168
 
Hi all I know this might seem like a stupid noob question but here goes. I need to initiate the action in the same grid. Here is the code:

area

Entered()
src << ""
src << "<font color=blue><b>[name]</b></font>" //shows name of area
src << "<font color=blue><i>[desc]</i></font>" //shows desc of area
usr << "You see:"
for(var/O as obj|mob in oview())// <-- I need to find mob's in the same grid as me (It's a MUD)
usr << "\a [O]"
'src' in this case would be the area, so outputting to src isn't gonna do you any good. Using 'usr' in this case is also invalid, you should be using the argument that gets passed to Entered() to determine who is entering.
area
my_area
Entered(mob/M)
if(ismob(M) && M.client) // Makes sure it's actually a mob AND a player.
M << "You have entered [src.name]!"


As for the second part, since one /area can contain multiple turfs you'll have to loop over the turfs inside of the area, and then loop over the mobs inside of those turfs before outputting something to them.

for(var/turf/T in src)
for(var/mob/output_to in T)
output_to << "Some text"
In response to Nadrew
Thanks so much. I knew I was doing something wrong. Or a couple things in this case
In response to Nadrew
One other concern is how do I rule out the usr as one of the mobs in the turf?
In response to Saladon
if(usr == other_mob) continue
In response to Nadrew
thanks alot