Subdirectories for VoiceOverFile

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Subdirectories for VoiceOverFile

Post by nehvaleem »

Hi,
I am using a VoiceOverFile entrytag, to specify my vo files. But there is an issue, I want to have multiple vo languages organized in subfolders like:
Resources/en/LineTagXXXXXX.mp3
Resources/ja/LineTagXXXXXX.mp3

But there is a stripping going on in DialogueDatabase, that prevents me from inputting my entrytags like `en/LineTagXXXXXX.mp`, it is happening due to the:

Code: Select all

entrytagRegex.Replace(voiceOverFile, "_")
Is there anything I can do to bypass that?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subdirectories for VoiceOverFile

Post by Tony Li »

Hi,

What if you set your language in a variable -- e.g., DialogueLua.SetVariable("language", "ja") -- and then use a sequencer command like this:

Code: Select all

AudioWait([var=language]/entrytag)
In this case, your entrytag will just be "LineTagXXXXXX.mp3"
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Re: Subdirectories for VoiceOverFile

Post by nehvaleem »

Theoretically, I could do something like this, but honestly, it seems like a workaround.
I'll need to maintain the current language value in 2 separate places and update it whenever the player changes the language. Is it the best possible solution?

To give you a bit more context: what if I would like to check if a given (translated) version of a voiceover exists and provide some fallback for a given, individual entry? I can do that when setting the VoiceOverField value, but won't be if I'll resort to lua driven language variable.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subdirectories for VoiceOverFile

Post by Tony Li »

I was trying to work with your example, but perhaps the typical way would be better. Typically, you might name your files:

Resources/LineTagXXXXXX_en.mp3
Resources/LineTagXXXXXX_ja.mp3

Then set VoiceOverFile to LineTagXXXXXX, and use the entrytaglocal keyword in your sequence:

Code: Select all

AudioWait(entrytaglocal)
You could make a custom version (maybe subclass) of AudioWait() that checks if the specified audio file exists. If not, then replace the last 2 character (e.g., "ja") with a default value (e.g., "en").
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Re: Subdirectories for VoiceOverFile

Post by nehvaleem »

Actually the custom AudioWait / AudioWaitOnce implementation might be a good fit for me.
Thank you a lot for the outstanding support :)
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subdirectories for VoiceOverFile

Post by Tony Li »

Glad to help!
Post Reply