Dialogue For Split Screen Using a Gamepad

Announcements, support questions, and discussion for the Dialogue System.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

That seems to have done the trick! Thanks a lot!
One last question and I think we'd be able to start the Quest System.
How are you able to get the bubbles to be properly fixated on the Players' screens? I thought I set it up properly, but the way your version shows the bubbles is more efficient then mine.
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal _DX11_ 5_28_2021 11_15_07 PM.gif
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal _DX11_ 5_28_2021 11_15_07 PM.gif (588.07 KiB) Viewed 600 times
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal _DX11_ 5_28_2021 11_14_50 PM.gif
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal _DX11_ 5_28_2021 11_14_50 PM.gif (462.57 KiB) Viewed 600 times
Finally, I really would like to give you a tip for all the help you have done. The Dialogue System doesn't cost enough for this much helpful and efficient customer service. Is that possible to do?
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Oh, also, how do I get two dialogues going at once. I just made a 2nd NPC Placeholder to speak and it looks like the conversation can't start until the other one is done.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Oh and one last thing. I found a glitch when I double tap the A button. The Bubbles disappear throughout the conversation and even after starting a conversation again. When I continue the conversation, the bubble appears for a split second then disappears. Is that a known issue?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,
Lockes_TheThief wrote: Sat May 29, 2021 12:18 amHow are you able to get the bubbles to be properly fixated on the Players' screens?
The NPC has two bubble subtitle panels, one for each player (NPC P1 and NPC P2). They each have a Face Player On Conversation Start script that rotates the UI to face the player's screen. I included this script in the example scene package.
Lockes_TheThief wrote: Sat May 29, 2021 12:18 amFinally, I really would like to give you a tip for all the help you have done. The Dialogue System doesn't cost enough for this much helpful and efficient customer service. Is that possible to do?
Thanks, that's kind of you, but no need. Just make a cool game! ;-)
Lockes_TheThief wrote: Sat May 29, 2021 1:29 amOh, also, how do I get two dialogues going at once.
Inspect the Dialogue Manager GameObject, and tick Other Settings > Allow Simultaneous Conversations. I didn't set up the example scene for that. I'll send you an updated example scene later today, since in the current setup two simultaneous conversations will step on each others' toes right now.
Lockes_TheThief wrote: Sat May 29, 2021 1:42 amOh and one last thing. I found a glitch when I double tap the A button. The Bubbles disappear throughout the conversation and even after starting a conversation again. When I continue the conversation, the bubble appears for a split second then disappears. Is that a known issue?
Hmm, maybe an Animator issue? Try keeping an Animator window open on the bubble UI's Animator component to watch its current state and parameters. Maybe it's getting into a weird state. Can you reproduce this issue in the example scene?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Tony Li wrote: Sat May 29, 2021 8:41 amI'll send you an updated example scene later today
I'm afraid I ran out of time today. I'll update that scene first thing in the morning.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

Here's the example scene:

TPC_DS_Test_Scene_Continue_Simultaneous_2021-05-30.unitypackage

Normally it would require a small script to hook up the continue buttons to the right dialogue UIs. But since this functionality was added to version 2.2.17, I just used a 2.2.16->2.2.17 patch for the affected files. You can import the patch here:

DS_StandardUIPatch_2021-05-30.unitypackage

The Dialogue Manager's Other Settings > Allow Simultaneous Conversations checkbox is ticked.

Reminder: Your database should have two player actors (Is Player checkbox ticked). Your will be The Thief and The Muse. In the example, they're just called Player1 and Player2. For each NPC that can talk to both, define two versions of the NPC's actor: one for player 1, another for player 2. In the example, they're called NPC P1 and NPC P2. Think of them as the "faces" that the NPC reveals to each player.

tpcSplit1.png
tpcSplit1.png (14.09 KiB) Viewed 595 times

Use the correct player and NPC actor in each conversation -- both in the conversation's properties and each node:

tpcSplit2.png
tpcSplit2.png (23.58 KiB) Viewed 595 times

The NPC should have two children representing the "faces" that the NPC shows to each player. Each one should have a Dialogue Actor component, dialogue trigger, optional Face Player On Conversation Start, and Override Dialogue UI. The Override Dialogue UI component is key for simultaneous conversations. Each conversation needs its own dialogue UI. In this scenario, the dialogue UI doesn't show any UI elements itself; the NPC's bubble subtitle panel and the player's menu panel will show all the UI stuff. The dialogue UI will simply coordinate between them.

I trimmed down the Inspector view here:

tpcSplit3.png
tpcSplit3.png (71.86 KiB) Viewed 595 times

The hierarchy is set up like this:

tpcSplit4.png
tpcSplit4.png (14.62 KiB) Viewed 595 times

I disabled the dialogue UIs' Canvases since there's no need to show any of their UI elements. (This is optional.) Again, the dialogue UIs only exist in this setup to handle all of the back-end UI logic, passing subtitle and menu display responsibilities to the bubble panel and player's custom menu panel.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

I do have the face player on conversation start, but it seems like it is facing the direction of the player, not the camera. As I'm saying it I might be able to find out what is causing that, but not completely sure.

I do have the conversations going at the same time, but for some reason, The Muse can control The Thief's Action Button during conversations. (That's my A button, btw, Y is my jump). It's the only one, too. So for example, I press A to start a conversation, and both work separately, The Thief can start his convos, The Muse can start hers. Neither can start the other's convo. The response buttons work properly, B and X. But if I start a convo with The Thief, The Muse can continue it with her Action (A) Button as well as respond with the A Button. The Thief cannot continue the Muse's A Button convo or response. I'm not exactly sure why this is happening this way.

While I'm rapidly pressing the A during a conversation, looks like the Animator gets switched to hide whenever I get to the next part of the conversation and it doesn't properly load show anymore. I'm not sure how to do it in the example because there is only one statement per conversation.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

Make sure each conversation is entirely separate:
  • Separate UI panels
  • Separate participant GameObjects (such as the children NPC_P1 and NPC_P2 in the example scene)
  • Separate actors assigned in the conversation, including all nodes
  • Separate participants assigned to the Dialogue System Triggers
If there's any overlap, it can cause a problem. For example, if The Thief or The Thief's NPC GameObject is assigned to The Muse's conversation or any of its nodes, then when The Muse's conversation closes, it will tell all participants' UIs to close. Even if The Thief and the Thief's NPC GameObject are showing The Thief's conversation, the UIs will still close at the end of The Muse's conversation.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Strange, it works fine on my desktop but not my laptop. I switch between the two using version control. The dialogue is working properly at the same time with two NPCs on one computer but not the other. I even went ahead and copied the entire project of my desktop and shared it to my laptop in case I was missing anything, and it is still acting strangely. I'll have to try to figure this one out on my own, I don't think you can address this issue. When I get it done I'll come back for questions about the quest system, hopefully.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Any errors or warnings in the Console window on your laptop?

Make sure it's not a script execution order issue. Unity normally doesn't guarantee the order in which scripts run Unity methods. For example, if you have two scripts A and B, it's possible that A.Start() could run before B.Start() on your desktop but after B.Start() on your laptop. You can resolve this by using Edit > Project Settings > Script Execution Order, or by modifying your code so they're not timing dependent like that. Just a thought. But it's more likely something else, like the Input System grabbing a usable input device on your desktop but an invalid input device on your laptop.
Post Reply