Questions for operating with mouse only

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

Questions for operating with mouse only

Post by gaku2_sigehiro »

Hello.
I'm in the process of making it so that I can move and talk with the left click of the mouse so that I can operate it with just the mouse, but since the dialog system's conversation start takes up the entire screen, I'm having trouble combining it with movement.
Is it possible to configure the dialogue system so that when the person you want to talk to is right in front of you, you can start a conversation by left-clicking on the person you want to talk to?
If that's difficult, I'm thinking of starting a conversation by long-pressing the left click, but I don't know where to go to do that, so I'd appreciate it if you could let me know.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions for operating with mouse only

Post by Tony Li »

Hi,

Sure, there's no restriction on how you start conversations.

The Dialogue System Extras page has a DS_2DSelectorExample scene (direct download) that demonstrates just two ways of starting a conversation with an NPC when you click on it. The scene is in 2D, but the same idea can apply to 3D. And there are plenty of other ways to start a conversation. Your own interaction system can just call the NPC's DialogueSystemTrigger.OnUse() method, or you can bypass a Dialogue System Trigger entirely and run DialogueManager.StartConversation() directly in C#.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Questions for operating with mouse only

Post by gaku2_sigehiro »

Thank you.
I understand that in the sample, the event is triggered using a button.
There are two things I would like to create:
I would like to use it together.
Which script should I use?
- On a controller or keyboard, start the conversation by pressing the start conversation button when you enter the conversation range. (Normal behavior?)
- When using the mouse, stay within the conversation range and start the conversation when you click on the other party's object.
Based on my knowledge, I don't know the details of the dialog system, so I would appreciate it if you could help me with samples and sample code.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions for operating with mouse only

Post by Tony Li »

Hi,

The example scene has two examples: using a Selector and using a UI Button.

Given your description (enter the conversation range), you can use a Proximity Selector. See the Interaction Tutorial. You can map the Proximity Selector's Use Button to an input that reads from the mouse button or a keyboard/joystick button.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Questions for operating with mouse only

Post by gaku2_sigehiro »

Where can I try using the selector as a sample?
There's no response when I press any button on the gamepad, so I'm only able to understand the controls on the UI.
Is there perhaps a sample other than the one with two characters' faces side by side?
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Questions for operating with mouse only

Post by gaku2_sigehiro »

By the way, the following two processes have already been implemented, so there is no need for an answer on how to create them.

- On a controller or keyboard, start the conversation by pressing the start conversation button when you enter the conversation range. (Normal behavior?)

The problem will be resolved if the dialog system allows you to start a conversation by left-clicking on the other party while you are within range of the other party.

If that is not possible, I would like to adjust it by holding down the left click to start the conversation. However, I briefly tried that, but even if I put long-press or double-click processing in INPUTSYSTEM, the dialog system doesn't behave in conjunction with it, so I'm having trouble implementing it that way.
Currently, whether you press and hold or double-click, the conversation starts on the first click.
I have already created a script that works with INPUTSYSTEM, do I need to modify it?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions for operating with mouse only

Post by Tony Li »

gaku2_sigehiro wrote: Sun Sep 22, 2024 4:34 am- On a controller or keyboard, start the conversation by pressing the start conversation button when you enter the conversation range. (Normal behavior?)

The problem will be resolved if the dialog system allows you to start a conversation by left-clicking on the other party while you are within range of the other party.
If this is what you want, then I will assume that:

1. You have defined an Input System input action to start the conversation -- for example, named "start conversation".

2. You have mapped controller and keyboard inputs to that input action.

3. You are using a Proximity Selector component and have specified the input action in the Proximity Selector's Use Button field.

To allow the player to start a conversation by left-clicking, add the left mouse button to the "start conversation" input action.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Questions for operating with mouse only

Post by gaku2_sigehiro »

- On a controller or keyboard, start the conversation by pressing the start conversation button when you enter the conversation range. (Normal behavior?)
I've already created that behavior.

This is what I want.
- When using the mouse, stay within the conversation range and start the conversation when you click on the other party's object.
We are creating a system where you can left-click and move the screen coordinates so that you can play the game with just a mouse.
Also, I would like to start a conversation by left-clicking, but the dialogue system's left-click looks at the entire screen and starts a conversation, which doesn't work well with movement processing, so I can't create the game I want.
So please tell me the solution.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions for operating with mouse only

Post by Tony Li »

gaku2_sigehiro wrote: Sun Sep 22, 2024 11:28 am
- On a controller or keyboard, start the conversation by pressing the start conversation button when you enter the conversation range. (Normal behavior?)
I've already created that behavior.
How did you create that behavior? Your answer will determine how I can answer.
gaku2_sigehiro
Posts: 36
Joined: Sun Jul 14, 2024 2:35 am

Re: Questions for operating with mouse only

Post by gaku2_sigehiro »

I made it based on a tutorial video where a red-haired person talks to villagers.
The only modification I made from there was to link it to the input system.
Post Reply