I just want to know, would this work?
oview(3,usr&src) << "Hi!"
Or should it be something like this?
oview(3,usr&&src) << "Hi!"
I want to send a message out to everyone in view except for usr and src.
ID:179502
![]() Dec 15 2001, 8:09 am
|
|
Umm no, example:
mob/verb/Say(T as text) Get it? |
WizDragon wrote:
I want to send a message out to everyone in view except for usr and src. The & and && operators won't work for you here. & is bitwise AND, but does not mean the same as "this and that", and && is the AND operation for an if() or while() or something, and it means "if this and that are both true". Since oview() returns a list, what you want to do is subtract from the list, like this: (oview(3)-src) << "Hi!"
Now keep in mind oview() is from the perspective of usr unless you specify otherwise; hence usr isn't included in the list. If you want it to be within 3 units of src instead, use (oview(3,src)-usr). Lummox JR |
Nadrew wrote:
Using oview automaticly unincludes the person on the tile that's used from: This is not true. If two mobs stand on the same tile, oview(mob1) still includes mob2. |
Lord of Water wrote:
True. oview() == view() - src. Heh.. That would actually return false in BYOND. Lists only evaluate as equivolent if they are the SAME list object, not just lists with identical elements in an identical order. -AbyssDragon |
AbyssDragon wrote:
Lord of Water wrote: So what you're saying is FALSE == (oview() == view() - src) true? |
I sense another infinite recursion post!
|
Lord of Water wrote:
True. oview() == view() - src. False. oview() is the same as (view()-usr), unless you specify src as your object instead of usr. Lummox JR |
Lummox JR wrote:
Lord of Water wrote: Unless you put something in those parenthesis, you have specified src as the parameter to view()/oview(). |
Skysaw wrote:
Unless you put something in those parenthesis, you have specified src as the parameter to view()/oview(). Nope; according to the reference, these default to usr, not src. It's sort of counterintuitive, though; one would expect src to be the default. Lummox JR |
Lummox JR wrote:
Skysaw wrote: Well I'll be damned... you're right! Seems pretty inconsistant with the rest of the language. It's a good thing I usually am explicit anyway for safety. |
view() -- Everyone within view including the tile used from.
oview() -- Everyone within view except the tile it's used from.