Problem with a voice-over
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Problem with a voice-over
Hi. I have a problem with a "[message]" tag. When I use "male_voice=" and "female_voice=" with a translatable text to support many languages... it shows me this error:
The voice plays correctly when the message is displayed, but after choosing an option in the message menu - the message disappears, Lua error is displayed and the voice is in infinite loop.
Is using translatable strings in "voice=" allowed by the game engine?
Here is full "[message]" code:
Code: Select all
speaker=unit
message= _ "Show me your wares."
male_voice= _ "TRADE_SHOW_ME"
female_voice= _ "TRADE_SHOW_ME_FEMALE"
wait_description= _ "trading"
Is using translatable strings in "voice=" allowed by the game engine?
Here is full "[message]" code:
Spoiler:
Re: Problem with a voice-over
From my experience, it’s better to avoid using translatable strings directly in male_voice and female_voice. Instead, try hardcoding the voice file names (like "TRADE_SHOW_ME.ogg") and handle translations separately in your script. This usually prevents the infinite loop and Lua errors.
- Celtic_Minstrel
- Developer
- Posts: 2356
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Problem with a voice-over
The mechanism to localize voice tracks is described on the wiki, though that page hasn't been updated in quite awhile. From what I can tell, it works from version 1.16 onwards. In other words, if you set
male_voice=voices/trade_show_me.wav
, you can then add a file voices/trade_show_me.wav
for the English version and (for example) a file voices/l10n/fr/trade_show_me.wav
for the French version.