Page 1 of 2

Combine Proximity Selector and Selector

Posted: Thu Jan 19, 2023 3:51 pm
by Shinos
Hi,
I am in a 2d enviroment and i noticed that when i set an NPC to be interactable when i am near his collider WITH the proximity Selector on my player i can interact with it by both pressing the spacebar and by clicking with the mouse anywhere on screen, BUT if i use the selector i can obviously select it from distance with the mouse.
So i was trying to figure out if it was possible to combine the two to be like this: go near an NPC and have the possibility to both pressing the space bar to interact or clicking on the NPC to start the conversation BUT only when i am near him (i mean not by just clicking anywhere as the proximity selector does, but as it is with the selector )

Re: Combine Proximity Selector and Selector

Posted: Thu Jan 19, 2023 5:01 pm
by Tony Li
Hi,

If you're using only a Proximity Selector, then you can only interact with the NPC when inside the trigger collider, regardless of whether you use keyboard or mouse input to interact.

If you want to restrict mouse clicks further so they only interact if you click on the NPC, you can make a subclass of ProximitySelector and override the UseCurrentSelection() method to check if the mouse is over the NPC. If so, call the base.UseCurrentSelection() method.

Re: Combine Proximity Selector and Selector

Posted: Thu Jan 19, 2023 8:49 pm
by Shinos
Thank you Tony I'll try that!
Also i wanted to ask something about this [HOWTO] https://www.pixelcrushers.com/phpbb/vie ... 333#p22333
i tried to download the package to understand this concept but when i try it , it doesn't work for me:


Also i tried to import this package
"TurnBasedMultipleConversationExample_2017-02-23.unitypackage"
from https://www.pixelcrushers.com/phpbb/vie ... php?t=1019
but when i do and try to play the scene i get this error message
Assets\Dialogue System Examples\Turn Based Multiple Conversation Example\ContinueConversationButton.cs(19,33): error CS7036: There is no argument given that corresponds to the required formal parameter 'dialogueUI' of 'ConversationView.OnConversationContinue(IDialogueUI)'
i was interested in that example because i was trying to understand how to achieve multiple NPCs talking simultaneously with different subtitles panels, like i would like to use bubble panels for the subtitles ui and make more characters say something at the same time so that theeir individual speech bubbles come out from each of their head at the same time

Re: Combine Proximity Selector and Selector

Posted: Thu Jan 19, 2023 9:49 pm
by Tony Li
Hi,

I can update the first example tomorrow if you need it.

The second example is really old, possibly pre-DS 2.x. If it's from DS 1.x, it's not supported in 2.x.

Re: Combine Proximity Selector and Selector

Posted: Fri Jan 20, 2023 2:13 pm
by Shinos
Thank you, it would be great i'm trying to understand how to switch easily between multiple UIs for different purposes.
This would come in hand also because i was trying to use a dialogue UI designed for cutscene sequence in a Timeline where the narrator speaks, or there is a different situation rather than a conversation between two characters.
Oh i understand...so how could i achieve this
i was interested in that example because i was trying to understand how to achieve multiple NPCs talking simultaneously with different subtitles panels, like i would like to use bubble panels for the subtitles ui and make more characters say something at the same time so that theeir individual speech bubbles come out from each of their head at the same time

Re: Combine Proximity Selector and Selector

Posted: Fri Jan 20, 2023 4:15 pm
by Tony Li
I think what you may really be looking for is the Override Dialogue UI component. If you add this component to a conversation's primary actor or conversant GameObject, you can assign a different dialogue UI and the conversation will use that dialogue UI instead of the Dialogue Manager's regular dialogue UI.

The Standard Dialogue UI subtitle panels are designed to show one at a time, or to stay onscreen for the duration of the conversation. If you want multiple characters to show overhead bubbles at the same time, consider using bark UIs. They stay onscreen for the duration set on the bark UI (e.g., 4 seconds). Add a Dialogue Actor to each character, assign a bark UI to it, and set Dialogue UI Settings > Subtitle Panel Number to Bark UI.

Re: Combine Proximity Selector and Selector

Posted: Fri Jan 20, 2023 4:42 pm
by Shinos
Yes! thank you i totally forgot about the override functionality... it solves many issues i was bugging myself into, so that example was to show how to change it by script rather than overriding? if you have the time to manage to get that example work it would be cool to understand how to take advantage of that , wouldn't we get the same result of it by just changing the override setting or there is some scenario that this example covers that i'm missing?

the last thing i was wondering is : if the Standard Dialogue UI subtitle panels are designed to show one at a time, what was the
Turn Based Multiple Conversation Example
about? i didn't quite understand how the Allow Simultaneous Conversations checkbox in other settings works
i'm still referring to this post https://www.pixelcrushers.com/phpbb/vie ... php?t=1019

Re: Combine Proximity Selector and Selector

Posted: Fri Jan 20, 2023 8:35 pm
by Tony Li
I updated the link in the original post. I'll put it here, too:

DS_MultipleDialogueUIs_2021-01-10.unitypackage

(Since the original example, dialogue UIs were improved so they cache subtitle panel info for efficiency. The example scene just needed a line of code to tell it to reset this cache.)

Regarding Allow Simultaneous Conversations, by default the Dialogue System only allows one conversation to play at a time. If a conversation is already active and you try to start another conversation, the second conversation won't start. But if you tick Allow Simultaneous Conversations, the Dialogue System lets you start additional conversations even if other conversations are currently active. Note: Each conversation must use its own dialogue UI. This is where Override Dialogue UI components are useful.

Re: Combine Proximity Selector and Selector

Posted: Sat Jan 21, 2023 1:59 pm
by Shinos
That's awesome, thank you Tony this is the best support i have ever had with an asset.
I am having a wonderful time exploring the dialogue system!

Re: Combine Proximity Selector and Selector

Posted: Sat Jan 21, 2023 2:59 pm
by Tony Li
Thanks! Glad to help!