Custom Soundscripts and Soundcache

From Obsidian Conflict Wiki
Jump to: navigation, search

Since 1.3 you can specify which soundscripts and soundscapes to load per map, even your own custom ones (like if you made a custom weapon for your map etc.)

Note: If your map doesn't use any custom soundscripts, then you dont have to do this, the mod will automatically use default soundcache settings if it cant find any specified soundcache settings.

There are 2 ways to do this; an easy and a more complicated way, it is sugested to use the easy way unless you really have a reason to use the complicated way and you know what you are doing (like you're making one huge campaign which shares a huge amount of custom sound entries.)


Setting up custom soundscripts and soundscapes, the easy way

Go to your obsidian/maps/cfg folder and create a new text file called "yourmapname_soundscripts.txt".

Add in all your soundscript entries like in this example:

"Weapon_HMG1.Single"
{
	"channel"		"CHAN_WEAPON"
	"volume"		"0.85"
	"soundlevel"		"SNDLVL_GUNFIRE"
	"pitch"			"85,95"

	"wave"			"^weapons/ar1/ar1_dist1.wav"
}

"Weapon_HMG1.Reload_Rotate"
{
	"channel"		"CHAN_ITEM"
	"volume"		"0.9"
	"soundlevel"	"SNDLVL_NORM"

	"wave"			"weapons/hmg1/hmg1_reload_rotate.wav"
} 

"Weapon_HMG1.Reload_Push"
{
	"channel"		"CHAN_ITEM"
	"volume"		"0.9"
	"soundlevel"	"SNDLVL_NORM"

	"wave"			"weapons/hmg1/hmg1_reload_push.wav"
}

Save it and you should be good to go. Note that it works the same exact way for custom soundscapes, with the exception of the file name being "yourmapname_soundscapes.txt".


Setting up custom soundscripts, the complicated way

First, go to the obsidian\scripts folder and create a new text file, its the best to name it something like level_sounds_mymapname or weapon_sounds_mymapname.

Then copy all your soundscript entrys into this file and save it.

Next, go to the obsidian\scripts\soundscripts folder and create a text new file called Base_mymapname (note: it doesnt have to be your maps name, it can be anything you want.) and put the name of the custom soundscripts you want to precache into this file and save it, it should look like this:

SoundCache
{
	"precache_file"		"scripts/game_sounds_mymapname.txt"
	"precache_file"		"scripts/weapon_sounds_mymapname.txt"
}

Now to actually precache the soundscript when you start your map, you have to add this key to your maps mapadd script:

	"SoundCache"
	{
    		"Base_mymapname"	        "1"
	}

Note: once you add the "SoundCache" key to your mapaddscript, you have to specify ALL soundscripts the map needs, even the default ones, heres an example of what the script has to look like then:

"mymapname"
{
	"spawnitems"
	{
		"weapon_smg1" "1"
		"item_ammo_smg1" "2"
	}
	"SoundCache"
	{
    		"Base_BASE"		"1"
   		"Base_HL2"		"1"
    		"Base_NPC"		"1"
    		"Base_mymapname"	"1"
	}
}

If your map requires any game mounts (like ep2, css or hls,) you might have to add the specific Base_* files for them as well, depending on if you mount it only for the textures/models or if you use any npcs or other stuff that uses soundscripts from those mounted games.

Note: Be careful with mounting/unmounting soundcaches in your map. You could make that some weapons/npcs/effects doesnt have sounds or change it.

See Also

Soundscript explanation on VDC

Soundscapes explanation on VDC

Creating Mapaddscripts

Creating Custom Weapons

Mounting Content