New In-Experience Text Chat System Public Release!

To make your own GUI, you can set ChatWindowConfiguration.Enabled and ChatInputBarConfiguration.Enabled to false in Studio:

Then you can create your own text box to send messages:

local textBox: TextBox = createTextBox()
local chatInputBarConfiguration: ChatInputBarConfiguration = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration")

textBox.FocusLost:Connect(function(wasEnterPressed: boolean)
    local targetChannel = chatInputBarConfiguration.TargetTextChannel
    if targetChannel then
        targetChannel:SendAsync(textBox.Text)
    end
end)

Rendering messages takes a little more work, but you can do that by listening to events like in this pseudo-code:

local chatWindow: Frame = createChatWindow()

TextChatService.MessageReceived:Connect(function(textChatMessage: TextChatMessage)
    renderTextLabel(chatWindow, textChatMessage)
end)

12 Likes

I have a VIP game pass for my game but with the new text chat the tag does not work so how do I make the chat tag work?

1 Like

For help with something specific like this, feel free to ping me in a new thread in the Help and Feedback section since there will likely have to be some back-and-forth with this request!

5 Likes

It would be useful if TextChatCommands could be nested further than one descendant level down, so we could structure our commands like this

TextChatCommands
  AdminSystem
    Fun
      Zombie
      Noobify
    Administration
      Kick
      Ban
    Misc
      Version

currently, this wont work

12 Likes

Insanely awesome update - I love that Roblox is getting away from forking default scripts and instead allowing for seamless integration. This is a great display of futureproofing, and I’m really excited to see the subsequent updates to this. This provides a really cool flexibility that actually makes subsequent updates (hopefully) roll as “new features/developer options for the chat system” versus “global chat system changes”.

Here’s hoping the Animate script gets some love soon :slight_smile:

13 Likes

https://devforum.roblox.com/t/how-to-add-chat-tags-for-the-new-roblox-text-chat-service/1848913?u=charlie_april20

1 Like

What would be the best way of doing a ‘local’ channel? i.e for like a 20 stud radius, what’s the best way to utilize the channel with the new service?

1 Like

This update is really nice and I was able to update my public script accordingly without any issues. However, it is still annoying there is no ability to hide a message until I have fully “processed” it as a developer.

Under recommendation from @be_nj in this reply to my controller, I store everything required, such as prefix, name color, and so on, as an attribute to the player. In my script, all I do is read this attribute as a script, as with in this code snippet:

function PlayerMessageHandler:Success(message, properties)
	local player: Player = Players:GetPlayerByUserId(message.TextSource.UserId)
	if not Util.AssignmentOptions:CheckIsPlayerValid(player) then
		return properties
	end

	local prefixText = player:GetAttribute("ChatData_PrefixText")
	local prefixColor = player:GetAttribute("ChatData_PrefixColor")
	local nameColor = player:GetAttribute("ChatData_NameColor")
	local chatColor = player:GetAttribute("ChatData_ChatColor")

	properties.PrefixText = string.format(
		Configuration.PlayerMessage.NameFormat,
		message.PrefixText
	)

	if typeof(nameColor) == "string" then
		properties.PrefixText = string.format(
			Configuration.PlayerMessage.NameColorFormat,
			nameColor,
			properties.PrefixText
		)
	end

	if typeof(prefixText) == "string" and typeof(prefixColor) == "string" then
		properties.PrefixText = string.format(
			Configuration.PlayerMessage.PrefixFormat,
			prefixColor,
			prefixText,
			properties.PrefixText
		)
	end

	if typeof(chatColor) == "string" then
		properties.Text = string.format(
			Configuration.PlayerMessage.TextFormat,
			chatColor,
			message.Text
		)
	end

	return properties
end

The line Util.AssignmentOptions:CheckIsPlayerValid(player) does not yield as this is all it is:

function AssignmentOptions:CheckIsPlayerValid(player: Player)
	return typeof(player) == "Instance" and player:IsDescendantOf(Players)
end

The “delay” can still be seen in this video (ignore the music, I didn’t feel like muting it okay). Edit: The delay is no longer visible thanks to a bug being pointed out by @be_nj in this reply.

Are there any plans to add the ability to hide a message? Since it’s a UIListLayout, even the ability to make the TextLabel.Visible to false would be nice, however, we don’t even have that small amount of control.

5 Likes

It sounds like both of these ideas are converging on the same thought! Being able to hide particular messages with the default UI is something we are considering through the TextChatMessageProperties API.

Right now there is not a way to hide messages within the default UI. Of course you can decide to hide or filter messages based on proximity or TextChatMessageStatus with a custom UI but we’d like to enable this in the default case as well.

9 Likes

How do channels work? When this was in beta I could not see a way to have elective always-available channels that players could switch between on the fly (e.g. general versus roleplay-specific chat) because there was no documentation. Still cannot find anything of the sort. Was this feature dropped? I guess I can allow players to form chat groups (custom channels), but there’s no nice way to present this within the UI of the chat window, or to allow them to swap channels in a self-contained way. If there is I couldn’t figure it out.

Also it seems there’s no way to let players resize this chat? This is important in my game because roleplay involves a lot of chat history.

7 Likes

It’s great to see the new in-experience text chat system and new UI looks much better and the fact you get more customization with it. Good job and well done to everyone who worked on this new in-experience text chat system. I will definitely find some time to check out the documentation. Thank you for this release! :purple_heart:

4 Likes

Bug Report:

It appears I have the chat closed, but I can still hover over the area or chat icon:
image

When you double click to re-open the chat and close it, the normal behavior appears.

Also, it appears that ZIndex on a ScreenGui is not respected like the chat like the old one:

New Chat:

Old Chat:

I will not be opting in until these are fixed.

But other than that, really excited that this is now public! The chat has needed an overhaul to match the topper for 2 years.

8 Likes

Currently the default UI will only send messages to TextChannels based on what is currently ChatInputBarConfiguration’s TargetTextChannel property. Developers can write to this property to change where users messages go.

For example, you could create a custom TextChatCommand to switch to a different channel by overwriting this property. These chat use cases are more complex and we are still researching the best ways to support these flows in the long term. Do you have a link to a game that features heavy channel switching? We can use it as a case study to see how users are used to channel switching like this!

3 Likes

While I suspect a large amount of users actually use whisper chat for roleplay between two people, for larger groups you can sometimes find users in servers using the roleplay channel for their roleplay business. I think you’ll have a hard time finding that needle in a haystack in my game because it’s relatively small and I’m still working on roleplay capabilities, but it does happen from time to time and I do foresee it increasing as I improve the state of affairs. Be an Alien: Renewal - Roblox

A better solution for my needs would be a tidy way to let players have shared whisper chats, but as it stands the new chat doesn’t really make it possible to have a cohesive interface for all this (can’t even switch channels within the chat window…), so it would be a downgrade.

I don’t remember if this chat supports whisper yet either?

5 Likes

This chat supports whisper chat. It should be pretty identical to before. Would a group whisper chat feature be something that would solve some of your needs out of the box?

We’re also interested in opening up some basic hooks into the default UI to help facilitate more complicated use cases.

5 Likes

A group whisper would mostly eliminate my need for roleplay chat. It would make it harder for people to join roleplays on the fly but I think players can work it out. Not sure the details of how it would work with respect to joining/leaving/managing a group chat though.

UI hooks would be amazing. I would like to add an expand button if there is no resize functionality so players can make the chat larger vertically up to some limit. Channel tabs are also sorely missed, especially if there will be group chats. Switching would be a pain if you needed to use an external button or command all the time.

6 Likes

Dannnnnnnnnnnnnnnnnnnnnnng, this chat UI looks amazing. Finally, they did something good for ONCE.

3 Likes

Looks great! I am wondering how you would send a “system” message though?

StarterGui:SetCore(
    "ChatMakeSystemMessage",           
    {Text = "MESSAGE"}
)

Works for the legacy chat system, but not the new text system (doesn’t send anything, nor does it error).

5 Likes

To send a system message, you can use TextChannel:DisplaySystemMessage(message) instead.
If youre using the default text channels, you can reuse the RBXSystem channel for this:

local systemChannel = TextChatService:FindFirstChild("RBXSystem", true)
if systemChannel then
    systemChannel:DisplaySystemMessage("MESSAGE")
end

but in reality, any TextChannel – even one you created manually – should work as long as there are TextSources listening to it.

9 Likes

How did you add the “Owner” tag? I am looking through the documentation, but I am not sure how it works.

2 Likes