Interlocking key configuration with conversation start button

Announcements, support questions, and discussion for the Dialogue System.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Interlocking key configuration with conversation start button

Post by gaku2_sigehiro »

Thank you.
I tried playing a sample scene, and after pressing the [F1] key, I can start a conversation by pressing the "E" key, but in that state I can also start a conversation by pressing the normal "Enter" key. That's not what I was looking for.
In that state, what can I do to prevent the "Enter" key from starting a conversation?
Also, is it a bug that you can start a conversation even if you move after converting the key?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Interlocking key configuration with conversation start button

Post by Tony Li »

Hi,

When you set it up in your own project/scene, make sure Enter isn't also mapped to the input action you're using.

To stop player movement and/or the Selector when a conversation is active, please see the Interaction Tutorial. It shows how to use a Dialogue System Events component to do this.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Interlocking key configuration with conversation start button

Post by gaku2_sigehiro »

I thought that the problem was caused by the game part that I had already created, so I created a new project and tried playing a sample with only InputSystem installed.
When I played the game, I was able to see that the "Fire1" button changed when I pressed the "F1" key, but it was not the "E" key, but was overwritten by the button I pressed beforehand.
I don't know if there is a problem with this script or with the scene that was passed to me.
I haven't included any data that I created, so maybe it's a UNITY version issue?
UNITY version is 2022.3.22f1.

The one I made already had support for making the player unable to move during conversation as described in the explanation below.
The question I raised was that the sample I received was able to start a conversation by pressing the movement key.
I tried it this time and found out that the problem seems to be that the previous key is set to "Fire1".
As a result, the movement key is also set to "Fire1" and the conversation can begin.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Interlocking key configuration with conversation start button

Post by Tony Li »

Hi,

I'm not sure I understand. Is your project working now?
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Interlocking key configuration with conversation start button

Post by gaku2_sigehiro »

Hello.

The self-made project I am making is working normally except for the DialogueSystem key configuration.

When I put the sample "DS_RebindInputSystemExample" I received into the project I was creating, it behaved strangely.
I created a new project and included only that sample in order to prevent my project from becoming corrupted, but the behavior is still strange.
Did you actually debug the sample and found no problems?

Create a new project (version is 2022.3.22f1) → Import InputSystem → Import DialogueSystem → Import "DS_RebindInputSystemExample".
It behaves strangely even when only the bare minimum is installed, so it is difficult to decipher and assemble based on this because it becomes a breeding ground for bugs.

I'm using machine translation to translate it into English, so I'm sorry if the English sentences are strange. We will also post Japanese, so if you have staff who can speak Japanese, please check with us.

こんにちは。
自作プロジェクトはDialogueSystemのキー設定以外は正常に動いています。
自作プロジェクトに頂いたサンプル「DS_RebindInputSystemExample」を入れたところ、挙動がおかしいです。
自作プロジェクトの部分が悪さしないように新規プロジェクトを作成し、そのサンプルだけ入れたのですが、それでも挙動がおかしいです。
そちらは実際にサンプルをデバッグして不具合は出ていませんか?
新規プロジェクト作成(バージョンは2022.3.22f1)→InputSystemのインポート→DialogueSystemのインポート→「DS_RebindInputSystemExample」のインポート。
最低限しかインストールしていない状態でも挙動がおかしくなるので、これを元に解読して組み立てるにはバグの温床になるため、困っています。
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Interlocking key configuration with conversation start button

Post by Tony Li »

Hi,

My understanding of PerformInteractiveRebinding() was incorrect. Change the Update() method to:

Code: Select all

        private void Update()
        {
            if (Keyboard.current.f1Key.wasPressedThisFrame)
            {
                Debug.Log("Rebinding 'Fire1'. Press a key to rebind input.");
                var inputAction = controls.DemoActionMap.Fire1;
                controls.Disable();
                rebindingOperation = inputAction.PerformInteractiveRebinding().
                    WithCancelingThrough("<Keyboard>/escape").
                    OnComplete(operation => RebindCompleted()).
                    OnCancel(operation => RebindCompleted());
                rebindingOperation.Start();
            }
        }
This is an interactive method. When you press [F1], the Input System will wait for you to press another key. Then it will bind the "Fire1" input to the key that you pressed.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Interlocking key configuration with conversation start button

Post by gaku2_sigehiro »

Hello.
I tried rewriting the script and confirmed it. It's working fine.
In reality, it seems that it is necessary to read out and overwrite the inputs memorized on the key configuration screen, but I will try that myself first.
Thank you for your reply.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Interlocking key configuration with conversation start button

Post by Tony Li »

Glad to help!
Post Reply