Call of Duty 4: Sounds: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Call of Duty 4]]
[[Category:Call of Duty 4]]
[[Category:Modtools]]
[[Category:Radiant]]
[[Category:Advanced Editing]]
[[Category:Sounds]]
[[Category:Sounds]]
{{warning_forpro}}
{{warning_forpro}}

Revision as of 23:31, 17 October 2008

This tutorial assumes that you already know how to create, compile & create GSCs,CSVs & FastFiles for your maps

2 Techniques reviewed here:

  • Using GSCs
  • Using Radiant & Script_Origin

Using GSCs

Some sound found in raw/soundaliases/multiplayer.csv or common.csv cannot be used directly in custom because they are set for specific stock SP and MP maps, example:

emt_whopper_comp,,amb_emitters/emt_whopper_computer1.wav,1,1,max,1,1,100,720,auto,streamed,,rlooping,,launchfacility_b,,,,,,,,0.2,,,75,200,0.65

Note on this example the soundalias is set to the SP map/level launchfacility_b

The solution (as long as the .wav is in the main/iw_xx.iwd) is to create your own soundaliases file. Example for added sound for uber computer sound)

1. create a file called whatever.csv under raw/soundaliases

2. Add the following in the empty file:

#Emitters,,,,,,,,,,,,,,,,,,,,,,,,,
emt_whopper_comp,,amb_emitters/emt_whopper_computer1.wav,1,1,max,1,1,100,720,auto,streamed,,rlooping,,all_mp,,,,,,,,0.2,,,75,200,0.65
 Note the change in the line from launchfacility_b to all_mp to allow for the sound in your custom map.

3. If you dont already have on, create a file in raw/maps/mp/ called mp_mapname_fx.gsc, put/add this to it:

main()
{
	level.scr_sound["emt_whopper_comp"] = "emt_whopper_comp";
/#
	if ( getdvar( "clientSideEffects" ) != "1" )
		maps\createfx\mp_mapname_fx::main();
#/		
}


mp_mapname is your map name

4. Again, if not already there create a file under raw/maps/createfx/ called mp_mapname_fx.gsc, put/add this to it:

//_createfx generated. Do not touch!!
main()
{
     	ent = maps\mp\_utility::createOneshotEffect( "light_shaft_dust_large" );
     	ent.v[ "origin" ] = (X, Y, Z);
     	ent.v[ "angles" ] = ( 270, 0, 0 );
     	ent.v[ "fxid" ] = "light_shaft_dust_large";
     	ent.v[ "delay" ] = -15;
     	ent.v[ "soundalias" ] = "emt_whopper_comp";
}

X, Y, Z are the coordinate of where you want the origin of the sound to come from.

5. Finally add this to your zone_source/mp_mapname.csv:

sound,whatever,,all_mp

6. Compile!

--Zeroy. 14:44, 15 October 2008 (UTC)