Jump to content

Creating a vsay .pk3 - Enemy Territory


Saizou

Recommended Posts

Before we start, I'd like to point out that this is my first tutorial and it has been put together in matter of hours, so please point out anything that I have missed or anything you would like to have covered in more details. Also English is not my primary language so point out any weird sentence constructions or anything ambiguous that you may find. I have removed some outdated and conflicting stuff regarding audio processing so it should be good now.

This tutorial doesn't cover how to put it on a server or ensure that players playing on your server have it, as I don't know how it's done.

Most of these stuff I have figured out by opening the F|A soundpack that is used on servers. It provides great insight how the whole thing is organized and done. I recommend exploring it after you have finished reading the tutorial, so you see how the actual working scripts look like.

 

First off, you will need 3 small programs to use:

-most important one - Pakscape, which will enable you to create and open already existing .pk3 files (which are similar to .zip files), you can get it here.

-an audio editing software: Baska showed me a program that has everything you need for editing .wavs: Wavosaur, it's simple to use and you should have no problems using it. You can get it here.

-and a text editor where you will be able to edit scripts, I used Notepad++ (also great for editing your configs), you can get it here.

Of course the last 2 are just one of many that can be used, but those 2 are free and should do the job.

A little update done by Kai which simplifies the process even more, you can do the third step with a tool you feel comfortable with:

Instead of using Pakscape, you could also just zip the folders using your favorite ZIP-Tool and rename the outcoming .zip file to .pk3 afterwards.

First step in creating vsays is to get the material you want, basically you need to get your hands on sounds you want to be able to play in .wav format.

Wavosaur here comes in handy as you can convert any part of your favourite .mp3 song (or anything you wish to convert) in .wav format just by selecting which part of the song you want (click and drag, your pointer should look somewhat like capital I)and then go File->Save selection as...

post-23508-0-60988900-1522452439_thumb.jpg

1. pic: Selecting the desired part.

 

 

post-23508-0-11231600-1522452440_thumb.jpg

2. pic: Saving the file.

 

When you save it give it a name that you'll use to identify that .wav in scripts. Easy as that. I have named the test clip I made ffxtest.wav, you will see that name later show up in scripts. Also note that size matters here so long clips will result in large .pk3 file which is a pain to download and distribute if you want to use it on server. I'm not sure if there's a limit how large can one .wav file be, but due to before mentioned reason you most likely won't have to find out. Mostly the .wav files that you'll be able to get your hands on will be 441000Hz sampling rate, and they will be rather large but after conversion to 16000Hz they should be smaller.

VERY, VERY IMPORTANT NOTE: For the vsays to work all files must be at 16000Hz sampling rate (Process->Resample), 8 bit depth (Process->Bit depth converter) and they must be mono (Process->Convert to mono->Mix all channels). If you have a stereo .wav just merge the tracks to get a mono one, as described in the previous sentence.

 

post-23508-0-61412700-1522452440_thumb.jpg

3.pic: Process menu and the tools you'll need, note the sampling rate, bit depth and mono/stereo info about the clip just under the window with the sound graph

 

It might be a good idea to organize those .wav files into subfolders so you can avoid the mess. I put this newly created .wav into music folder which is in sound folder. You will see how this impacts the scripts later. Now create a folder named sound and put all the .wav files into it (or folders if you have organized them).

 

Second step is to create scripts separately for Allied and Axis side as they don't use the same basic vsays. The script you will add however is the same for both sides so once you finish creating that part you just have to copy it to the script for the other side. You will also have to create the menu layout so you will see all the vsays categories when you press "v" ingame so you can actually play those sounds. I have attached the both Allies and Axis stock vsays so you don't have to go through your pak0.pk3 to find them (IMPORTANT: never mess with .pk3 that come with stock ET as most likely PB will recognize it as a hack, make a copy them somewhere else and then explore them with Pakscape, be sure not to accidentally switch them). And don't rename those files I attached, just change their content but not their name or else the whole .pk3 won't work.

 

scripts.zip

 

So here goes:

Open one of those scripts (wm_allies_chat.voice or wm_axis_chat.voice, let's open the Allied one, though it doesn't matter) and you'll recognize the name of the vsays organized into groups (wm_quickstatements, wm_quickrequests, etc). The lines that start with // are comments and do not effect the script itself, they are more like a guide and help you see more easily where each vsay will go later in the menu. Let's take the first one for example, Path Cleared:

PathCleared
{
sound/chat/allies/11a.wav "Path cleared."
sound/chat/allies/11b.wav "Path cleared."
}
You see the name PathCleared is followed by the {} brackets, the contents inside these brackets determine file paths to sounds to be played and text to be displayed. You will that when you play this vsay one of 2 sound files will be chosen randomly and played with accompanying text. For better illustration find the Cheer vsay in the script and you'll see how it differs. Now that we know this we can add our own vsays. Add something like:

////////////
//my vsays//
////////////
so you or anyone else that will later look at it know where your vsays start. Then using that .wav I created before we would add lines like this (very important: note the path to the .wav file, if you have used subfolders in the sound folders to keep yourself organized, you MUST put the full path to the file when you are defining a vsay):

song1
{
sound/music/ffxtest.wav "Music playing."
}
So when I would select my vsay it would play the clip and text would display "Music playing".

Note that we have only one line so it will always play that one sound clip when we choose that vsay. Again if there are more lines, only one sound clip will be played which was chosen randomly by the game. Define all the other vsays like we did this one and when you are finished copy the whole added part to the other script (in this case we would copy to the Axis script as we opened the Allied one, remember?). You can also add and remove lines from already existing vsays, so you can add more lines to Cheer menu for example for more sounds to be chosen from. Now that you have edited both scripts put them in a folder called scripts and put that folder somewhere near the sounds folder that created before (it doesn't have to be near but this is to keep yourself organized). We have the .wav files, we have the scripts and now we have to create a menu (or modify the stock one). I have attached it to the tutorial so you don't have to dig it up (that 3rd file in the attached .zip called wm_quickmessagealt.menu). Now open the attached file, ignore the first 83 lines (they actually define what the other part of the file does) and you should recognize the vsay menu that pops up when you press "v":

QM_MENU_START( "wm_quickmessageAlt" )

QM_MENU_ITEM_TEAM( "1. Statements", close wm_quickmessageAlt; open wm_quickstatements_alt, "1", 0 )
QM_MENU_ITEM_TEAM( "2. Requests", close wm_quickmessageAlt; open wm_quickrequests_alt, "2", 1 )
QM_MENU_ITEM_TEAM( "3. Commands", close wm_quickmessageAlt; open wm_quickcommand_alt, "3", 2 )
QM_MENU_ITEM_TEAM( "4. Talk", close wm_quickmessageAlt; open wm_quickmisc_alt, "4", 3 )
QM_MENU_ITEM( "5. Global", close wm_quickmessageAlt; open wm_quickglobal_alt, "5", 4 )
QM_MENU_ITEM_TEAM( "6. Function", exec "wm_sayPlayerClass"; close wm_quickmessageAlt, "6", 5 )
QM_MENU_ITEM_TEAM( "7. Objectives", close wm_quickmessageAlt; open wm_quickobjectives_alt, "7", 6 )

QM_MENU_END
So now you recognize all those menu names as you have seen them before in the scripts, in scripts they were a guide which vsay will be selected via which menu so if you compare the menus and organization in the scripts you'll see they are the same. Ok, now to analyze what this bunch of lines mean.

QM_MENU_START( "wm_quickmessageAlt") is the first line when you are defining a new menu, the wm_quickmessageAlt is the name of the menu we are defining, and which is used to identify which menu to open and close). This being the stock menu we see that the menu when we press "v" is named wm_quickmessageAlt. Now note the last line, QM_MENU_END is the last line in defining a menu and don't forget to put it when you are creating your own menu. Those lines in between determine the contents on the menu. You see they are defined with those QM_MENU_ITEM_TEAM and QM_MENU_ITEM lines with parameters in between. So what does each parameter mean?

Let's take the first line

QM_MENU_ITEM_TEAM( "1. Statements", close wm_quickmessageAlt; open wm_quickstatements_alt, "1", 0 )
"1.Statements" is the text which will be displayed in the menu, close wm_quickmessageAlt and open wm_quickstatements_alt are actions which will be performed when that menu option is triggered, you can see it will close the main vsay menu and open the statements menu. "1" is the key with which that option will be selected, and 0 is the position on which that menu option will be located (note that the first line has a menu position of 0 and not 1). I don't know the difference between QM_MENU_ITEM_TEAM and QM_MENU_ITEM as they do the same thing but they are probably named differently to help keep stuff organized. Note that all menu options use the QM_MENU_ITEM_TEAM except for fifth line "5. Global" which is played in global chat as we know from experience.

 

Now let's take a look at global menu:

QM_MENU_START( "wm_quickglobal_alt" )

QM_MENU_ITEM( "1. Yes", exec "VoiceChat Affirmative"; close wm_quickglobal_alt, "1", 0 )
QM_MENU_ITEM( "2. No", exec "VoiceChat Negative"; close wm_quickglobal_alt, "2", 1 )
QM_MENU_ITEM( "3. Enemy Weak", exec "VoiceChat EnemyWeak"; close wm_quickglobal_alt, "3", 2 )
QM_MENU_ITEM( "4. Hi", exec "VoiceChat Hi"; close wm_quickglobal_alt, "4", 3 )
QM_MENU_ITEM( "5. Bye", exec "VoiceChat Bye"; close wm_quickglobal_alt, "5", 4 )
QM_MENU_ITEM( "6. Great Shot", exec "VoiceChat GreatShot"; close wm_quickglobal_alt, "6", 5 )
QM_MENU_ITEM( "7. Cheer", exec "VoiceChat Cheer"; close wm_quickglobal_alt, "7", 6 )
QM_MENU_ITEM( "8. More Globals", close wm_quickglobal_alt; open wm_quickglobal2_alt, "8", 7 )

QM_MENU_END
Now you can see that save for different choices and names that the only difference is in actions that it performs. Global menu actions consisted of closing itself and opening a new menu, while a menu like Global actually plays the very vsay and closes itself. Also note the name of the menu in the first line and compare it to the previous menu, you'll see that it is called by selecting the fith line in the first menu. Let's take the frist line again:

QM_MENU_ITEM( "1. Yes", exec "VoiceChat Affirmative"; close wm_quickglobal_alt, "1", 0 )
"1. Yes" is the text that will be displayed, exec "VoiceChat Affirmative"; close wm_quickglobal_alt are the actions that will be performed. exec "VoiceChat Affirmative" is the thing that plays the very vsay. Affirmative is the name of the vsay which you can find in one of the scripts. Also note that exec "VoiceChat Affirmative" would play in global chat while exec "VoiceTeamChat Affirmative" would play in team chat. Again "1" is the key which selects the menu option and 0 is the position of the line in our menu. Now it's time to modifiy the vsay menu that opens first and add our own. The first menu should look something like this:

QM_MENU_START( "wm_quickmessageAlt" )

QM_MENU_ITEM_TEAM( "1. Statements", close wm_quickmessageAlt; open wm_quickstatements_alt, "1", 0 )
QM_MENU_ITEM_TEAM( "2. Requests", close wm_quickmessageAlt; open wm_quickrequests_alt, "2", 1 )
QM_MENU_ITEM_TEAM( "3. Commands", close wm_quickmessageAlt; open wm_quickcommand_alt, "3", 2 )
QM_MENU_ITEM_TEAM( "4. Talk", close wm_quickmessageAlt; open wm_quickmisc_alt, "4", 3 )
QM_MENU_ITEM( "5. Global", close wm_quickmessageAlt; open wm_quickglobal_alt, "5", 4 )
QM_MENU_ITEM_TEAM( "6. Function", exec "wm_sayPlayerClass"; close wm_quickmessageAlt, "6", 5 )
QM_MENU_ITEM_TEAM( "7. Objectives", close wm_quickmessageAlt; open wm_quickobjectives_alt, "7", 6 )
QM_MENU_ITEM( "8. My vsays", close wm_quickmessageAlt; open wm_myvsays, "8", 7 )

QM_MENU_END
Then our new menu would look like:

QM_MENU_START( "wm_myvsays" )

QM_MENU_ITEM( "1. A song in global", exec "VoiceChat song1"; close wm_myvsays, "1", 0 )
QM_MENU_ITEM( "2. A song in team", exec "VoiceTeamChat song1"; close wm_myvsays, "2", 1 )

QM_MENU_END
There are 2 vsays which play the same thing but one plays it in global and on in team chat just for demonstration.

And that's it. Save the file and put it in the ui folder which you can put next to the sound and scripts folders.

 

Third step and the last step is fairly easy, you only have to pack it togheter using Pakscape into single .pk3 that you can distribute around.

So just open Pakscape, go File->New and just drag and drop the 3 folders you made: scripts, sound and ui folder. You can also add a short readme.txt file where you can put comments, remarks, notes or thoughts that you wish to pass on to the users of the .pk3. Then just go File->Save as and you have your own .pk3 file. You can see how it should look like in the end if you did it right.

 

post-23508-0-87937200-1522452441_thumb.jpg

4. pic: How it looks in the end.

 

So after you armed with knowledge to make them, have fun creating your soundpacks.

Thanks for reading smile.gif

Edited by Fearless Staff
Link to comment
Share on other sites

nice tutorial Saizou!! i just have some doubts regarding the wav file:

 

*Does wolfenstein can handle WAV codecs for compressing the file or does it has to be a RAW WAV file(PCM)?

 

*Does the WAV file has to be in stereo or mono?

 

*What's the the sample rate that most people use in their WAV for vsays (for example: the jay2 vsays' sample rate)

 

*What's the ideal bit depth? (8 bits,16 bits,24 bits)

 

 

EDIT: nevermind i got it now :D

:thanks

Link to comment
Share on other sites

Just a little addition: Instead of using Pakscape, you could also just zip the folders using your favorite ZIP-Tool and rename the outcoming .zip file to .pk3 afterwards.

I have added to the tutorial plus a minor update at first step. I have also added something on compression and sizes as I have just figured it out.

 

@Acid: I think only .wav files are permitted, and it doesn't matter if it's mono or stereo. It's 8000Hz in Jay2 soundpack and I don't think bit depth also matters.

If anyone knows something more about .wav compression please do tell.

 

Thanks to everyone for the feedback :)

Link to comment
Share on other sites

I have added to the tutorial plus a minor update at first step. I have also added something on compression and sizes as I have just figured it out.

 

@Acid: I think only .wav files are permitted, and it doesn't matter if it's mono or stereo. It's 8000Hz in Jay2 soundpack and I don't think bit depth also matters.

If anyone knows something more about .wav compression please do tell.

 

Thanks to everyone for the feedback :)

 

I didn't read the whole sorry but Thanks for your tutorial finally Baska can do her sound pack without need to wait for my reply :lol:

 

for wav compression you can use Wavosaur

 

Watch from minute -> 1m 48second for compression

http://www.youtube.com/watch?v=npSFEeUgIPs

Link to comment
Share on other sites

Beautiful job Saizou.

 

Just a couple of comment.

 

1. Personally I prefer using Wavosaur to Audacity. Granted this is a personal preference but I really can't thank Medic enough for turning me on to this program. Either one will do just great and they are both free. For those that are new to these programs, expect to take about 5-10 minutes to figure out the layout of the UI.

 

2. I use a free program called 7Zip. It allows me to right click on existing .PK3's, open them without unpacking and play .wav files so I don't have to unpack the entire file if there is perhaps one thing I want to test or a sound effect I want to use. Also it makes it easier (IMO) for me to just compress the folder/subfolders I'm working out in the sound pak and then rename it to .pk3 than to use pakscape. Again this is a personal preference and sometimes my methodology is weird. ;P

 

3. compression vs quality. IT's all about how big of a file you think people would be willing to download. You can still get a great sound with some fairly high compression, just make sure your original .wav was of the highest quality. If you compress an already bad quality sound, it makes it sound even worse. I discovered this with one of my more recent soundpacks when someone gave me a low quality mp3 that when made to a compressed .wav format, sounded very quiet and scratchy.

 

4. +1 on notepad++, noone attempting to edit cfg's should be without it.

 

5. only .wav files are permitted, and from my understanding they need to be mono (plus it makes the file size smaller).

Link to comment
Share on other sites

Thanks for the feedback as I'm still learning on this stuff myself, especially on .wav files. I chose Audacity because I messed with it before, long time ago and it was fairly easy to use. Pakscape only came naturally as a choice as I used it the first time I had to work with .pk3s so I stuck with it. I use 7z myself too for all the .rar , .zip and all the other stuff, just didn't know it was compatible. I have to test out the mono/stereo part in the game itself, but I think it didn't affect the size of the .wav (I have to recheck it). In the end size is more important than quality but I completely agree that you should take the best quality source you can get.

 

I'll add your comments to the tutorial if you don't mind (with credits)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.