Player messages are different from conversations with NPCs. If you're talking with an NPC, the dialogue UI will appear locally on your client. It shouldn't appear on all players' clients. (Although it's possible to do that with a bit of scripting.)
Player messages, on the other hand, are part of uMMORPG, not the Dialogue System. You can still use the Dialogue System to display the messages. I recommend using barks (tutorial). Barks normally also play locally, but you can modify uMMORPG to show it on other clients.
When the player enters some text in uMMORPG's chat window, uMMORPG will call one of the following methods on all relevant clients: PlayerChat.RpcMsgLocal(), TargetMsgParty(), or TargetMsgGuild(). If you want local chat messages to appear as barks:
1. Make sure your player prefabs have bark UIs.
2. Make the Dialogue System's code available to uMMORPG:
- Import Plugins/Pixel Crushers/Dialogue System/Scripts/DialogueSystemAssemblyDefinitions.unitypackage.
- Inspect uMMORPG/Script/uMMORPG.asmdef. Add DialogueSystem.asmdef to its Assembly Definition References.
Code: Select all
GameObject go = GameObject.Find(sender);
Transform speaker = (go != null) ? go.transform : null;
PixelCrushers.DialogueSystem.DialogueManager.BarkString(message, speaker);
Code: Select all
else if (!text.StartsWith("/"))
{
// local chat is special: it has no command
lastCommand = "";
CmdMsgLocal(text);
DialogueManager.BarkString(message, transform); // <--- THIS LINE
}