Page 1 of 1

Game to Dialogue

Posted: Mon Jul 22, 2024 9:49 am
by AvivXR
Hi,
The game is going great and I am starting to get the hang of the dialogue system,
I wish to connect the mini-games and the conversation better.
Currently, I can start a minigame inside the conversation and get back to the conversation once the game is done.
I wish to have the character comment inside the game...
To simplify. let's say I have a mini-game with 3 buttons.
for each button press, I want the character to say a certain comment
Once all buttons are pressed I will close the game and continue with the conversation.
Any tips on how to arrange this?
Thank you so much

Re: Game to Dialogue

Posted: Mon Jul 22, 2024 10:53 am
by Tony Li
Hi,

The simplest way to do this might be to have the character show a bark during the minigame. (Make sure to tick the Dialogue Manager's Display Settings > Bark Settings > Allow Barks During Conversations.) This won't interrupt the conversation, which you can resume at the end of the minigame.

Re: Game to Dialogue

Posted: Mon Jul 22, 2024 1:37 pm
by AvivXR
Thanks. It sounds like a plan.

But how can I bark from my Unity script in 2D visual novel?
(I am making a 2D visual novel script so I can't use proximity and I don't have transform. I simply have two subtitle panels) .

Re: Game to Dialogue

Posted: Mon Jul 22, 2024 2:39 pm
by Tony Li
If it's from a script, use DialogueManager.Bark() to bark from a conversation or DialogueManager.BarkString() to bark a string. Example:

Code: Select all

using PixelCrushers.DialogueSystem; // Put at top of script.
...
DialogueManager.Bark("Call Your Bluff", npc1.transform);
[/code]

Re: Game to Dialogue

Posted: Mon Jul 22, 2024 3:10 pm
by AvivXR
Thanks. Though I tried it, I didn't know how to reference my subtitle panel and it didn't show any text. (what is npc1)
Maybe I can try to use condition - send a variable (button pressed) to the dialogue and use it as a condition - this way all the text will stay in the db (and I can use audio recordings)?

Can I send variables to the conversation and control its flow?

Re: Game to Dialogue

Posted: Mon Jul 22, 2024 3:55 pm
by Tony Li
You can send variables, but it might be simpler to get barks working. Here are some tips:

1. Your character needs a bark UI. For example, add an instance of the Basic Standard Bark UI prefab as a child of the character. You can change the canvas from World Space to Screen Space if you prefer. It's basically just plain old Unity UI, so feel free to style it however you want. (See Bark Tutorial)

2. In my example code above, npc1 refers to the character's GameObject. Use whatever value is appropriate in your case. If you know it's the conversation's conversant, you can use DialogueManager.currentConversant.