Show dialogue/description when interaction with scene objects

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
OscarS
Posts: 17
Joined: Mon Jul 17, 2023 1:47 pm

Show dialogue/description when interaction with scene objects

Post by OscarS »

Hi!

I've been using the Dialogue system and I love it so far! Such a good asset.

I would ask for some guidance on this. I have everything set up for conversations with custom UI. But I want when the player interacts for example with a plant, the same UI used for conversation shows up with a description like "This plant is quite thirsty, you should water it". We can say that I want to activate a 1 line conversation. But the problem I encounter is that I don't think that creating a conversation for Items with lots of conditions to choose between them just for 1 line of conversation is the best way to do it. I can't find a way to let's say, call the dialogue system conversation but with only 1 line. For the Dialogue system trigger, I need to specify a full conversation.

Maybe I'm trying to use the dialogue system for something that is not intended, but I prefer to ask first.

Thanks in advance!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show dialogue/description when interaction with scene objects

Post by Tony Li »

Hi,

You could set up a Dialogue System Trigger to show a bark. (See Bark Tutorial) Example:

barkPlant.png
barkPlant.png (36.91 KiB) Viewed 261 times
OscarS
Posts: 17
Joined: Mon Jul 17, 2023 1:47 pm

Re: Show dialogue/description when interaction with scene objects

Post by OscarS »

Hi,
thanks for the reply. I implemented your suggestion and got a coupleof questions.

1.-For the localization I think that I can just use a text table to direct the description of each object and it actually works. But I wonder if there is a way to include the text in other languages on the same Bark Text. just as it can be added on dialogues text through templates.

2.-Since I want to interact with each of object as it was a conversation, I need that the player can't move and also that the bark stays active until the player hits the continue button. But I think barks can only be assigned to be active during a period of time. Is there a way to implement this things for barks?

As extra information, I use barks for other NPC's so I think I can't use on bark start event to do the same that is used onConversation start events.

Thanks in advance!
Greetings
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show dialogue/description when interaction with scene objects

Post by Tony Li »

Hi,
OscarS wrote: Wed Jul 19, 2023 7:02 pm1.-For the localization I think that I can just use a text table to direct the description of each object and it actually works. But I wonder if there is a way to include the text in other languages on the same Bark Text. just as it can be added on dialogues text through templates.
If you assign a text table to the Dialogue Manager's Display Settings > Localization Settings > Text Table, barks will check if the bark text is in the text table. If so, it will use the translation in the bark UI. Similarly, the Selector will check if a Usable object has an entry in the text table. If so, it will show the translation in the Selector UI.
OscarS wrote: Wed Jul 19, 2023 7:02 pm2.-Since I want to interact with each of object as it was a conversation, I need that the player can't move and also that the bark stays active until the player hits the continue button. But I think barks can only be assigned to be active during a period of time. Is there a way to implement this things for barks?
Barks can wait for the continue button. Tick the bark UI's Wait For Continue Button checkbox. Add a continue button to the bark UI, and configure its OnClick() to call the bark UI's OnContinue() method.
OscarS wrote: Wed Jul 19, 2023 7:02 pmAs extra information, I use barks for other NPC's so I think I can't use on bark start event to do the same that is used onConversation start events.
This complicates it. However, it's still possible. The OnBarkStart & OnBarkEnd events are only sent to the barker and the bark target (if specified). On interactable objects such as the plant, add a script with OnBarkStart(Transform) and OnBarkEnd(Transform) that finds the player and disable/re-enables player controls.
Post Reply