Skip PC subtitle After Response BUT read/write text

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
michaelheiml
Posts: 46
Joined: Thu Nov 08, 2018 5:47 am

Skip PC subtitle After Response BUT read/write text

Post by michaelheiml »

Hi Tony,

I have one more question, this time a more general one:

I have the PC making choices via Response Panels. I checked "Skip PC Subtitles After Responses" because it feels awkward (doubled) when I first click the response sentence and then see the same text again written/spoken out loud in a speechbubble.

Now this comes with a disadvantage: with NPCs, the speechbubble text is typewriter-animated and spoken out (the whole app is made for kids who might yet not be able to read). But the PC lines aren't written/spoken if I choose the way described above, so the user might never know what he or she actually "said" (selected).

Can you think of a way that for example when I click/tap my choice in the response panel, this text IN the response panel is typewriter-written and spoken (voiceover), like imagine 3 choices, I click/tap one, the 2 other choices disappear and the one I selected stays, is written again (line is cleared and immediately re-written) and voiceover is spoken. After that is complete, the whole Response Panel disappears and the dialogue continues. Basically integrating the speechbubble into the Response Panel. Maybe if too tricky just play the voiceover without re-writing text. What do you think, too complicate to achieve?

Another approach I can think of would be this: I see the 3 choices in the Response Panel. Each choice button has another button on top, like a mouth icon, that basically plays the voiceover file for this line without selecting the answer as choice -> basically I can preview what the choice is even if I cannot read the choices' text (kids!). That might even be a better way than the first approach and easier to implement?

Thanks, Michael
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip PC subtitle After Response BUT read/write text

Post by Tony Li »

Hi Michael,

Let's assume the dialogue UI has a regular screen space subtitle panel named PC Subtitle Panel, and that it is assigned to the Standard Dialogue UI component's Subtitle Panels list as element 1.

Edit your dialogue UI, and position PC Subtitle Panel so it occupies the same screen space as the Response Menu Panel.

UNtick the Dialogue Manager's Subtitle Settings > Skip Subtitle After Response Menu.

Add the markup tag [panel=1] to the response nodes' text. This will make the text appear in the PC Subtitle Panel that you put in the same area as the Response Menu Panel.
michaelheiml
Posts: 46
Joined: Thu Nov 08, 2018 5:47 am

Re: Skip PC subtitle After Response BUT read/write text

Post by michaelheiml »

Hi Toni, thanks for the suggestion and explanation, but after experimenting around I figured that the 2nd approach I've described fits my needs more (basically get a preview before select).

If I keep it simple and just make another button on top of the choice button - is there already some DSFU method somewhere I can call with the new "play voiceover" button to just play the voiceover associated with that database entry?
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip PC subtitle After Response BUT read/write text

Post by Tony Li »

Hi,

You can use DialogueManager.PlaySequence() to play any sequencer command.

You may be interested in the Hover Response Button Example on the Dialogue System Extras page. When you hover the mouse over a response button, it shows a tooltip and activates an indicator GameObject. You can change this to (1) react to click instead of hover, and (2) play an audio file associated with the response's entrytag.

In any case, to get the response's entrytag, use DialogueDatabase.GetEntrytag() and code similar to:

Code: Select all

DialogueEntry entry = GetComponent<StandardUIResponseButton>().response.destinationEntry;
Conversation conversation = DialogueManager.masterDatabase.GetConversation(entry.conversationID);
EntrytagFormat format = DialogueManager.displaySettings.cameraSettings.entrytagFormat;
string entrytag = DiaogueManager.masterDatabase.GetEntrytag(conversation, entry, format);
DialogueManager.PlaySequence($"Audio({entrytag}, SomeAudioSource)");
[Edit: Fixed copy-paste error in EntrytagFormat line.]

If you're localizing audio, use GetEntrytagLocal.
michaelheiml
Posts: 46
Joined: Thu Nov 08, 2018 5:47 am

Re: Skip PC subtitle After Response BUT read/write text

Post by michaelheiml »

Hi Toni and thanks.

For future readers, there is a line missing something, it should look like:
EntrytagFormat format = EntrytagFormat.ActorName_ConversationID_EntryID;

(where entrytag format should be the format setup in your database).
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip PC subtitle After Response BUT read/write text

Post by Tony Li »

Sorry, that was a copy-paste error. I fixed it above.
Post Reply