Author Topic: Adding voicing to your mod  (Read 4411 times)

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Adding voicing to your mod
« on: January 07, 2005, 11:26:59 AM »
Saw this, and realised that I hadn't posted this tutorial here. So, here it is. :)

Programs needed.
WeiDU
Ogg Vorbis decoder
Text editor

How to record a voiceclip?
See here.

Attaching the voiceclip to the mod.
For this we need to get into the .d-file (or the .tra, in case you use it) and add a few things. After every string you wish to have voiced, you need to add the appropriate soundfile within []-tags, but without the .wav-extension.

Example:
Code: [Select]
~This is the string~ [clip][clip] refers to the file clip.wav, a file which must be located in the override-directory.

For a little longer example of a .d-structure, watch this example from the Hubelpot-mod:

Code: [Select]
IF ~NumTimesTalkedTo(0)~ Hub
SAY ~Excuse me mah <LADYLORD>, but Ah was wonderin’ if Ah might hae a word with ye. Ye hae the look o’ the gallowglass, an Ah could surely use yer help.~ [SC#Hub57]
++ ~Of course good merchant. How may we assist?~ + Hub_2
END
Here, [SC#Hub57] refers to the file SC#Hub57.wav.

A .tra-example:

Code: [Select]
@1 = ~Excuse me mah <LADYLORD>, but Ah was wonderin’ if Ah might hae a word with ye. Ye hae the look o’ the gallowglass, an Ah could surely use yer help.~ [SC#Hub57]
@2 = ~Very well, mah <LADYLORD>. Ah am sore in need, and shall wait an’ hope ye’ll change yer mind.~ [SC#Hub59]
Here, [SC#Hub57] refers to the file SC#Hub57.wav and [SC#Hub59] refers to the file SC#Hub59.wav. As I mentioned before, these files needs to be in the override directory.

How to get them there? Well, follow the next step:

The .tp2.
Most mods have a single folder where all of the soundfiles are stored in. If this is the case, it is easy to implent a single:

Code: [Select]
COPY ~mymodfolder\Audio~ ~override~into the .tp2. This will copy all files from the Audio-folder into the override. Simple as that.

.ogg or .wav?
Most mods today come with .ogg-files, to keep the overall size of the mod down. The game, however, can't play .ogg-files, which mean that we need to decode the .ogg-files into .wav-files. This is the tricky part, since it involves several steps.

First, we must add a file named oggdec.exe. It is located in the Ogg Vorbis-decoder at the top of this tutorial. Secondly, we need to place this oggdec.exe in the same folder as the soundclips, the Audio-folder.

Secondly, we need to create two .bat-files (one install and one uninstall), which you can edit with any text-editor.

The install.bat will look like this:

Code: [Select]
@echo off
cd override
oggdec SC#Hub*.ogg
del SC#Hub*.ogg
del oggdec.exe
cd ..
This short .bat-file will tell oggdec.exe to decode all .ogg files that begin with SC#Hub, which means SC#Hub57.ogg and SC#Hub14.ogg, etc. After that, the .bat-file will delete all .ogg-files it has decoded, and the oggdec.exe.

The uninstall.bat is even shorter:

Code: [Select]
del override\SC#Hub*.wav
@ECHO
@ECHO Hubelpot Audio Uninstalled
@ECHO
This .bat-file will delete all .wav files that begin with SC#Hub, the same files as it decoded previously. We do this since WeiDU won't delete these files, like the other files in the mod. Why? Well, WeiDU has no memory of these files, since it copied over .ogg-files at install, and not .wav. After that, it will show the string "Hubelpot Audio Uninstalled" in the DOS-prompt-screen at uninstall.

But things isn't over yet, we need to add a few lines to the .tp2:

Code: [Select]
COPY ~SC#Hub\Install.bat~ ~Install.bat~
AT_INTERACTIVE_EXIT ~Install.bat~
AT_UNINSTALL ~Uninstall.bat~
The first line instructs WeiDU to copy the Install.bat-file to the main BGII-directory, where it needs to be. The second lines instructs WeiDU to execute the Install.bat at interactive exit, when the user presses the [ENTER] button at install. The third line instructs WeiDU to execute the Uninstall.bat at uninstall of the mod.

Now, this requires two things. The Install.bat must be in the folder where you have specified it to be. This isn't difficult, since you can change that to any folder you want, as long as the line in the .tp2 matches. The other thing is more crucial, though. The Uninstall.bat must be in the same directory as the setup.exe and the .tp2, i.e. the main BGII-directory. We can't copy it over with WeiDU as we do with the Install.bat, since WeiDU would reverse that action at uninstall, before it would even be executed to remove the files.

Good luck modding!

© Copyright Sebastian Conrad 2004(/05).
« Last Edit: June 27, 2005, 10:00:32 AM by Bons »
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: