Page 1 of 2
multiple Textline Dialog UI in a scene
Posted: Tue Nov 19, 2019 10:28 am
by Tetralogia
Hi,
I'd like to make a game in which you have multiple textline dialog ui with different conversations at once. The idea is to have a starting conversation and then opening new ones when reaching a specific entry. I've tried playing around the dialog manager but everything I come up with feels kind of messy. What do you think would be the best way to go about it?
Thanks in advance!
Re: multiple Textline Dialog UI in a scene
Posted: Tue Nov 19, 2019 2:07 pm
by Tony Li
Hi,
Reviewing the script, I don't see any gotchas. If you need to save the states of these conversations, make sure to tick the TextlineDialogueUI components' Use Conversation Variable checkboxes.
Also tick the Dialogue Manager's Other Settings > Allow Simultaneous Conversations.
I recommend writing a C# method to start a new conversation. Then
register it with Lua and call it from a dialogue entry node's Script field.
Re: multiple Textline Dialog UI in a scene
Posted: Thu Nov 21, 2019 4:13 am
by Tetralogia
Hi,
thanks for your answer! I had written C# methods to manage the conversations, and I didn't know about Lua.RegisterFunction(), it's a time saver!
I cannot find how to have more than one Dialogue Manager active in the same scene. I unticked "Allow Only One Instance", "Don't Destroy On Load" and ticked "Allow Simultaneous Conversations" ; so now I see that I've got two Dialogue Managers in my hierarchy but only one of them starts its conversation (and that's a conversation from the Dialogue Database attached to the other Dialogue Manager). Is there a way?
Re: multiple Textline Dialog UI in a scene
Posted: Thu Nov 21, 2019 7:42 am
by Tony Li
Having two Dialogue Managers in your scene gets very complicated.
If at all possible, please use one Dialogue Manager at a time. You can still run multiple simultaneous conversations from the one Dialogue Manager.
Make sure the checkbox Other Settings > Allow Simultaneous Conversations is ticked.
Since each conversation will need to use a separate dialogue UI, put two (or more) dialogue UIs in the scene. Use Override Dialogue UI components to specify which conversation should use which dialogue UI. For example:
- Say you have GameObjects representing NPCs Adam and Bob. They can be empty GameObjects.
- Add Override Dialogue UI components to Adam and Bob. Assign dialogue UI #1 to Adam's Override Dialogue UI. Assign dialogue UI #2 to Bob's.
- In the Dialogue System Trigger for Adam's conversation, set the Conversation Conversant to the Adam GameObject.
- In the Dialogue System Trigger for Bob's conversation, set the Conversation Conversant to the Bob GameObject.
Re: multiple Textline Dialog UI in a scene
Posted: Thu Nov 21, 2019 1:36 pm
by Tetralogia
Oh thanks! That's exactly what I was looking for
Thanks for you help!
Re: multiple Textline Dialog UI in a scene
Posted: Thu Nov 21, 2019 1:59 pm
by Tony Li
Happy to help!
Re: multiple Textline Dialog UI in a scene
Posted: Fri Nov 22, 2019 5:21 am
by Tetralogia
Hi,
I’ve got another question.
I open my conversations through C# with a method
OpenConversation() that implements
ConversationHasValidEntry() and
StartConversation(). I then register it with
Lua.RegisterFunction(), call it from a node and pass the arguments (conversation, actor, conversant).
As you’ve suggested, my NPCs have
Override Dialog UI components ; they also have
Dialogue Actor components and I plan to add Actor Subtitle Color, etc.
So when I open a conversation through a node, it pops up in a new Textline Dialogue UI and the other conversation remains open. What I’d like to do is sort of put the first conversation on pause, wait for a node in the new conversation to be reached, and then show the next node in the first conversation.
Example :
(Conversation 1)
- NPC : Hi!
- Player : Hi
- NPC: How are you? (-> OpenConversation(Conversation 2, player, NPC1) ; Conversation 1 remains open but is paused)
(Conversation 2 ; pops up in a new Textline Dialogue UI)
- NPC1 : Hi!
- Player : Hi
- NPC1 : Goodbye (-> player responses to ‘How are you’ in Conversation 1 appear)
For now I'm using
Conversation[#].Dialog[#].SimStatus == "WasDisplayed" as a condition for the player responses to be shown in the first conversation, but I'm now looking for a way to update the conversation state so that they actually show when the condition is true.
Thanks in advance
Re: multiple Textline Dialog UI in a scene
Posted: Fri Nov 22, 2019 8:38 am
by Tony Li
Hi,
Since you're using the Dialogue Actor component, you don't need to add Actor Subtitle Color. The Dialogue Actor component has a "Set Subtitle Color" checkbox that does the same thing.
You can make Conversation 1 wait for a sequencer message:
- NPC: How are you?
- Sequence: OpenConversation(Conversation 2, player, NPC1); WaitForMessage(Continue1)
This will make the node wait until the sequencer receives the message "Continue1".
When you get to the point in Conversation 2 where you want Conversation 1 to continue, send "Continue1":
- NPC2: Alright, get back to your original conversation now.
- Sequence: {{default}}; None()->Message(Continue1)
The None() command does nothing. When it's done, the "->Message(Continue)" part sends the sequencer message "Continue1" which will allow Conversation 1 to continue.
Re: multiple Textline Dialog UI in a scene
Posted: Wed Nov 27, 2019 6:05 am
by Tetralogia
Thanks a lot!
Re: multiple Textline Dialog UI in a scene
Posted: Fri Dec 06, 2019 4:54 pm
by Tetralogia
Hi!
Now that I can open simultaneous conversations in different TextlineDialogUIs, I'm wondering I can use the Close() method for a specific TextlineDialogUI. For now, when the Close() method is called, it seems to close all conversations in every TextlineDialogUI in the scene.
Or is there a way to clear the lines in a TextlineDialogUI in order to use it to open another conversation later?
Thanks in advance!