Jump to content

Installing audio for different languages


Meira

Recommended Posts

Amber has now been translated to German and on top of that Fey & co. have provided a German soundset for Amber. :rant:

 

So, I would need a bit of code for tp2 that copies different set of audio files to the override, depending on which language the user chose. I know how to set up the language options, but the 'if language X was chosen the do this and if Y was chosen then that', is something I have no idea how to do.

 

I know that you can do a list of available options and have the user choose from them (ala 'where you want to find Alora?' in BG1 NPC Project). But since I already know what the user wants (English/German), that seems an unnecessary step.

 

Any ideas?

Link to comment

This worked for us on another project with different language sounds:

 

Top of tp2:

 

LANGUAGE ~English~
	 ~english~
	 ~taerom/english/setup.tra~

LANGUAGE ~German (translated by Jastey)~
	 ~german~
	 ~taerom/german/setup.tra~

 

Somewhere during tp2 before running the sound.bat to convert ogg:

 

ACTION_IF ("%LANGUAGE%" STRING_COMPARE "german" = 0) THEN BEGIN COPY ~taerom\german\bwTAER01.ogg~ ~override\bwTAER01.ogg~ END
ACTION_IF ("%LANGUAGE%" STRING_COMPARE "english" = 0) THEN BEGIN COPY ~taerom\english\bwTAER01.ogg~ ~override\bwTAER01.ogg~ END

 

This way you don't need to change your audio.bat file so long as the sound files are prefixed similarly. You don't need to COPY each soundfile individually, we just happened to be using 1 or 2 sounds.

 

Jastey gets credit for most of this code.

 

Note: There may be a new and fancier way of doing this!

Link to comment

I'd put sound files in my_mod_path/sounds/english, my_mod_path/sounds/german..., then I'd do it as follows:

 

ACTION_IF FILE_EXISTS ~my_mod_path/sounds/%LANGUAGE%/file01.ogg~ THEN BEGIN
 COPY ~my_mod_path/sounds/%LANGUAGE%~ ~override~
END ELSE BEGIN
 PRINT ~There are no soundsets in your language. Do you want to install a different language soundset? (valid choices: English, German, none)~
 ACTION_READLN ~sounds_language~
 ACTION_IF FILE_EXISTS ~my_mod_path/sounds/%sounds_language%/file01.ogg~ THEN BEGIN
COPY ~my_mod_path/sounds/%sounds_language%~ ~override~
 END
END

 

This way, you don't have to copy-and-paste for all languages, and you offer the user to install soundsets in a different language, if he prefers so (you can leave the [sOUNDS] tag in the tra files, the game won't notice if it's missing the WAV files).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...