Input for Dialogue System when using Corgi

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Input for Dialogue System when using Corgi

Post by lostmushroom »

Hi Tony. I'm having some issues getting input to work correctly in conversations.

I'm using DS with Corgi and trying to get the game to work well with both a keyboard and a controller.

Using an Xbox controller, 'A' both initiates a conversation and progresses through it (this is the desired behaviour). However, when using a keyboard, 'E' works to initiate the conversation, but then you need to press Enter to progress through it. This seems to be a weird behaviour and honestly I have no idea how I set it to do this in the first place.

These are my settings for Player1_Interact in the input manager, which I assume is what is being used here.
input manager.png
input manager.png (18.84 KiB) Viewed 274 times
Do you have any idea what might be causing this or where to start fixing it?

Thanks for your help as always.
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input for Dialogue System when using Corgi

Post by Tony Li »

Hi,

Add a UI Button Key Trigger component to your subtitle panel's Continue Button GameObject. Set its Button Name to Player1_Interact

This way when the Continue Button is visible and you press the Player1_Interact input, it will click the Continue Button.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Input for Dialogue System when using Corgi

Post by lostmushroom »

Got it working, thanks so much Tony! Really appreciate your help as always.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Input for Dialogue System when using Corgi

Post by lostmushroom »

One last thing - is there a way to get this working with the player's responses as well? I tried adding this component to the Response Button Template, but that seems to be making it press all the options at once (they all go into their "pressed" visual state).
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input for Dialogue System when using Corgi

Post by Tony Li »

Hi,

Tick the Dialogue Manager GameObject's Input Device Manager component > Always Auto Focus checkbox.

Then map the 'e' key to the Submit input:
submitE.png
submitE.png (105.06 KiB) Viewed 218 times
You'll probably need to add another entry for Submit since the first two will probably already have inputs assigned to Positive and Alt Positive.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Input for Dialogue System when using Corgi

Post by lostmushroom »

Hi Tony, I made those changes, but I'm still getting the same issues unfortunately. With the new entry for Submit, it's gone back to requiring you to press Enter to both continue the conversation and select a response.

Do these settings appear right to you?
InputDeviceManager.png
InputDeviceManager.png (50.42 KiB) Viewed 184 times
InputManager.png
InputManager.png (25.79 KiB) Viewed 184 times
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input for Dialogue System when using Corgi

Post by Tony Li »

Hi,

Apart from the Always Auto Focus checkbox, the Dialogue Manager's Input Device Manager component doesn't come into play when running conversations. It's all done through the EventSystem GameObject.

You're using Unity's built-in input manager, correct? Not the Input System package?
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Input for Dialogue System when using Corgi

Post by lostmushroom »

Hi Tony. Sorry, I should have checked that beforehand. The Input System is installed - although I'm not sure where it's having an effect, making changes to inputs in the Input Manager still has an effect, so it seems to be using both?

Maybe I could send you a repro?

Thanks again for your help, apologies for the confusion.
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input for Dialogue System when using Corgi

Post by Tony Li »

Hi,

Yes, please send a reproduction project to tony (at) pixelcrushers.com along with the steps I should follow to reproduce the issue, what I should see if it's working correctly, and what I'll currently see.
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Input for Dialogue System when using Corgi

Post by Tony Li »

This project uses the new Input System package. As you mentioned in your email, your EventSystem uses an Input System UI Input Module component, which means it doesn't read from Project Settings > Input Manager > Submit. The Input System UI Input Module component points to the Input System's DefaultInputActions. In DefaultInputActions, the Submit input is mapped to Keyboard > enter. That's why only the Enter key responds.

To make it also respond to the E key:

1. Locate the DefaultInputActions asset in Packages > Input System > InputSystem > Plugins > PlayerInput.

2. Alt+drag it into the Assets section to create a duplicate copy.

3. Assign the duplicate copy to your EventSystem's Input System UI Input Module.

4. Edit the duplicate. Click the "+" next to Submit, and add another binding for the "E" key. (Remember to click Save Asset at the top, or enable Auto-Save.)
Post Reply