In my modded server, which runs the Multi Team Support mod, I provide a Global chat vs Team chat toggle.
It looks like this:
In global mode, chat messages are sent to all teams, and in team mode they are sent only to players on your own team.
The biggest issue I'm facing is that when in team-only chat mode, I'm not able to intercept the chat messages before they are printed to the screen by the Factorio engine. Instead of a chat message like:
bits-orio: Lets do trains.
I need it to be tagged as global or team:
bits-orio [Global]: Lets do trains.
OR
bits-orio [Team]: Lets do trains.
That way it's easier for players to get a visual reinforcement of which chat mode they're currently in. Right now, since there's no indication, it's easy for a player to be in team-only chat mode by accident and forget to check the toggle at the top of their screen. Then, 5-6 minutes of active chatting later, they realize the reason other teams aren't responding is that they've been accidentally sending messages to their own team only.
I do know that /shout and /s exist, but that's not desired. I would like chat to be tagged as global or team.
So I'd like to request improvements to the modding API related to chat. What am I proposing? I'm proposing the inclusion of an optional tag whose content and color can be mod-controlled. The content would usually be just one word under 10 characters, or it could even be a single game icon. For example, I could use the G signal letter for Global and the T signal letter for Team.
Chat API request: Ability to add a colored tag/prefix to player chat messages before render
Re: Chat API request: Ability to add a colored tag/prefix to player chat messages before render
Alternately an open ended api that allows modders to modify how the chat message appears on screens however they want to organize it.
That way Factorio devs just have to provide a pre-chat event in which modder can get chat message, and return back (or set somewhere) a different chat message.
That way Factorio devs just have to provide a pre-chat event in which modder can get chat message, and return back (or set somewhere) a different chat message.
Re: Chat API request: Ability to add a colored tag/prefix to player chat messages before render
Bump, hoping this gets picked.
Exposing a pre-chat event handler API sounds like a low hanging fruit. Improvement in modding capabilities will be huge when it comes to customized chat interfaces.
Exposing a pre-chat event handler API sounds like a low hanging fruit. Improvement in modding capabilities will be huge when it comes to customized chat interfaces.
Re: Chat API request: Ability to add a colored tag/prefix to player chat messages before render
The *tag* part is already part of the api: https://lua-api.factorio.com/latest/cla ... r.html#tag
Since it's just a string, you can use rich text to make it colored
I do still want some way to intercept and modify chat messages so I can prefix things like a timestamp on all messages, and generally change the formatting, but the request this post is about is already something you can do.
Since it's just a string, you can use rich text to make it colored
I do still want some way to intercept and modify chat messages so I can prefix things like a timestamp on all messages, and generally change the formatting, but the request this post is about is already something you can do.
Re: Chat API request: Ability to add a colored tag/prefix to player chat messages before render
Oh right, I could piggy back on Player tags. I will try that, thanks for sharing PennyJim.PennyJim wrote: Thu Aug 13, 2026 10:41 pm The *tag* part is already part of the api: https://lua-api.factorio.com/latest/cla ... r.html#tag
Since it's just a string, you can use rich text to make it colored
I do still want some way to intercept and modify chat messages so I can prefix things like a timestamp on all messages, and generally change the formatting, but the request this post is about is already something you can do.
But yes, overall a pre-chat event handler would be nice too for future of factorio modding.

