Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Loading sounds from lang folder?
IlDucci Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2016
Reputation: 1
#1
Loading sounds from lang folder?

Hi. I'm trying to do a language mod in TDD, and I found out that there's some voices that are not in the lang folder, but in the sounds folder. (Daniel's breathing/jumps/scare voices, some monster dialogue...)

I've tried to make a "sounds" subfolder inside lang\esp(My custom folder)\, but the sounds are still being read from the main sounds subfolder. Is there a way to make the game load those sounds without having to make a custom story mod?

Thank you for your time.
10-24-2016, 10:50 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Loading sounds from lang folder?

The way file loading works in Amnesia is that it checks the "resources.cfg" file for each entry present. It looks through all those folders (and subfolders if AddSubDirs="True") listed in order until it finds a file with the specified filename (regardless of the file path).

If you have a file named mysound.ogg within the lang folder and another file named mysound.ogg within the sounds folder, it will find and use the first one it can locate, based on the resources file. If the resources list "/lang" first, it will find the first file. If it lists "/sounds" above the lang folder, it will find the second file instead. Once it finds a file, it stops searching for it, basically ignoring any duplicates.

Your solution is probably to edit the resources.cfg file.

Anyway, are you trying to do a language mod, as in a custom voiceover in another language? Are you trying to override the player's "breathing/jump/scare" sounds as well? Ideally (of course) your mod shouldn't overwrite any present files, but rather load them differently. I haven't looked at how the voiceovers are done, so I'll have to investigate to give a more accurate answer.

(This post was last modified: 10-24-2016, 11:32 AM by Mudbill.)
10-24-2016, 11:31 AM
Find
IlDucci Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2016
Reputation: 1
#3
RE: Loading sounds from lang folder?

(10-24-2016, 11:31 AM)Mudbill Wrote: The way file loading works in Amnesia is that it checks the "resources.cfg" file for each entry present. It looks through all those folders (and subfolders if AddSubDirs="True") listed in order until it finds a file with the specified filename (regardless of the file path).

If you have a file named mysound.ogg within the lang folder and another file named mysound.ogg within the sounds folder, it will find and use the first one it can locate, based on the resources file. If the resources list "/lang" first, it will find the first file. If it lists "/sounds" above the lang folder, it will find the second file instead. Once it finds a file, it stops searching for it, basically ignoring any duplicates.

Your solution is probably to edit the resources.cfg file.

Anyway, are you trying to do a language mod, as in a custom voiceover in another language? Are you trying to override the player's "breathing/jump/scare" sounds as well? Ideally (of course) your mod shouldn't overwrite any present files, but rather load them differently. I haven't looked at how the voiceovers are done, so I'll have to investigate to give a more accurate answer.

Yeah, we're doing a full Castilian Spanish voiceover (It's 99% complete) and I'd hoped to put things in the lang\esp folder, avoiding the overwrite of the sounds folder. (I'm the technical guy, the voice director is somebody else) I'll try the resources thing.

EDIT: The lang folder is actually absent from the resources.cfg file.
(This post was last modified: 10-24-2016, 11:42 AM by IlDucci.)
10-24-2016, 11:40 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Loading sounds from lang folder?

Okay then I think the next step is to find out how the original game plays the voice files for the other languages. Try to look at the script for the main_hall map or perhaps check the .flash flashback files. Look for how it references the files. That info would be useful.

I'd do it myself but I'm not at home atm.

10-24-2016, 12:48 PM
Find
IlDucci Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2016
Reputation: 1
#5
RE: Loading sounds from lang folder?

(10-24-2016, 12:48 PM)Mudbill Wrote: Okay then I think the next step is to find out how the original game plays the voice files for the other languages. Try to look at the script for the main_hall map or perhaps check the .flash flashback files. Look for how it references the files. That info would be useful.

I'd do it myself but I'm not at home atm.
I've done some extra research, and it's not good: If I put the player and react effects inside the lang\esp folder, they won't play (As the ones in the sound folder seems to have priority). I have to delete the ones in the sounds folder to force them being read from lang\esp.

I've searched a bit some of the original sounds that are not flashbacks nor diary events (For example, 22_start_daniel): They are removed from the sounds folder, yet there is a .snt file. I guess that's how Frictional did it: Any file that was to be voiceovered was removed from sounds and taken into lang.
(This post was last modified: 10-24-2016, 12:53 PM by IlDucci.)
10-24-2016, 12:49 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Loading sounds from lang folder?

Well, since the lang folder contains nothing but .ogg files (from the audio aspect), you're not gonna be able to change the output just by adding more. I think we need to inspect exactly what changes when the user set the language to Russian, as that's the only language that also changes the voices. There has to be a "path" of sorts, that is changed somewhere.

Edit: I found this in "russian.lang" in /config/lang_main.

PHP Code: (Select All)
<RESOURCES>
    <
Directory Path="fonts/rus" />
    <
Directory Path="lang/rus" />
</
RESOURCES

So to add your paths to "esp" AKA Spanish, you'll need to open the spanish.lang file and edit the resources tag.
Change only the "lang/eng" to "lang/esp" and you're good. This won't override player sound effects, but it'll change voices.

(This post was last modified: 10-24-2016, 09:21 PM by Mudbill.)
10-24-2016, 09:09 PM
Find
IlDucci Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2016
Reputation: 1
#7
RE: Loading sounds from lang folder?

Already done. All that was left was those effects.

You were right. The only way to do that is editing the resources.cfg file. Guess I'll have to include a copy with the installer/Steam Workshop files.

Thanks for the help.
10-24-2016, 09:55 PM
Find




Users browsing this thread: 2 Guest(s)