i want my 'say' verb to message people different things,depending on their distance...
here's what i got so far:
mob/verb/Say(msg as text) // Say command, say to somone in your range.
set category = "Social"
var/mob/M
for (M as mob in view(6))
M << "\icon[usr][usr] Says, [msg]"
for (M as mob in view(10))
M << "Someone Says, [msg]"
it all works fine,except...
it happens TWICE O_o;
(yes,it's lightly based on a demo ^_^ RaeKwon's to be exact ~_~; )
ID:148907
Aug 19 2002, 3:22 pm
|
|
In response to Air Mapster
|
|
thanks ~_~;
and i knew dat,i just didnt know how to get around it -_-; |
That's because everyone who is in view(6) is also in view(10) (in other words, everyone who is less than 6 spaces away is obviously also less than 10 spaces away). Therefore they see the results of both for loops. So in the second for loop, what you really want to do is loop over people who are in view(10) but not in view(6). You could change it to loop over view(10) - view(6), but that's slightly inefficient because BYOND would have to calculate view(6) a second time. Even better, just store both views as list variables. What you could do is something like this: