ID:179502
 
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.
Using oview automaticly unincludes the person on the tile that's used from:

view() -- Everyone within view including the tile used from.

oview() -- Everyone within view except the tile it's used from.
In response to Nadrew
So,
oview(3,usr&src) << "Hi!"
would give a message to everyone 3 steps away from usr or src?
In response to WizDragon
Umm no, example:

mob/verb/Say(T as text)
oview(4)<<"[usr] says: [T]"//Outputs T to anyone within 4 tiles of the user but not the user him/herself.
usr<<"You said [T]"//Outputs to the user only


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
In response to Nadrew
Nadrew wrote:
Using oview automaticly unincludes the person on the tile that's used from:

view() -- Everyone within view including the tile used from.

oview() -- Everyone within view except the tile it's used from.

This is not true. If two mobs stand on the same tile, oview(mob1) still includes mob2.
In response to Nadrew
Yes, thank you.
In response to Lummox JR
Thanks!
In response to Skysaw
True. oview() == view() - src.
In response to Lord of Water
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
In response to AbyssDragon
AbyssDragon wrote:
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

So what you're saying is FALSE == (oview() == view() - src)

true?
In response to Skysaw
Right. TRUE == (FALSE == (oview() == view() - src))

-AbyssDragon
In response to AbyssDragon
I sense another infinite recursion post!
In response to Lord of Water
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
In response to Lummox JR
Lummox JR wrote:
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

Unless you put something in those parenthesis, you have specified src as the parameter to view()/oview().
In response to Skysaw
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
In response to Lummox JR
Lummox JR wrote:
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

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.