mob/Basic/verb/Say()
set name="Say"
set desc="Talk to those on your screen."
var/list/L
L = list("<font","<B>","<I>","<U>","")
usr.overlays+='SpeachBubble.dmi'
var/msg=input("","Say") as text
for(var/H in L)
if(findtext(msg,H))
usr.overlays-='SpeachBubble.dmi'; return
usr.overlays-='SpeachBubble.dmi'
if(msg)
for(var/mob/player/v in view(usr))
v<<output("[usr] says: [msg]","Chat")
The above code makes nothing appear.
mob/Basic/verb/Say()
set name="Say"
set desc="Talk to those on your screen."
var/list/L
L = list("<font","<B>","<I>","<U>","")
usr.overlays+='SpeachBubble.dmi'
var/msg=input("","Say") as text
for(var/H in L)
if(findtext(msg,H))
usr.overlays-='SpeachBubble.dmi'; return
else
usr.overlays-='SpeachBubble.dmi'
if(msg)
for(var/mob/player/v in view(usr))
v<<output("[usr] says: [msg]","Chat")
return //<----Without that, the message is repeated for each of the vars in the list: L
//with the 'return', it only displays a message on the usr's screen.
Problem description:
The version where 4 messages appear (one for each of the list entries) worked perfectly before I used the output() proc.
My converted OOC still works fine, I'm guessing because it defines the message in the verbs title - but I want a speech bubble to appear while the person is using Say...
Also, it might be notable that the following doesn't need to be done in two lines.
Also, you can use the output operator (the << operator) on a list instead of looping through the list and using it on each thing in the list. Example: