Skip to content

Commit ae84230

Browse files
update Open Source Docs from Roblox internal teams
1 parent 48933cd commit ae84230

File tree

16 files changed

+810
-237
lines changed

16 files changed

+810
-237
lines changed

content/common/navigation/engine/guides.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,23 @@ navigation:
439439
path: /chat/in-experience-text-chat
440440
- title: Guidelines
441441
path: /chat/guidelines
442-
- title: Customization
443-
path: /chat/customizing-in-experience-text-chat
442+
- title: Chat Window
443+
path: /chat/chat-window
444444
- title: Bubble Chat
445445
path: /chat/bubble-chat
446+
- title: Examples
447+
path: /chat/examples/simple-custom-frontend-ui
448+
section:
449+
- title: Custom UI
450+
path: /chat/examples/simple-custom-frontend-ui
451+
#- title: Custom System Messages
452+
# path: /chat/examples/custom-system-messages
453+
- title: Chat Tags
454+
path: /chat/examples/group-chat-tags
455+
- title: Proximity Chat
456+
path: /chat/examples/proximity-chat
457+
- title: Custom Chat Commands
458+
path: /chat/examples/custom-text-chat-commands
446459
- title: Legacy Chat System
447460
path: /chat/legacy/legacy-chat-system
448461
- title: Performance Optimization
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

content/en-us/chat/bubble-chat.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Bubble Chat
2+
title: Customizing Bubble Chat
33
description: The text chat system allows users to communicate and socialize with each other.
44
---
55

6-
With the [in-experience text chat](../chat/in-experience-text-chat.md) system, you can support **bubble chat** to display customizable speech chat bubbles above user avatars and NPCs. Bubble chat can make your experience more visually immersive and help users easily identify messages and their speakers in a contextually relevant manner. This feature is especially useful for experiences where users need to focus on the content in the meantime communicating with others in a less obtrusive way.
6+
With [TextChatService](../chat/in-experience-text-chat.md), you can use **bubble chat** to display customizable speech chat bubbles above user avatars and NPCs. Bubble chat can make your experience more visually immersive and help users easily identify messages and their speakers in a contextually relevant manner. This feature is especially useful for experiences where users need to focus on the content in the meantime communicating with others in a less obtrusive way.
77

88
<video src="../assets/players/in-experience-text-chat/Player-Conversation-Bubbles.mp4" controls width="100%"></video>
99

@@ -25,7 +25,7 @@ After enabling bubble chat, you can customize the appearance and behavior of you
2525

2626
<img src="../assets/players/in-experience-text-chat/TextChatService-BubbleChatConfiguration.png" width="320" />
2727

28-
Alternatively, you can add a `Class.LocalScript` in `Class.StarterPlayerScripts` with all your customization settings. This allows the engine to apply your customizations during runtime, overriding the settings in Studio. It's useful for adding special effects to chat bubbles when users trigger certain events or conditions.
28+
Alternatively, add a `Class.LocalScript` in `Class.StarterPlayerScripts` with all your customization settings. This allows the engine to apply your customizations during runtime, overriding the settings in Studio. It's useful for adding special effects to chat bubbles when users trigger certain events or conditions.
2929

3030
### Basic Customization
3131

@@ -323,7 +323,7 @@ The following tables outline the available `Class.GuiObject` and [appearance mod
323323

324324
## Per-Bubble Customization
325325

326-
You can individually style and modify chat bubble behaviors based on specific conditions that overrides your general settings. For example, you can use chat bubbles to differentiate NPCs and users, highlight critical health status, and apply special effects to messages with pre-defined keywords.
326+
You can individually style and modify chat bubble behaviors based on specific conditions in order to override your general settings. For example, you can use chat bubbles to differentiate NPCs and users, highlight critical health status, and apply special effects to messages with pre-defined keywords.
327327

328328
To set per-bubble customization, add a client-side `Class.LocalScript` using `Class.BubbleChatMessageProperties`, which overrides matching properties of `Class.BubbleChatConfiguration`, and the `Class.TextChatService.OnBubbleAdded` callback to specify how to customize each bubble. The callback supplies you with the `Class.TextChatMessage` property as well as the adornee, so you can apply the customization based on attributes associated with users, the chat text content, user character properties, and any special conditions you want to define.
329329

@@ -435,9 +435,15 @@ end
435435

436436
<video src="../assets/players/in-experience-text-chat/Low-Health-Bubble.mp4" controls width="90%"></video>
437437

438-
## NPC Bubbles
438+
## Manually Displaying Bubbles
439439

440-
You can display chat bubbles for non-player characters (NPCs) by calling `Class.TextChatService:DisplayBubble()`, with the NPC character and the message as parameters. These bubbles are customizable using the `Class.TextChatService.OnBubbleAdded` callback just like any other chat bubble.
440+
You might want to display a chat bubble when players haven't sent a message, such as with NPCs. Use the `Class.TextChatService:DisplayBubble` method to manually display a chat bubble.
441+
442+
Customization of these bubbles is the same as the customization of the bubbles that are automatically displayed when Players send messages through TextChannels using the [`Class.TextChatService.OnBubbleAdded` callback](#per-bubble-customization).
443+
444+
### NPC Bubbles
445+
446+
Display chat bubbles for non-player characters (NPCs) by calling `Class.TextChatService:DisplayBubble(character, message)`, with the NPC character and the message as parameters. These bubbles are customizable using the `Class.TextChatService.OnBubbleAdded` callback just like any other chat bubble.
441447

442448
`Class.TextChatService:DisplayBubble()` only works on client-side scripts, so be sure to use a `Class.Script` with `Class.BaseScript.RunContext|RunContext` set to `Enum.RunContext.Client`, or a `Class.LocalScript` in an [appropriate container](/projects/data-model#client), such as `Class.StarterPlayerScripts`. If you attach a `Class.ProximityPrompt` to an NPC, a script for displaying a chat bubble might look like this:
443449

content/en-us/chat/customizing-in-experience-text-chat.md renamed to content/en-us/chat/chat-window.md

Lines changed: 154 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Customizing Text Chat
2+
title: Customizing the Chat Window
33
description: Customize the chat window and message UI of your in-experience text chat.
44
---
55

@@ -11,16 +11,16 @@ The overall chat window consists of the **chat window**, an **input bar**, and o
1111

1212
<img src="../assets/players/in-experience-text-chat/Chat-Window-Components.jpg" width="800" alt="Core components of the text chat window." />
1313

14-
The channel tabs are disabled by default and each component can be toggled on/off in Studio or through scripting:
14+
The channel tabs are disabled by default and each component can be toggled on and off in Studio or through scripting:
1515

1616
<Tabs>
1717
<TabItem label="Studio">
18-
Directly in Studio's [Explorer](../studio/explorer.md) window, expand the `Class.TextChatService` branch and select `Class.ChatWindowConfiguration`, `Class.ChatInputBarConfiguration`, or `Class.ChannelTabsConfiguration`. Then, in the [Properties](../studio/properties.md) window, enable or disable the component.
18+
In the [Explorer](../studio/explorer.md) window, expand the `Class.TextChatService` branch and select `Class.ChatWindowConfiguration`, `Class.ChatInputBarConfiguration`, or `Class.ChannelTabsConfiguration`. Then enable or disable the component in the [Properties](../studio/properties.md) window.
1919

2020
<img src="../assets/players/in-experience-text-chat/TextChatService-Configuration-Objects.png" width="760" />
2121
</TabItem>
2222
<TabItem label="Scripting">
23-
In a client script within `Class.StarterPlayerScripts`, enable each component as desired:
23+
From a client script within `Class.StarterPlayerScripts`, enable each component as desired:
2424

2525
```lua title='Client Script'
2626
local TextChatService = game:GetService("TextChatService")
@@ -46,7 +46,7 @@ end
4646
</TabItem>
4747
</Tabs>
4848

49-
When `Class.ChannelTabsConfiguration` is enabled, each **default** `Class.TextChannel` will appear in a tab as outlined in the following table. In addition, each **custom** `Class.TextChannel` will create a tab corresponding to the channel's `Class.Instance.Name|Name` property.
49+
When `Class.ChannelTabsConfiguration` is enabled, each **default** `Class.TextChannel` appears in a tab as outlined in the following table. In addition, each **custom** `Class.TextChannel` creates a tab corresponding to the channel's `Class.Instance.Name|Name` property.
5050

5151
<table size="small">
5252
<thead>
@@ -70,7 +70,7 @@ When `Class.ChannelTabsConfiguration` is enabled, each **default** `Class.TextCh
7070
</tr>
7171
<tr>
7272
<td>**RBXWhisper**</td>
73-
<td>User name of other player</td>
73+
<td>User name of the other player</td>
7474
</tr>
7575
</tbody>
7676
</table>
@@ -284,7 +284,7 @@ Appearance of the **channel tabs** is customizable through `Class.ChannelTabsCon
284284
You can customize the appearance of chat message bodies and prefixes using `Class.ChatWindowMessageProperties` and `Class.TextChatService.OnChatWindowAdded` callbacks without overriding the existing UI. The customization options let you modify the appearance of chat messages to match your experience's theme, and you can also sort or highlight messages from different user groups by adding chat tags and coloring prefixes.
285285

286286
<Alert severity="info">
287-
`Class.ChatWindowMessageProperties` and `Class.TextChatService.OnChatWindowAdded|OnChatWindowAdded` will only affect the appearance of messages in the chat window. To customize chat bubbles, see [Bubble Chat](../chat/bubble-chat.md).
287+
`Class.ChatWindowMessageProperties` and `Class.TextChatService.OnChatWindowAdded|OnChatWindowAdded` only affect the appearance of messages in the chat window. To customize chat bubbles, see [Bubble Chat](../chat/bubble-chat.md).
288288
</Alert>
289289

290290
### Coloring User Names
@@ -415,11 +415,11 @@ end
415415

416416
## Sending Messages from Non‑Player Sources
417417

418-
In certain design scenarios, you may want to show non‑player dialogue in the chat window, such as "speech" from a public address system or a non‑player character.
418+
Sometimes, you might want to show non‑player dialogue in the chat window, such as "speech" from a public address system or a non‑player character.
419419

420420
### System
421421

422-
To deliver an unstyled system message to the local player, simply call `Class.TextChannel:DisplaySystemMessage()|DisplaySystemMessage()` from the default **RBXGeneral** channel with a prefix before the player's display name.
422+
To deliver a system message to the local player, call `Class.TextChannel:DisplaySystemMessage()|DisplaySystemMessage()` from the default **RBXGeneral** channel with a prefix before the player's display name.
423423

424424
```lua title='Client Script'
425425
local Players = game:GetService("Players")
@@ -436,6 +436,151 @@ generalChannel:DisplaySystemMessage(PREFIX .. player.DisplayName)
436436

437437
<img src="../assets/players/in-experience-text-chat/Chat-System.jpg" width="800" alt="Image showing a basic system message in the chat window." />
438438

439+
For a more detailed guide on how to customize the appearance of system messages, see [Customizing System Messages](./examples/custom-system-messages.md).
440+
441+
#### Default System Messages
442+
443+
When `Class.TextChatService.CreateDefaultTextChannels` is true, one of the default text channels is the **RBXSystem** channel. The default chat scripts automatically display system messages in this channel. You can customize the appearance of these messages using the `Class.TextChannel.OnIncomingMessage` callback.
444+
445+
You might want to customize or alter the system messages that are automatically emitted by the chat system. Since the default system messages are localized for users, you should reference them by `TextChatMessage.Metadata` in your [text chat callbacks](../chat/in-experience-text-chat.md#text-chat-hooks-and-callbacks) if you wish to customize their appearance.
446+
447+
Below is a reference of the default system messages that are emitted by the chat system:
448+
449+
<table>
450+
<thead>
451+
<tr>
452+
<th>Metadata</th>
453+
<th>Description</th>
454+
</tr>
455+
</thead>
456+
<tbody>
457+
<tr>
458+
<td><b>Roblox.ChatTranslation.ChatWindow.SystemMessage</b></td>
459+
<td>Indicates that the system may translate chat messages for the Player</td>
460+
</tr>
461+
<tr>
462+
<td><b>Roblox.Notification.Friend.Joined</b></td>
463+
<td>Displayed when one of the Player's friends join the experience</td>
464+
</tr>
465+
<tr>
466+
<td><b>Roblox.MessageStatus.Warning.Floodchecked</b></td>
467+
<td>Displayed when the Player's sent TextChatMessage was rate limited by the Server</td>
468+
</tr>
469+
<tr>
470+
<td><b>Roblox.MessageStatus.Warning.TextFilterFailed</b></td>
471+
<td>Displayed when the Player's sent TextChatMessage could not be displayed due to a Text Filter issue</td>
472+
</tr>
473+
<tr>
474+
<td><b>Roblox.MessageStatus.Warning.InvalidPrivacySettings</b></td>
475+
<td>Displayed when the Player's privacy settings prevent them from sending a TextChatMessage</td>
476+
</tr>
477+
<tr>
478+
<td><b>Roblox.MessageStatus.Warning.MessageTooLong</b></td>
479+
<td>Displayed when the Player sends a TextChatMessage with content that is too long</td>
480+
</tr>
481+
<tr>
482+
<td><b>Roblox.MessageStatus.Warning.Unknown</b></td>
483+
<td>Displays when the system fails to send the Player's TextChatMessage for an unknown reason</td>
484+
</tr>
485+
<tr>
486+
<td><b>Roblox.Help.Info</b></td>
487+
<td>Displays the response from the RBXHelpCommand TextChatCommand</td>
488+
</tr>
489+
<tr>
490+
<td><b>Roblox.Version.Info</b></td>
491+
<td>Displays the response from the RBXVersionCommand TextChatCommand</td>
492+
</tr>
493+
<tr>
494+
<td><b>Roblox.Team.Success.NowInTeam</b></td>
495+
<td>Displayed when the Player's team changes</td>
496+
</tr>
497+
<tr>
498+
<td><b>Roblox.Team.Error.CannotTeamChatIfNotInTeam</b></td>
499+
<td>Displayed when the Player triggers the RBXTeamCommand TextChatCommand without being on a `Class.Team`</td>
500+
</tr>
501+
<tr>
502+
<td><b>Roblox.Whisper.Info.Success</b></td>
503+
<td>Displayed when the Player successfully starts a Whisper conversation</td>
504+
</tr>
505+
<tr>
506+
<td><b>Roblox.Whisper.Welcome.Sent</b></td>
507+
<td>Displayed when entering a Whisper TextChannel</td>
508+
</tr>
509+
<tr>
510+
<td><b>Roblox.Whisper.Error.CannotWhisperToSelf</b></td>
511+
<td>An error response from the RBXWhisperCommand TextChatCommand</td>
512+
</tr>
513+
<tr>
514+
<td><b>Roblox.Whisper.Error.TargetDoesNotExist</b></td>
515+
<td>An error response from the RBXWhisperCommand TextChatCommand</td>
516+
</tr>
517+
<tr>
518+
<td><b>Roblox.Whisper.Error.TooManyMatches</b></td>
519+
<td>An error response from the RBXWhisperCommand TextChatCommand</td>
520+
</tr>
521+
<tr>
522+
<td><b>Roblox.Whisper.Error.Unknown</b></td>
523+
<td>An error response from the RBXWhisperCommand TextChatCommand</td>
524+
</tr>
525+
<tr>
526+
<td><b>Roblox.Emote.Error.DoesNotExist</b></td>
527+
<td>An error response from the RBXEmoteCommand TextChatCommand</td>
528+
</tr>
529+
<tr>
530+
<td><b>Roblox.Emote.Error.UserEmotesNotEnabled</b></td>
531+
<td>An error response from the RBXEmoteCommand TextChatCommand</td>
532+
</tr>
533+
<tr>
534+
<td><b>Roblox.Emote.Error.TemporarilyUnavailable</b></td>
535+
<td>An error response from the RBXEmoteCommand TextChatCommand</td>
536+
</tr>
537+
<tr>
538+
<td><b>Roblox.Emote.Error.NotSupported</b></td>
539+
<td>An error response from the RBXEmoteCommand TextChatCommand</td>
540+
</tr>
541+
<tr>
542+
<td><b>Roblox.Emote.Error.SwitchToR15</b></td>
543+
<td>An error response from the RBXEmoteCommand TextChatCommand</td>
544+
</tr>
545+
<tr>
546+
<td><b>Roblox.Emote.Error.AnimationPlaying</b></td>
547+
<td>An error response from the RBXEmoteCommand TextChatCommand</td>
548+
</tr>
549+
<tr>
550+
<td><b>Roblox.Mute.Error.PlayerNotFound</b></td>
551+
<td>An error response from the RBXMuteCommand TextChatCommand</td>
552+
</tr>
553+
<tr>
554+
<td><b>Roblox.Mute.Error.MultipleMatches</b></td>
555+
<td>An error response from the RBXMuteCommand TextChatCommand</td>
556+
</tr>
557+
<tr>
558+
<td><b>Roblox.Mute.Error.CannotMuteSelf</b></td>
559+
<td>An error response from the RBXMuteCommand TextChatCommand</td>
560+
</tr>
561+
<tr>
562+
<td><b>Roblox.Mute.Info.Success</b></td>
563+
<td>An success response from the RBXMuteCommand TextChatCommand</td>
564+
</tr>
565+
<tr>
566+
<td><b>Roblox.Unmute.Error.PlayerNotFound</b></td>
567+
<td>An error response from the RBXUnmuteCommand TextChatCommand</td>
568+
</tr>
569+
<tr>
570+
<td><b>Roblox.Unmute.Error.MultipleMatches</b></td>
571+
<td>An error response from the RBXUnmuteCommand TextChatCommand</td>
572+
</tr>
573+
<tr>
574+
<td><b>Roblox.Unmute.Error.CannotMuteSelf</b></td>
575+
<td>An error response from the RBXUnmuteCommand TextChatCommand</td>
576+
</tr>
577+
<tr>
578+
<td><b>Roblox.Unmute.Info.Success</b></td>
579+
<td>An success response from the RBXUnmuteCommand TextChatCommand</td>
580+
</tr>
581+
</tbody>
582+
</table>
583+
439584
### NPC/Object
440585

441586
You can also stylize non-player dialogue and add [chat bubbles](../chat/bubble-chat.md) to make it appear like messages are coming from an NPC or object within the 3D world.

0 commit comments

Comments
 (0)