In response to Lummox JR
Lummox JR wrote:
Malver wrote:
I need the syntax to assign any mob on a turf (let's call it <code>m</code>) a variable.

You said you got this working, but for future reference I'll answer it, since no one else on this thread even came close. (What were you people thinking, anyway? Vicious, I implore you never to try to help anyone with DM again.)
While maybe you could have been a little clearer, I think you were plenty clear enough. For a specific turf, you want to find the mob that's on it (if there is one) and assign a value to a var belonging to that mob.

There are two ways to do this, and they depend on whether or not you want to account for the special rare case (which could be caused by a bug) of two mobs occupying the same turf. The first, simplest method:
var/mob/M = locate(/mob) in T   // T is your turf
> if(M) M.myvar = 6

This will find the first mob, if any, in T.contents. Another way to do this is to loop through the contents:
for(var/mob/M in T)
> M.myvar = 6
> // put a break here if you only want to touch the first mob

Lummox JR

As stated I got everything in working order last night. Either way, glad someone here understands english. ;)

Thanks yap.
Page: 1 2