ID:2612630
 
(See the best response by Nadrew.)
Code:
proc
Announce(var/message)
world << output("<font color=\"[usr.customfontcolor == null ? defaultfontcolor : usr.customfontcolor]\"[message]", "ChatWindow.Output1")


Problem description:
Is there a way to reference each mob's variables while outputting to world? This procedure is global incase of other things needing to announce. I want each person outputted to to have it show in their personal font color.

I imagine this is not it. Is it src perhaps? Is it even possible? Or will I need to convert all of my world outputs that are like this to for(var/mob/M in world) loops?
Best response
You'd want to pass the thing calling it as an argument in this case.

proc
Announce(atom/announcer,message)
if(ismob(announcer))
var/mob/player = announcer
world << "[announcer.name] announced [msg]!"
else
// Handle non-mobs using it here.
Specifically, I want it to show as the custom font color setting of each person recieving the message -- not the font color of the person sending it. Is that possible?

Edit: I also adjusted the original example because I realized I didn't need the 'announces, ' part of that.
In that case you'd need to loop over each player each time you send a message to them.

for(var/client/C)
var/mob/player_mob = C.mob
player_mob << "Your color is [player_mob.text_color]!"


Ideally you'd want to keep a small list of online players and loop over that when needed.

var/list/players = list()
mob/Login()
..()
players += src
mob/Logout()
players -= src
..()

for(var/mob/player in players)
// Do stuff
Gotcha! I thought that was the case -- thank you kindly. I just wasn't sure if when outputting to world like that, if there was a hidden variable, or if the output proc itself stored who exactly it was outputting to.