Rewired w/ Dialogue System

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
elsewhere
Posts: 5
Joined: Sat Jul 13, 2019 8:15 pm

Rewired w/ Dialogue System

Post by elsewhere »

Hello! I have been using Rewired to handle the input in my game and I've hit a snag while trying to make it work with the Dialogue System. Currently, when I come up to a sprite (in 2D), and press "A" on my Switch Pro Controller, a conversation will start. It seems that "Auto focus" is not working because I cannot use the "A" button again as my continue button.

I am not sure how to set up my control scheme to be able to advance text using my "A" button. When I check Unity's Input (under Project Settings -> Input), I have about 514 different axes and "Submit" is currently set to "joystick button 1" which should correspond to "A" on my Switch Pro Controller.

Any help would be appreciated! Thank you!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Rewired w/ Dialogue System

Post by Tony Li »

Hi,

Have you set up the Dialogue System's Rewired integration? To do it:

1. Import the package Plugins ► Pixel Crushers ► Common ► Third Party Support ► Rewired Support.

2. Add the Input Device Manager Rewired script to your Dialogue Manager.

The Dialogue System will now use Rewired for input. Note that the Dialogue System uses standard Unity UI. Make sure to set up Rewired's Standalone Input Module so you can use Rewired with Unity UI.


The Dialogue System's Input Device Manager automatically detects when you're using a mouse or joystick. If you're using a joystick (detected by moving a joystick axis or pressing a joystick button), the Dialogue System will auto-focus a UI button so you can navigate the UI using the joystick.

If you're using a mouse (by moving the mouse or clicking it), the Dialogue System will not auto-focus a UI button, so you won't be able to navigate using the joystick. To tell the Dialogue System to always auto-focus even if the player moves the mouse, tick the Input Device Manager's Always Auto Focus checkbox.
elsewhere
Posts: 5
Joined: Sat Jul 13, 2019 8:15 pm

Re: Rewired w/ Dialogue System

Post by elsewhere »

Thank you for your quick reply, Tony!

I have set everything up and still seem to be running into a problem. It appears the dialogue does not want to auto focus to my controller input. Instead, I have to click the "Continue" button, then I can press A to progress through dialogue. I will attach screenshots of my settings.

Image

Image

Image
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Rewired w/ Dialogue System

Post by Tony Li »

Let's figure out what Unity's EventSystem thinks is selected (i.e., focused). While playing, keep an Inspector window open on the scene's EventSystem. When the conversation shows a subtitle panel, make sure the continue button is selected:
eventSystemContinueButton.png
eventSystemContinueButton.png (4.43 KiB) Viewed 1578 times
If it's selected but 'A' doesn't click it, stop playing, tick Force Module Active, and try again.

If it's not selected, check your subtitle panel's configuration. Is the Continue Button field assigned?

Feel free to send an example scene/project to tony (at) pixelcrushers.com. I'd be happy to take a look directly.
elsewhere
Posts: 5
Joined: Sat Jul 13, 2019 8:15 pm

Re: Rewired w/ Dialogue System

Post by elsewhere »

Great idea to use that! Can't say I have used that EventSystem window before.

At first, when interacting with an NPC, the "Selected: " tag would remain blank. It wasn't until I clicked on the button, then dragged the cursor away from the continue button that the tag changed to "Selected: Continue Button"

Only after doing that, would I be able to use "A" to go through the text. It wasn't until I set the "First Selected" variable within the Subtitle Panel to be equal to the continue button that it began to work. Now, I am able to talk to an NPC and progress through the text without using my mouse. I did note one thing, though. It seems that everytime I press "A" now, it attempts to start the conversation (which there seems to be a check for whether a conversation is already acting, so it is not being buggy). Is there a way to disable that? So whenever I start a dialogue, the console does not get spammed with "Conversation already started"?

Thank you so much, Tony!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Rewired w/ Dialogue System

Post by Tony Li »

elsewhere wrote: Thu Jul 18, 2019 6:55 pmIt seems that everytime I press "A" now, it attempts to start the conversation (which there seems to be a check for whether a conversation is already acting, so it is not being buggy). Is there a way to disable that? So whenever I start a dialogue, the console does not get spammed with "Conversation already started"?
I'll assume that the player GameObject is being used as the conversation actor.

Add a Dialogue System Events component to the player GameObject. Configure the OnConversationStart() event to disable whatever component is listening for the 'A' button. Configure the OnConversationEnd() event to re-enable it. If you'd like a step-by-step tutorial, please see the second half of the Interaction Tutorial.
Post Reply