Play different audio clips for character and NPC

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
EmmaC
Posts: 5
Joined: Tue Jan 16, 2024 7:02 am

Play different audio clips for character and NPC

Post by EmmaC »

I am using the JRPG standard dialog template for a simple conversation (no choices) between player and NPC. I am trying to use 2 different sets of audio clips for the 2 characters via the unity UI typewriter effect. As the subtitle text is shared between the 2 characters I am not able to differentiate the 2 characters and can only use one set of audio clips for both. Could someone nudge me in the right direction to achieve this please? Thanks in advance
EmmaC
Posts: 5
Joined: Tue Jan 16, 2024 7:02 am

Re: Play different audio clips for character and NPC

Post by EmmaC »

Thanks for the swift reply. How do I set the subtitle panel number?
Make a copy of the subtitle panel for each character, and assign them to the Standard Dialogue UI's list of subtitle panels. Add a Dialogue Actor component to each character, and select the subtitle panel number to use (e.g., 0 for male, 2 for female, etc.). Then customize that subtitle panel's typewriter effect.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play different audio clips for character and NPC

Post by Tony Li »

Hi,

You can use the [panel=#] markup tag in a dialogue entry's Dialogue Text, or use the SetPortrait() sequencer command in the Sequence field.
EmmaC
Posts: 5
Joined: Tue Jan 16, 2024 7:02 am

Re: Play different audio clips for character and NPC

Post by EmmaC »

Sorry Tony I still don't quite understand how to set a panel number. I am trying to use 2 subtitle panels so I can maintain different typewriter effects for player and NPC. At the moment, when the NPC starts the conversation, the player subtitles appear while NPC subtitles remain on screen. I am assuming this is because I have not set the subtitle panel numbers and therefore cannot refer to the correct subtitle panel number in the relevant dialog actor components.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play different audio clips for character and NPC

Post by Tony Li »

Hi,

Inspect your subtitle panels and set the Visibility dropdowns to Until Superceded. (Or Until Superceded Or Actor Change Or Response Menu.) When one subtitle (e.g., PC) starts playing, it will hide other panels that are set to Until Superceded (NPC).
EmmaC
Posts: 5
Joined: Tue Jan 16, 2024 7:02 am

Re: Play different audio clips for character and NPC

Post by EmmaC »

That solved my problem! Thank you so much!
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play different audio clips for character and NPC

Post by Tony Li »

Glad to help!
Post Reply