Choose the response using W or S button

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Choose the response using W or S button

Post by Mchia_Soo »

Hello Tony!

It's me again.

I would like to know if there's any way to set the response menu input to the keyboard button, W or S, without moving the character?

My character is moving using WASD buttons. I don't pause the game while the game begins as the timer in Quest Machine is running. But if I don't pause the game, the character will move if I press W or S button for the response menu of Dialogue System.

Other than W or S, any other button that you can suggest me to use?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Choose the response using W or S button

Post by Tony Li »

Hi,

You could configure Unity UI's EventSystem to navigate using the up/down arrow keys, or enable the StandardUIMenuPanel's auto-numbering and let the player choose responses by pressing number keys.
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Choose the response using W or S button

Post by Mchia_Soo »

Wow, this is indeed a useful feature! Thanks a lot!!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Choose the response using W or S button

Post by Tony Li »

Glad to help!
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Choose the response using W or S button

Post by Mchia_Soo »

Hello Tony!

After enabling the Autonumber, I just realised I have more than 9 responses and there's no button for the numbers more than 9. I try to use arrow buttons for the response menu, but I can't pause the game (to stop the player to move) as the timer is running.
How can I fix this problem? (I am thinking of using alphabet buttons after the numbering or do you have another idea?)

And another problem is when I have many responses in the panel, the response menu panel blocks the previous sentences, which I don't want them to be blocked.

Hope you can understand more about the situation through the image below.
ResponseMenu.JPG
ResponseMenu.JPG (105.68 KiB) Viewed 1018 times
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Choose the response using W or S button

Post by Tony Li »

Hi,

Here are some ideas:

1. Break up the responses into submenus:
  • Update options:
    • The system will automatically update...
    • The particular date and time...
  • Authentication and tracking:
    • Every customer should have their accounts...
    • The login authentication will be done...
    • The system shoud allow customers to view...
  • Availability:
    • The system should be available 24/7
    • The mechanic team should have access...
This way each menu can have less than 10 items. The player can choose "Update options" from a menu, and then the program will show a smaller menu with "The system will automatically update..." and "The particular date...".


2. Examine the Basic Standard Dialogue UI. Its Response Menu Panel has a fixed size Scroll View that does not overlap the subtitle panel. The player can scroll through the response menu buttons.


3. If the arrow buttons move the player and navigate the response menu buttons at the same time, here are two solutions:
  • Use different arrow inputs for the UI EventSystem. For example, in Edit > Project Setting > Input Manager, create two new inputs named UIHorizontal and UIVertical. Assign the arrow keys to them. Map the regular Horizontal and Vertical to WASD keys. Then inspect the EventSystem GameObject, and change the Horizontal and Vertical fields to "UIHorizontal" and "UIVertical". The player can move using WASD and navigate UIs the arrow keys.
  • Instead of that, just disable the player's movement controls during conversations. Use a Dialogue System Events component on the player. Configure OnConversationStart() to disable the player control script(s) and OnConversationEnd() to re-enable them.
Mchia_Soo
Posts: 72
Joined: Sun Jun 30, 2019 11:59 pm

Re: Choose the response using W or S button

Post by Mchia_Soo »

Wow! That's indeed a good idea! I managed to solve my problems by adjusting a few settings, and now it's working perfectly. Thanks, Tony!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Choose the response using W or S button

Post by Tony Li »

Happy to help! :-)
Post Reply