Chatroom UI Possible?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
LNMRae
Posts: 7
Joined: Tue Sep 20, 2016 3:59 am

Chatroom UI Possible?

Post by LNMRae »

Hello! For context, I'm working on a game that has gameplay where you can communicate via text messages or in a chatroom like setting. I'd like to have it set up where previous dialogue boxes simply change their position rather than becoming hidden, and the player can scroll back up to read previous 'messages.' Is something like that even possible to accomplish? Something like having multiple reminder boxes that don't disappear?

Thanks!
User avatar
Tony Li
Posts: 22679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Chatroom UI Possible?

Post by Tony Li »

Hi,

Since the Dialogue System is modular, any kind of UI is possible. Internally, it just needs to implement the IDialogueUI interface as described here. Developers have made UIs that only use voice synthesis and speech recognition, or operate in interactive VR "cave" rooms, etc.

On a more practical level, though, here's the direct link to an example: TextingLogUI_2016-05-18.unitypackage

It imports into Assets > Dialogue System Examples > Conversation Log UI Example because it was an offshoot of a forum thread about the Conversation Log UI. You also can download both examples from the Dialogue System Extras page. It's the fourth button down in the UIs section. (I just now added the extra download link for the TextingLogUI example.)
LNMRae
Posts: 7
Joined: Tue Sep 20, 2016 3:59 am

Re: Chatroom UI Possible?

Post by LNMRae »

Thanks so much for the response! My programming is pretty abysmal, so unfortunately messing with the code isn't something I can do with any confidence at this time, but the example is almost exactly what I was looking for.

I did come across an issue though. I set up a completely empty scene and attached the canvas from the texting ui example to my dialogue manager. My conversations are logging twice on the player and on actor 2. However, this issue doesn't occur with actor 3, their lines are only said once. I don't have this issue at all if I change the database in the example scene and run that. Any idea what would be the cause of this behavior?

Also, is there a way to keep the portraits and/or names next to the log message of the character that spoke it, rather than having it change as the lines are spoken, or would that behavior require additional coding?

Thanks again for your time.
User avatar
Tony Li
Posts: 22679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Chatroom UI Possible?

Post by Tony Li »

Here's an updated version that keeps the character image and name next to each message:

TextingLogUI_2016-09-21.unitypackage

I also updated the download link on the Extras page.

If you dig into the GUI, you'll see that the NPC Template and PC Template now have a small component that points to the different elements (portrait name, portrait image, and subtitle line). And the dialogue UI script points to those template components.


For the double message issue, here are a few things to check:

1. Inspect your player in the Dialogue Editor window and make sure Is Player is set to True.

2. Inspect your conversation and make sure each dialogue entry node is assigned to the right actors.

3. Compare your Texting UI canvas to the one from the example scene. It should be the same since you copy-pasted it, but maybe something got mis-linked.

4. Try your dialogue database in the example scene. If it doesn't work, then the issue is probably in the dialogue database.

5. Otherwise try the example scene's dialogue database in your scene. If it doesn't work, then the issue is probably in your dialogue UI.

If none of that gets to the bottom of it, please feel free to send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.
LNMRae
Posts: 7
Joined: Tue Sep 20, 2016 3:59 am

Re: Chatroom UI Possible?

Post by LNMRae »

Thanks so much, you always go above and beyond with your customer service. I won't have time to do much experimenting today, but I'm going to dig into all this tomorrow and see if I can get it all working. The example looks awesome. Thanks again!
LNMRae
Posts: 7
Joined: Tue Sep 20, 2016 3:59 am

Re: Chatroom UI Possible?

Post by LNMRae »

I imported everything into a new project and everything worked flawlessly! Not sure what was causing the issue before, but it isn't there anymore at least. Thanks again for being so helpful.

Over the course of the design process, I had wondered if there were a way to add pictures to the log. I initially looked into using the rich text quad function, but it's not supported with the new UI. I experimented with using sequences to activate images, but I found no matter where I tried to enable them, they always ended up back on top of the log rather than on the bottom.

I saw that in the dialogue under 'All Fields' there's one that says 'Pictures' but I couldn't find any documentation on what that's for. Can images be inserted into dialogues?
User avatar
Tony Li
Posts: 22679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Chatroom UI Possible?

Post by Tony Li »

Hi,

'Pictures' is a holdover from a third-party dialogue writing tool called Chat Mapper, upon which the Dialogue System's data structure is based. I don't think it will be helpful for your needs.

If you have the budget for it, I recommend using TextMesh Pro. It's like a drop-in replacement for Unity UI Text, except it supports advanced features such as inline images. To integrate it with the text message script, I think you'd just need to change all instances of "UnityEngine.UI.Text" to "TMPro.TextMeshPro".

Otherwise, if you can't use TextMesh Pro, you could modify the text message script to include an optional image. It would be a bit of work, though, and would require a moderate amount of C# experience.
LNMRae
Posts: 7
Joined: Tue Sep 20, 2016 3:59 am

Re: Chatroom UI Possible?

Post by LNMRae »

Ah, that makes sense. I'll check into TextMesh Pro. Thanks again for all the help with this! It's very much appreciated.
Post Reply