So thanks again.
A question for Void.
Ive used the city sourcefiles to learn aboyt soundalias and voiseovers.
Vouseovers worked fine for me (made custom ones)
But i cant use custom music with this line:
First of I want to tell you that this is not an easy topic to cover and most likely you will not get it right the first time around so with that in mind
this is going to be a lenghty explanation of how sounds work in cod4. So I hope u read through it all and watch the video as i took the time to
actually write this out and make a video to explain to you how sounds work. So just to give u a brief description of how this is going to go down
is like this:
1. Going through soundaliases and explaining how that works
- Explaining the meaning of name, sequence, ...and their importance
2. Including your soundaliases in your zone file
- How to properly add the sounds and soundaliases to your zone file
3. File handling
- Packing your custom sounds into a zip
- Where to properly place your zip file for others who will play your map
Lets get started then!
1. Soundaliases runthrough
What is most important is that you match things correctly to their proper spots.
What I mean by this is that on the top of the the audio file you have things like
,name,name of the alias that is used to play this sound (required),sequence,"used to uniquely identify alias entries when more than one sound goes to an alias, used only to catch unwanted duplicates (default = 0)",file,the name of the file that contains the sound data (required),vol_min,"0 is silent, 1 is full volume (default = 1)",vol_max,"0 is silent, 1 is full volume (default = same as vol_min)",vol_mod,"blank causes no effect on vol_min and vol_max, otherwise the string must match a string in the volumemodgroups.def file and the value in that file corresponding to that string will be used to adjust vol_min and vol_max, clamped to the valid range",pitch_min,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = 1)",pitch_max,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = same as pitch_min)",dist_min,"within this distance in inches, the sound is always full volume (default = 120)",dist_max,"outside this distance in inches, the sound is not started. If left blank or set to 0, the sound will play from any distance. This does not affect sound volume falloff.",channel,"auto, menu, weapon, voice, item, body, local, music, announcer (default = auto)",type,primed (a streamed sound which gets primed on some platforms)/ streamed / loaded (default = loaded),probability,weight to use for the weighted probability of playing this sound instead of another sound (default = 1),loop,"whether this sound is ""looping"" or ""nonlooping"" (default = ""nonlooping"")",masterslave,"if ""master"", this is a master sound. If a number, then this sound's volume will be multiplied by that number (a percentage between 0 and 1) any master sound is playing. If blank, then neither master nor slave.",loadspec,"space-separated list of which maps should use this alias; eg, ""burnville dawnville"". If blank, the alias is used on all maps.",compression,"a string corresponding to an entry in ""XMAUpdate.tbl"" which is used to determine compression by XMAUpdate.exe",secondaryaliasname,"defined the name of an additional sound alias to play in addition to the current alias being played. Note that it is an error for the secondaryalias to also define a secondaryaliasname (eg, if B is a secondaryalias of A, B is not allowed to have its own secondaryalias).",volumefalloffcurve,if blank uses the linear curve which can not be changed. A string 'XXXX' corresponds to the curve defined by the file 'soundaliases/XXXX.vfcurve',startdelay,defaults to no delay. The value is the number of milliseconds to delay starting the sound by
,speakermap,if blank uses the default speakermappings which cannot be changed. A string 'XXXX' corresponds to the speakermap defined by the file 'soundaliases/XXXX.spkrmap'.,reverb,"blank means the alias is affected normally by wet and dry levels, ""fulldrylevel"" forces the alias to use a full drylevel (ignoring the global drylevel), ""nowetlevel"" forces the alias to use no wetlevel (ignoring the global wetlevel)",lfe percentage,this determines what percentage of the highest calculated spatialized speaker volume should be passed to the LFE. blank means no LFE for the sound
,center percentage,this determines what percentage of the volume should be redirected to the center channel (equal percentage taken from all speakers).,platform,"used by XMAUpdate to determine whether the alias should be processed for a particular platform. If blank, process for all platforms. Platforms are PC, XB, PS, WI. Multiple values should be separated by spaces. !PC will exclude alias from PC but include in all other platforms. PC will only include alias for PC. !PC XB is invalid.",envelop_min,any sounds within this distance of the listener will use the full envelop percentage,,,,,,,,,,,,,,,,,,,,,,,,,,envelop_max,sounds between enevlop_min and envelop_max use a fraction of the envelop percentage,,,,,,,,,,,,,,,,,,,,,,,,,,envelop percentage,amount of omnidirectionality to apply,,,,,,,,,,,,,,,,,,,,,,,,,
These explain exactly what they do and give u a good direction as to which ones to use. While I personally don't use them all, I do use the mandatory ones. Now you have the option of using or not using them. But either way you have a good description of what you want to actually use. So some things are important than others and must be included, example "name","file", "Vol_min", "vol_max"...etc.... Others might be not included. Each one needs to be seperated by a comma. Example: name,file,vol_min,vol_max....
Ive made a video to kinda explain much better ( hopefully )
2. Zone File
For custom sounds you have to include it the soundaliases and/ or the sound(s).
So for the map city i used this in the zone file:
The first line is the actual sound aliases file for my map. "sound" in this case refers to the soundalises folder.
Then the 2nd part refers to my filename "city". This tells it to use the soundaliases called "city" inside the soundaliases folder.
The 3rd part refers to the map on which to use it on, in this case the map "city".
The last part is whether or not it can be used on all the sp's or not. I put used on all sounds hence why it is "all_sp" and not "!all_sp"
That's how that worked for me.
The 2nd line refers to the actual sound file itself. It was included in the zone file bc it is a cutom sound.
keep in mind that it is a ".wav" file not a ".mp3" bc theres issues i couldnt resolve with mp3 so i just ended up using .wav.
So in this case i "sound" ( after rawfile,) is the actual sound folder found in raw.
then in there i created a folder inside "sound" and called it "city".
Within this folder i have all my sound files.
3. File Handling
Finally when you want distribute your map with custom sounds, you have to make a zip file for it.
Inside the zip file you have a "sound" folder with a "sub folder" ( if u created one ) and then all your sound files inside that sub folder.
Everything must be the same exact path as you had it in ur raw/sound folder. Otherwise your sounds wont play and/or you will have errors.
Once you have that zip file you MUST then go into the "Mods" folder and create a new folder with your map's name. The reason why is
bc you now have custom sounds that are not originally in the game so therefore they are considered modded files hence they must go
in the "Mods" folder with your maps name folder. so it should look something like this :
The last part is to run the sp shortcut with your mod.
Simply right click on your cod4 sp shortcut on ur desktop and go down to properties.
Then the shortcut tab and in the section "target" go to the end and put a space and add this to it "+set fs_game mods/modname" (without quotes).
so it should look like this:
"C:\Program Files (x86)\Activision\Call of Duty 4 - Modern Warfare\iw3sp.exe"+set fs_game mods/modname
modsname is the name of the folder you created inside the "Mods" folder.
and thats how you do sounds in cod4. Hopefully this will help you in understanding sounds.