how Play AudioWaitOnce(entrytaglocal) from script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
w4der
Posts: 14
Joined: Sun Dec 19, 2021 12:07 pm

how Play AudioWaitOnce(entrytaglocal) from script

Post by w4der »

Hi,
How can I play Sequencer command from script. When dialogue is not started.

Use case:
Player is walking, he enter trigger and the AudioWaitOnce is invoked and the player says "Bla bla bla ;)"


Scene setup:
I have QuestControl, that controls the QuestSControl.SendToMessageSystem Explored:Stairs message.
I would like to add the audio that is localized.
w4der
Posts: 14
Joined: Sun Dec 19, 2021 12:07 pm

Re: how Play AudioWaitOnce(entrytaglocal) from script

Post by w4der »

ok,
found solution ;)

Code: Select all

    public void PlayAudioWaitOnce(string audioClipName)
    {
        DialogueManager.PlaySequence($"AudioWaitOnce({audioClipName})");
    }
w4der
Posts: 14
Joined: Sun Dec 19, 2021 12:07 pm

Re: how Play AudioWaitOnce(entrytaglocal) from script

Post by w4der »

But the above code doesn't work with localization package. Without it it works properly.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: how Play AudioWaitOnce(entrytaglocal) from script

Post by Tony Li »

Hi,

What do you mean? Does the problem have compile errors? Does it log errors when you play? Does it work with the default language but not with localization?
w4der
Posts: 14
Joined: Sun Dec 19, 2021 12:07 pm

Re: how Play AudioWaitOnce(entrytaglocal) from script

Post by w4der »

Hi,
I added the unity localization package and it works very good with the Dialogue Sequences with entrytaglocal.
It doesn't work with the code below, because it doesn't add the locale identifier as it is done with the entrytaglocal.

Code: Select all

DialogueManager.PlaySequence($"AudioWaitOnce({audioClipName})");

But I found solution and I add the locale identifier by my own. The code below works properly.

Code: Select all

 var locale = LocalizationSettings.SelectedLocale;
 DialogueManager.PlaySequence($"AudioWaitOnce({audioClipName}_{locale.Identifier.Code})");
I hope this post one day help somebody.
Attachments
Screen_00241.png
Screen_00241.png (48.48 KiB) Viewed 224 times
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: how Play AudioWaitOnce(entrytaglocal) from script

Post by Tony Li »

Thanks for sharing.
Post Reply