ID:158132
 
How would someone make it to where people who can't see invisible mobs unable to see what invisible people say in their say verb?
All can be done using variables, or by searching the path type and excluding it from a list. Depends how your invisible mob's work.
mob/verb/talk(msg as text)
world << "<B>[usr]</B>: [msg]"
if(usr.invisibility == 0)
world << " "

With this the message along with the user's name in bold comes to all people who aren't completely visible. To people who are completely visible is a blank space of nothing.

Edit:
mob/verb/talk(msg as text)
view() << "<B>[usr]</B>: [msg]"
if(src.invisibility == 0)
src << " "

There. The last one made it to where if the USER'S invisibility = 0 there message came out as nothing.
This one makes it to where if your completely visible you can't see messages.
In response to Speedro
An example, if you will. I'm terribly sorry, i'm very rusty. I haven't been on BYOND since I was 12. I am now 16.
viewers(src) << message
In response to Kokomo0020
Kokomo0020 wrote:
> mob/verb/talk(msg as text)
> world << "<B>[usr]</B>: [msg]"
> if(usr.invisibility == 0)
> world << " "
>

With this the message along with the user's name in bold comes to all people who aren't completely visible. To people who are completely visible is a blank space of nothing.

Edit:
> mob/verb/talk(msg as text)
> view() << "<B>[usr]</B>: [msg]"
> if(src.invisibility == 0)
> src << " "
>

There. The last one made it to where if the USER'S invisibility = 0 there message came out as nothing.
This one makes it to where if your completely visible you can't see messages.


mob/verb/talk(msg as text)
for(var/mob/M in range(world.view))
if(M.client)
if(M.see_invisible >= src.invisibility) M << "[src]: [msg]"
else M << "[src]: ..."

// Although... Garthors method is probably a "little" more simple.


This is probably what you meant.

The way you made it, the talker, and everyone in the talker's view, would first see the talker's message normally, and then, in case the talker has no invisibility at all, he alone would see an extra, blank message.

And you do realize that in a mob verbs like these, src == usr, do you?
In response to Nielz
I tried your method Nielz, and it makes the Mob repeat what it says, 2-3 times in a row. Help here?
In response to Xorbah
It does? That's odd. Ah well, you might as well go with Garthor's method: http://www.byond.com/developer/forum/?id=724212

That's basically the shortest and most simple way of sending a message to everyone who can see the talker.
In response to Nielz
No, you don't understand. I want to make a system to where if you're invisible, people who cannot see the invisible cannot hear you. If they can see you, the message appears. Otherwise, it doesn't. Also, I want to make it to where the invisible people can still see the visible people's messages.

                        usr.spamcheck()
for(var/mob/M in range(usr.view))
if(M.client)
if(M.see_invisible >= src.invisibility) view(usr,8) << "<b>\icon[usr.IMG]<font color='[usr.namecolor]'>[usr]:<font color='[usr.textcolor]'> [msg]"
else M << "You feel a slight breeze pass by..."


That's what I have so far.

EDIT: I don't think Garthor's Method will do that.
In response to Xorbah
Xorbah wrote:
No, you don't understand.

Have you considered taking thirty seconds to try my suggestion?
In response to Garthor
All your method says is Viewers (src) << Message. What is that supposed to mean?
In response to Xorbah
... did you even looked up what viewers() is in the DM Reference? (hint: it is related to view() but from a different perspective... heh, that was like a pun!)

Try it, it works as how you want it.
In response to GhostAnime
Where might I find the DM reference?
In response to Xorbah
Xorbah wrote:
No, you don't understand. I want to make a system to where if you're invisible, people who cannot see the invisible cannot hear you. If they can see you, the message appears. Otherwise, it doesn't. Also, I want to make it to where the invisible people can still see the visible people's messages.

I do understand, you're trying to make an effect in the like of "only ghosts can hear ghosts but the ghosts do hear the living", right? That's exactly what Garthor's tiny code snippet does. All you need to make sure is that the invisible person's see_invisible var is set to higher than their own invisibility var, so invisible people can still see themselves.

Look up the viewers() proc in the DM reference.

Anyway, you might want to go with this setting to make Garthors's method work the way you want.

invisible people:
set their invisibility var to 100
set their see_invisible var to 101

visible people:
set their invisibility var to 50
set their see_invisible var to 51


Using this invisibility/see_invisible setting, Garthor's method will do exactly what you want.
In response to Xorbah
In response to Nielz
Lol, this is gonna sound funny, but I pressed F1 and it brought up the Mozilla Firefox page.
In response to Xorbah
Hit F1 inside Dream Maker, silly, and if in any case you've overridden F1 by something else, "Help" -> "Help On..."
In response to Garthor
How in the world do I set it up? I've tried, yes, Garthor! But it still comes out as double messages.
In response to Xorbah
If it's coming out as double messages, then delete the code where you're sending one of those messages.
In response to Garthor
It's actually coming out as triple-quadruple. And double when there's only 2 mobs in view.

                    if(usr.spamcheck == TRUE)
usr << "<b>Please wait before talking again!"
return
else
usr.spamcheck()
for(var/mob/M in range(world.view))
if(M.client)
if(M.see_invisible <= src.invisibility) viewers(world.view,src) << "<b>\icon[usr.IMG]<font color='[usr.namecolor]'>[usr]:<font color='[usr.textcolor]'> [msg]"
else M << "You feel a slight breeze pass by..."
text2file("[time2text(world.realtime)]:[usr] says, [msg]<BR>","log.html")
Page: 1 2