Setting up Ambient Rooms

NOTE

This tutorial comes from Scobalula & Ardivee. All credit goes to them.




SCRIPT

SETTING UP THE AMBIENT ROOMS


Go into your ambient sound folder and make a copy of the ambient_mod.csv and name it whatever you like. I like having an ambient room for each map, so I would name it zm_mapname.csv, but its up to you.


Open it up in a CSV Editor such as Microsoft Excel or Open Office. This way it is easier to read and understand what each column does.


Here we can define the "rooms" for our map. Here is a rundown of each of the columns:

NAME - Name of the room, we will use this in Radiant later, so name it whatever you'd like.

LOADSPEC - A group name that can be used in the config like a sound alias. This is not necessary to assign one, so leave it as mpl_mod.

DEFAULTROOM - Set this to TRUE or FALSE. True means that this is the first ambient room the player starts in. Only one of these can be set to true.

REVERB - This states which reverb sound is going to be used. A list of stock reverbs will be down below.

REVERBDRYLEVEL - Defines the Reverb Dry Level, set this between 0 and 1.

REVERBWETLEVEL - Defines the Reverb Wet Level, set this between 0 and 1.

ENTITYCONTEXTTYPE/VALUE<X> - Used alongside the context values in your Sound Aliases, stock weapons will generally have multiple sound aliases with different context values, these then define the contexts to play.

GLOBALCONTEXTTYPE/VALUE - Similar to ENTITYCONTEXTYPE/VALUE but sets globally.

LOOP - You can set a sound that loops when inside of the room. This is useful for rain or outside ambient sounds.

DUCK - Sound effect that applies itself to the room. A list of stock ducks can be found in "share\raw\sound\ducks". An example of this is the moon duck, where everything becomes muffled, to simulate space.

STOCK REVERBS


Here is the list of all stock reverbs you can use:

cinematic
cp_lotus_main_room
default
default_new_paches
doa_fps_mode
factory_evt_boiler
factory_evt_chainroom
factory_evt_dome
factory_evt_hangar
factory_evt_tallroom
factory_evt_tele_a
factory_evt_tele_b
factory_hallway
factory_largeroom
factory_largeroom_2
factory_mediumroom
factory_partialroom
factory_sewerpipe
factory_smallroom
factory_urban_outdoor
factory_urban_outdoor_2
global_hallway
global_hangar
global_hugeroom
global_largeroom
global_mediumroom
global_partialroom
global_sewerpipe
global_smallroom
global_splitscreen
global_traincar
global_tunnel
global_underwater
global_urban_outdoor
hub_monsters_outdoor
mp_final_killcam
shock_flashbang
singapore_outdoor
sndHealth_LastStand
sndHealth_LowHealth
sndHealth_Melee
test
underwater

SETTING UP YOUR SOUND ZONE CONFIG


Open up your mapname.szc file found in "usermaps\mapname\sound\zoneconfig"


An unedited file will look like this:

{
"Name" : "mapname",
"GameMode" : "mpl",
"IsCommon" : false,
"Parent" : "",
"Overlay" : "",
"IsStandalone" : true,
"IsProduction" : false,
"IsShipped" : false,
"DontDeploy" : false,
"NoStreamBank" : false,
"MapFile" : "",
"Standalone" : true,
"Builds" : [ "T7" ],
"Sources" : [
{
    "Type" : "ALIAS",
    "Name" : "user_aliases",
    "Filename" : "user_aliases.csv",
    "Specs" : [ ]
},
{
    "Type" : "AMBIENT",
    "Name" : "ambient_mod",
    "Filename" : "ambient_mod.csv",
    "Specs" : [
    "mpl_mod"
    ]
},
]
}

We want to enter in the MapFile of your map, but there is a catch. Ambient Rooms CANNOT be in any prefabs! The snd_convert will not work, and your Ambient Rooms will not work. Coming straight from Scob: "The ambient data is compiled directly into the sound xasset struct which is why snd_convert needs to know the map file, snd_convert will generate a file called mapname.ambientgeometry.json for Linker to use."


So, if we were to enter our mapname into the MapFile, it would look like this:

"MapFile" : "zm\\zm_mapname.map",

Keep in mind, the double backslash is required!


We can now replace the "Name" : "ambient_mod" and "Filename" : "ambient_mod.csv" with the one we created before.


RADIANT

Open your map in Radiant, go into the ENTITY BROWSWER and create a TRIGGER_MULTIPLE. We're going to have to set up some KVP's for this trigger:



targetname - ambient_package
script_ambientroom - name of the room we set up before in the ambient file
script_ambientpriority - a number sequence; higher the number equals more priority. This allows for multiple triggers to overlap each other, and whatever has the highest priority will play.

Also make sure to tick CLIENTSIDE_TRIGGER to TRUE.


Lastly, you can open up the texture browser and give the TRIGGER_MULTIPLES the audio texture to differentiate these audio triggers from other triggers. It's not necessary, but it makes life easier when sorting through triggers.


That's it!

Related Posts

See All

Setting up Sounds in an Alias

HOW TO READ THE ALIAS In order to read .CSV's easier, get Microsoft Excel or Open Office, the latter being free which you can download HERE. Just right click on your alias and open with you preferred

Setting up 3D Ambient / Environmental Sounds

NOTE This tutorial assumes you already know how to set up sounds in an alias. If you don't, click HERE. RADIANT Open the ENTITY_BROWSER and place a SCRIPT_STRUCT in your map. This struct is going to b