Call of Duty 5: Sounds with Struct

From COD Modding & Mapping Wiki
Jump to navigation Jump to search

This tutorial describe an alternative method to add Sound in a map using Radiant and a few scripts.

Playing a single sound using a script_struct

The way I'm going to show you how to use script_structs is basically the same way they did it in mp_castle. Its actually very easy and straight forward, we are going to start by adding one sound to your map then we will move on to adding several sounds.

Make sure you replace any reference to mp_yourmapsname with the name of your map.

The very first thing we need to do, is to make sure that you have a mp_yourmapsname.csc in raw/clientscripts/mp, if you do not have one then you need to create one, once you have created one copy and paste these lines into it, you may need to change the team nationalities as well.

 #include clientscripts\mp\_utility;

main()
{

	// If the team nationalites change in this level's gsc file,
	// you must update the team nationality here!
	level.allies_team = "marines";
	level.axis_team   = "german";

	// _load!
	clientscripts\mp\_load::main();

        // clientscripts\mp\mp_yourmapsname_fx::main();

	thread clientscripts\mp\_fx::fx_init(0);
	thread clientscripts\mp\_audio::audio_init(0);

	// thread clientscripts\mp\mp_yourmapsname_amb::main();

	// This needs to be called after all systems have been registered.
	thread waitforclient(0);

	println("*** Client : mp_yourmapsname running...");

} 

The next thing to check is you have these lines in your zone file, without these lines, especially the top one your sounds will not work.

rawfile,clientscripts/mp/mp_yourmapsname.csc

sound,common,mp_yourmapsname,all_mp
sound,generic,mp_yourmapsname,all_mp
sound,voiceovers,mp_yourmapsname,all_mp
sound,multiplayer,mp_yourmapsname,all_mp
sound,mp_yourmapsname,mp_yourmapsname,all_mp

Sub Chapter 1

  • line 1
  • line 2

Sub Chapter 2

  • BOLD
  • Italic

Chapter 2

And so it goes ....