Dialogue For Split Screen Using a Gamepad

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

The Escape key is the Dialogue Manager's Input Settings > Cancel Subtitle Input. I recommend setting Cancel Subtitle Input and Cancel Conversation Input > Key to None.

Add a UI Button to each player's dialogue UI. Add a UI Button Key Trigger, and specify an input action such as the action that maps to joystick's d-pad south button. Configure the Button's OnClick() event to call the dialogue UI's OnContinueConversation method. (Alternatively, if you want the first click to fast forward the typewriter effect, add a StandardUIContinueButtonFastForward component, assign its fields, and set OnClick() to call its OnFastForward method.) Finally, assign the Button to the dialogue UI subtitle panel's Continue Button field.

---
Lockes_TheThief wrote: Thu May 13, 2021 12:36 am By the way, I chose the single dialogue system that is supposed to check which gameobject is interacting with it. But I don't eem to have it working properly yet, as both characters can still communicate with Sonya.
I don't understand. Can you provide details and/or screenshots of your setup?
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'm not exactly sure how to make the button you were talking about.

Ask for the details, you told me:
1. Two Dialogue System Triggers that play different conversations. Set Conditions > Accepted GameObjects on one to The Thief, and on the other to The Muse.

2. Or a single Dialogue System Trigger that starts a single conversation. The conversation can check which player is talking and branch accordingly.

I'm trying to go for the single dialogue system trigger that branches off depending on who is talking to the NPC.
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Now that I refresh my memory of how your UI is set up, it's a little more complicated. The NPC currently uses a bubble subtitle panel that isn't tied to any specific player.

I'm going to suggest a solution that works better with #1 (Two Dialogue System Triggers that play different conversations. Set Conditions > Accepted GameObjects on one to The Thief, and on the other to The Muse.) The NPC will use two bubble subtitle panels, one for the thief and another for the muse.

Try this:

1. Add two more actors to your database, named something like NPC For Thief and NPC For Muse.

2. Add two empty child GameObjects to NPC.
  • Add a Dialogue Actor to each. Set one to NPC For Thief and the other to NPC For Muse.
  • Add an instance of the Bubble Template Standard UI Subtitle Panel to each child. (I'll call this the bubble subtitle panel from now on.)
  • Set the bubble subtitle panel's Canvas > Event Camera to the thief's camera on one and the muse's camera on the other.
  • On both Dialogue Actors, set Subtitle Panel Number to Custom, and assign its child bubble subtitle panel.
3. Set up two Dialogue System Triggers on NPC.
  • On one, set Conditions > Accepted GameObjects to the thief. Assign the NPC For Thief child GameObject as the Conversation Conversant.
  • On the other Dialogue System Trigger, set Conditions > Accepted GameObjects to the muse. Assign the NPC for Muse child GameObject as the Conversation Conversant.
Make sure that works, without continue buttons for now. Once you've confirmed that works:
  • Add a UI Button to each bubble subtitle panel's Bubble Panel.
  • Configure the UI Button's OnClick() event to call the bubble subtitle panel's StandardUISubtitlePanel.OnContinue method.
  • Add a Player Input Button Hotkey component. Set it to an input action such as "Jump" (the gamepad 'A' button).
  • Assign the UI Button it to the bubble subtitle panel's Continue Button field.
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 seemed to cause some problems so I must be missing something. Do I change The Thief and Muse Player Character's Dialogue Actors to the NPC for The Thief and NPC for The Muse Actors that I made? There were already Actors for them, so I'm supposed to change those, right? And in the accepted game objects do I set them to the Player characters or the NPC actors you told me to make? I was confused by the wording.

When I set things up so far, The Thief still got the conversation for The Muse, and The Muse didn't get a conversation at all. Also the ability to choose a response for the player is gone. I followed everything step by step.
Attachments
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal_ _DX11_ 5_14_2021 8_59_36 PM.png
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal_ _DX11_ 5_14_2021 8_59_36 PM.png (787.48 KiB) Viewed 1061 times
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal_ _DX11_ 5_14_2021 8_54_43 PM.png
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal_ _DX11_ 5_14_2021 8_54_43 PM.png (765.66 KiB) Viewed 1061 times
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal_ _DX11_ 5_14_2021 8_54_19 PM.png
3D_2021 - LV001_SS - PC, Mac & Linux Standalone - Unity 2019.4.1f1 Personal_ _DX11_ 5_14_2021 8_54_19 PM.png (790.93 KiB) Viewed 1061 times
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

Here's an example.

TPC_DS_Test_Scene2_2021-05-14.unitypackage

The main NPC GameObject is configured like this:
tpcSplit1.png
tpcSplit1.png (66.81 KiB) Viewed 1060 times

The child GameObjects are configured like this:
tpcSplit2.png
tpcSplit2.png (124.6 KiB) Viewed 1060 times

It's set up like I described above, except I didn't hook up continue buttons. Once you get your scene working, and if you have questions about the continue button after that, I can add continue buttons to the example.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Right on. I was able to get the dialogue to be different following your pattern. Now The Thief and The Muse get different conversations!

I do have an issue though:

Even though the speech bubbles are cool, I can't find a way to hide all of my UI items when using them. The UIs are blocking the conversations. Maybe a regular speech box will have to do...unless there is a way to hide it all easily. On the converse ability for the Opsive Ultimate Character Controller, I have Hide UI selected, but it is only hiding my health, stamina and magic, but not my minimap and currency UIs. I think this is because the minimap uses a different asset from UCC and the Currency uses Opsives Ultimate Inventory System. If it is too hard to hide them all, I'm okay with switching the dialogue to bottom of the screen like normal. But if there is a simple solution, I would rather continue using the bubbles.
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

If you inspect your players' Converse ability and tick 'Hide UI', it will hide the TPC UI. (Hide UI is ticked by default.) To hide the other UIs during conversations, add a Dialogue System Events component to the player. Configure the OnConversationStart() event to hide the UIs. The easiest way is to disable the player's UI canvas(es). Configure OnConverrsationEnd() to show the UIs again.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Looks like that is working now, all the UIs are hidden. Thank you! Now back to the continue button. I set it up like in the instructions from before but it still seems to be going at its own pace instead of waiting for me to press my Action button. Not sure what I missed, so I attached images.
Attachments
continueButton2.png
continueButton2.png (887.28 KiB) Viewed 1050 times
continueButton.png
continueButton.png (896.41 KiB) Viewed 1050 times
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

Inspect the Dialogue Manager GameObject, and set the Subtitle Settings > Continue Button dropdown to Always.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Cool, almost got it working. I'm not sure why, but Player 1's (The Thief), continue button only works if I press A while using the joystick. If the joystick is in neutral it doesn't continue the conversation. Player 2's (The Muse) continue button works fine. It is almost done! Thanks.
Post Reply