New input system - changing action map

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fyperia
Posts: 13
Joined: Sat Jul 25, 2020 8:16 pm

New input system - changing action map

Post by fyperia »

Hi,

I am probably missing something very obvious, but how would I go about changing the action map to a Dialogue map every time a conversation starts, and back to the regular input when it ends?
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: New input system - changing action map

Post by Tony Li »

Hi,

I'll assume you've already written a script that instantiates your controls, and you've added it to the Dialogue Manager, as covered in the Input Device Manager PDF.

The Dialogue System offers a number of special methods. Add OnConversationStart and OnConversationEnd methods to the script. In OnConversationStart, change to the Dialogue map. In OnConversationEnd, change back to the regular map.

(The non-scripting alternative to those script methods is the Dialogue System Events component. But since you already have a script for the new input system, you might as well just add those two methods.)
fyperia
Posts: 13
Joined: Sat Jul 25, 2020 8:16 pm

Re: New input system - changing action map

Post by fyperia »

That's exactly what I was missing, thank you so much!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: New input system - changing action map

Post by Tony Li »

Glad to help!
fyperia
Posts: 13
Joined: Sat Jul 25, 2020 8:16 pm

Re: New input system - changing action map

Post by fyperia »

Is this the correct class to be looking at to set up controller input? I'm having trouble getting the system to recognize anything other than the escape key.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: New input system - changing action map

Post by Tony Li »

Hi,

No; anything that says "UnityGUI" is for the really old legacy UnityGUI system (aka OnGUI or IMGUI).

If you've defined a "Cancel Subtitle" input in your action map, inspect the Dialogue Manager GameObject. Set Display Settings > Input Settings > Cancel Subtitle Input > Button to "Cancel Subtitle".

If that isn't what you're looking for, please let me know what operation you're trying to recognize.
fyperia
Posts: 13
Joined: Sat Jul 25, 2020 8:16 pm

Re: New input system - changing action map

Post by fyperia »

I'm trying to set up the gamepad so I can use the joystick to move up and down the menu options, and press A to select an option or advance the conversation.

The setting you just described seems to only work for me when I have a key selected from the dropdown.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: New input system - changing action map

Post by Tony Li »

Hi,

To navigate the response menu and select response buttons, you shouldn't need to do anything in the Dialogue Manager's Input Settings.

Instead, tick the Dialogue Manager's Input Device Manager component > Always Auto Focus checkbox.

Make sure your scene has an Event System that's set up to allow standard Unity UI navigation.
fyperia
Posts: 13
Joined: Sat Jul 25, 2020 8:16 pm

Re: New input system - changing action map

Post by fyperia »

Apparently one of my other scripts was interfering with the input; did everything you said and turned off that script and now it works just fine. Thanks!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: New input system - changing action map

Post by Tony Li »

Great! Happy to help.
Post Reply