[SOLVED]Pressing continue too quickly will remove focus from response button

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
roketronz
Posts: 18
Joined: Thu Jun 14, 2018 10:54 am

[SOLVED]Pressing continue too quickly will remove focus from response button

Post by roketronz »

UPDATE: For future reference, Tony made a patch solving the issue, which will be available in the next version of Dialogue System.

Hi Tony and DS Community!

This is the thing: When my character is talking with an npc, and the user starts smashing the continue button to skip the conversation, if the sentence is short enough and the user press the continue button quick enough, when the response button shows up, it will have no focus, and basically locks the conversation.

The game should be able to be controlled without a mouse, so I cant really expect for the user to manually give focus to the response button.

More details:
-I'm using the last DS version (But this behavior has being going on for a while now)
-I'm using Rewired and Playmaker (Though I dont think that's where the problem resides)
-Using Standard Dialgoue UI
-I'm using Standard UI Continue button fast forward:
Image

Any ideas?
Thanks!
Last edited by roketronz on Sat Jan 26, 2019 7:09 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pressing continue too quickly will remove focus from response button

Post by Tony Li »

Hi,

Inspect your dialogue UI's response menu panel, and set Focus Check Frequency and Refresh Selectables Frequency to non-zero values such as 0.5.

You may also want to tick the Dialogue Manager's Input Device Manager > Always Auto Focus. Otherwise if the Dialogue System has detected mouse movement at any point during play, it won't refocus the continue button because it assumes the player is playing with the mouse.
roketronz
Posts: 18
Joined: Thu Jun 14, 2018 10:54 am

Re: Pressing continue too quickly will remove focus from response button

Post by roketronz »

UPDATE: Upon further testing, adding the Input device Manager and setting Always Auto Focus still doesnt work. If I press the continue button quick enough, the response button will show up without focus.

Any Ideas?

Previous response:
Hi Tony! Thanks for the reply
Inspect your dialogue UI's response menu panel, and set Focus Check Frequency and Refresh Selectables Frequency to non-zero values such as 0.5.
Unfortunately, I had the values in 0.2, 0.5 and nothing. It keeps happening.
You may also want to tick the Dialogue Manager's Input Device Manager > Always Auto Focus.
This did the trick!
I had to add an Input Device Manager to my Dialogue manager. Everything was working correctly without this. Is OK to use this if I'm using Rewired? I did a quick test and everything seems to be working properly.

Regarding mouse, maybe I express myself poorly. The problem didnt reside on moving the mouse, because I'm blocking mouse input. My comment was to avoid any comment that might be "use the mouse to give focus to the button"

Which leads me to another question, why I was loosing focus when the response menu appears after smashing the continue button, but no when I would press it normally?
I dont know if this is something you can answer without an extensive look into my project, but let me know if you have any ideas.

Thanks again for the quick reply.
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pressing continue too quickly will remove focus from response button

Post by Tony Li »

This sounds like something I can reproduce on my own. I'll set up a test and let you know what I find.

BTW, import this package: Plugins / Pixel Crushers / Common / Third Party Support / Rewired Support. Then add an Input Device Manager Rewired component to the Dialogue Manager. This allows the Input Device Manager component to use Rewired instead of standard Unity Input. I don't think it will fix the focus issue, but it's a good idea anyway.
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pressing continue too quickly will remove focus from response button

Post by Tony Li »

Hi,

I'm having trouble reproducing this. Would it be possible for you to send an example scene or, better yet, and example project to tony (at) pixelcrushers.com?

If you can't send it:

Are you using keyboard or joystick to continue?

How are you clicking the continue button? Does the continue button have a UI Button Key Trigger component that maps a hotkey/input button? Or are you relying on the Dialogue System to focus the button so the Unity UI EventSystem's "Submit" input clicks it?

It looks like the button has an Animator and a PlayMaker FSM. How do these come into play?
roketronz
Posts: 18
Joined: Thu Jun 14, 2018 10:54 am

Re: Pressing continue too quickly will remove focus from response button

Post by roketronz »

Tony, as always, thanks for the answers.

I'm trying to set up a standalone project with this issue in order to send it to you. It's turning out really hard to separate, but I think I can have it in a few days.
(Also, it might come in handy in the future for me)

regarding your questions;
-I duplicated the Basic Standard Dialogue UI from 2.x (cant remember which version) and started working on the skinning of that UI.
I think most of the changes were aesthethic changes.
The only thing I added was the Position Dialogue UI Screen Space.

-It happens using both keyboard and joystick
-I'm mostly using the continue button as is from the basic standard dialogue. I only added the Standard UI continue Button Fast forward script, which works fine as far as i can tell.
-The Playmaker state machine only swaps the image of the button depending on the input (joystick or keyboard)
Image

-I added the Input device manager Rewired, and as you said, no changes.
Image

If you can think of something to try with this information, I can try it, if not, I'm still isolating the project to send you a small piece of the project with the problem.

Thanks again for your help Tony!
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pressing continue too quickly will remove focus from response button

Post by Tony Li »

The images didn't come through, but I think I understand anyway. (The Attachments feature of this forum software sometimes has issues when you upload and insert more than one image in a post.)

What input button are you pressing to click the continue button?
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pressing continue too quickly will remove focus from response button

Post by Tony Li »

I don't know if this will be any help, but here is a test scene:

TestContinue_2019-01-21.unitypackage

I included Rewired and standard Unity Input versions. I only set up keyboard input.

For the Rewired version, I mapped the continue button to the 'C' key, and the UI EventSystem navigation to WASD (for the response menu). As soon as the conversation starts, I can spam the 'C' key, and when the response menu comes up it correctly has focus.

Is it possible that something unrelated to the Dialogue System is stealing focus?
roketronz
Posts: 18
Joined: Thu Jun 14, 2018 10:54 am

Re: Pressing continue too quickly will remove focus from response button

Post by roketronz »

Hello again Tony!

Unfortunately, I spent a lot of time separating the project, and I couldnt reproduce the issue in the new project. In the new project, everything works fine. You can skip texts at speed of light and everything works as it should.

It's only in the real conversations were it beaks. Conversations with conditions and scripts. I'm not doing anything weird until the conversation ends. I'm running out of ideas.

From what i can see, when this happens, the eventsystem says the selected button is the continue button from the npc subtitle panel, when it should be the response button. So it is the dialogue system which is stealing focus from itself.

I removed all sequence and conditions from the last conversation node and is still happening. I will continue to delve into this. As far as I can tell, it only happens in the last node of a conversation, when it has a player response.

To answer your question, I'm using the space key, or the A button in a x360 joystick.

I did not tried your package yet. I will try it tonight, but because the separated project didnt work, I dont have my hopes really high.

I appreciate all your help Tony, I will explore a little more the problem and let you know any developments
User avatar
Tony Li
Posts: 21722
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pressing continue too quickly will remove focus from response button

Post by Tony Li »

You're welcome to send your entire project to tony (at) pixelcrushers.com. (All customer files are handled confidentially.) You can zip up just the Assets and ProjectSettings folders to make the upload smaller. Then use your preferred service -- Dropbox, Google Drive, OneDrive, etc.
Post Reply