L4D Soundscripts: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Initial Creation of Left 4 Dead Soundscripts - Implemented and Customizable Music 4 Your L4D Map!)
 
(I'm just saving. More additions to this article on how to get L4D music to work with scripts and nav mesh editing.)
Line 1: Line 1:
== Introduction ==  
== Introduction ==  
Left 4 Dead (L4D) [[soundscripts]] are located within the path /left4dead/scripts. They are used to invoke in-game sounds such as weapons, [[soundscapes]], and music during events output by the sound emitter. The script game_sounds_manifest.txt will preload or precache the soundscripts when Left 4 Dead is loaded. The base path for all sound files is /rootDir/sounds/. This means that all of the soundscripts will look in /rootDir/sounds/<soundscript entry> for sound assets, where rootDir is pointed to a [[L4D_Campaign_Add-on_Tutorial|VPK addon]] or /left4dead/.
Left 4 Dead (L4D) [[soundscripts]] are located within the path /left4dead/scripts. They are plain text files (.txt extension) used to invoke in-game sounds such as weapons, [[soundscapes]], and music during events output by the sound emitter. The script game_sounds_manifest.txt will preload or precache the soundscripts when Left 4 Dead is loaded. The base path for all sound files is /rootDir/sounds/. This means that all of the soundscripts will look in /rootDir/sounds/<soundscript entry> for sound assets, where rootDir is pointed to a [[L4D_Campaign_Add-on_Tutorial|VPK addon]] or /left4dead/.


== Custom L4D Soundscripts ==
{{Note|There is a proper way to create custom L4D soundscripts. Packing and shipping edited soundscripts found in the scripts folder, including the manifest itself, to end users would conflict with VPK addons following the same incorrect method. More importantly, they will completely replace soundscripts for the original Valve campaigns.}}
Many L4D soundscripts, especially the one for music, depend the content of three things: the mission text file, the actual soundscript, and the navigation mesh. The following details will use a music soundscript entry in No Mercy (an official Valve campaign) as an example.
# The [[Deadline_Mission_File|missions/<mission name>.txt]] file registers a unique name, an entry called "NAME", that are important for L4D soundscripts such as the music soundscript. The mission file also lists all of the actual map files that are part of the mission. Many entries in the music soundscript depends on the "NAME" entry found in the mission file, where "NAME" is used by the Sound Emitter with the maps registered under it.
# As with any source game, a soundscript found as maps/<mapname>_level_sounds.txt can override official soundscript entries without affecting other campaigns. Official Valve campaigns may use sound_games_music.txt for music soundscript entries.
# The nav mesh must be properly marked with attributes to invoke certain events
In The No Mercy Campaign (Example):
*Mission File
**The No Mercy mission text file is found as maps/hospital.txt.
**"NAME" entry is uniquely labeled as "Hospital"
**hospital.txt contains a list of the exact names of the maps: "l4d_hospital01_apartment" ... "l4d_hospital05_rooftop".
*Sound Script and Nav Mesh
**Event.MissionStart_Hospital is an entry in the soundscript sound_games_music.txt
**In the initial spawning point of the No Mercy campaign, the Sound Emitter invokes an event called Event.MissionStart_Hospital
**The event is only invoked in the map files listed in the mission file if the navigation mesh is labeled with the attribute CHECKPOINT and the mission has just started
== Soundscripts Manifest ==
== Soundscripts Manifest ==
The L4D soundscripts manifest, game_sounds_manifest.txt, is a list of soundscripts that are either preloaded or precached when the game is loaded. The following is the actual manifest for L4D:
The L4D soundscripts manifest, game_sounds_manifest.txt, is a list of soundscripts that are either preloaded or precached when the game is loaded. The following is the actual manifest for L4D. The soundscripts are separated in this manner mostly for the sake of organization. All of the scripts, in this case, could have been combined into two soundscript files for either precaching or preloading:


  game_sounds_manifest
  game_sounds_manifest
Line 36: Line 63:
  }
  }


== Custom Soundscripts ==
== List of L4D Soundscripts ==
 
 
 





Revision as of 20:07, 19 July 2009

Introduction

Left 4 Dead (L4D) soundscripts are located within the path /left4dead/scripts. They are plain text files (.txt extension) used to invoke in-game sounds such as weapons, soundscapes, and music during events output by the sound emitter. The script game_sounds_manifest.txt will preload or precache the soundscripts when Left 4 Dead is loaded. The base path for all sound files is /rootDir/sounds/. This means that all of the soundscripts will look in /rootDir/sounds/<soundscript entry> for sound assets, where rootDir is pointed to a VPK addon or /left4dead/.

Custom L4D Soundscripts

Note.pngNote:There is a proper way to create custom L4D soundscripts. Packing and shipping edited soundscripts found in the scripts folder, including the manifest itself, to end users would conflict with VPK addons following the same incorrect method. More importantly, they will completely replace soundscripts for the original Valve campaigns.

Many L4D soundscripts, especially the one for music, depend the content of three things: the mission text file, the actual soundscript, and the navigation mesh. The following details will use a music soundscript entry in No Mercy (an official Valve campaign) as an example.

  1. The missions/<mission name>.txt file registers a unique name, an entry called "NAME", that are important for L4D soundscripts such as the music soundscript. The mission file also lists all of the actual map files that are part of the mission. Many entries in the music soundscript depends on the "NAME" entry found in the mission file, where "NAME" is used by the Sound Emitter with the maps registered under it.
  2. As with any source game, a soundscript found as maps/<mapname>_level_sounds.txt can override official soundscript entries without affecting other campaigns. Official Valve campaigns may use sound_games_music.txt for music soundscript entries.
  3. The nav mesh must be properly marked with attributes to invoke certain events

In The No Mercy Campaign (Example):

  • Mission File
    • The No Mercy mission text file is found as maps/hospital.txt.
    • "NAME" entry is uniquely labeled as "Hospital"
    • hospital.txt contains a list of the exact names of the maps: "l4d_hospital01_apartment" ... "l4d_hospital05_rooftop".
  • Sound Script and Nav Mesh
    • Event.MissionStart_Hospital is an entry in the soundscript sound_games_music.txt
    • In the initial spawning point of the No Mercy campaign, the Sound Emitter invokes an event called Event.MissionStart_Hospital
    • The event is only invoked in the map files listed in the mission file if the navigation mesh is labeled with the attribute CHECKPOINT and the mission has just started





Soundscripts Manifest

The L4D soundscripts manifest, game_sounds_manifest.txt, is a list of soundscripts that are either preloaded or precached when the game is loaded. The following is the actual manifest for L4D. The soundscripts are separated in this manner mostly for the sake of organization. All of the scripts, in this case, could have been combined into two soundscript files for either precaching or preloading:

game_sounds_manifest
{
	 "precache_file"  	"scripts/game_sounds_bots.txt"
	 "precache_file"  	"scripts/game_sounds_terror.txt"

	 "precache_file"  	"scripts/game_sounds_infected_common.txt"
	 "precache_file"  	"scripts/game_sounds_infected_special.txt"

	 "precache_file"  	"scripts/game_sounds_player.txt"
	 "precache_file"  	"scripts/game_sounds_biker.txt"
	 "precache_file"  	"scripts/game_sounds_manager.txt"
	 "precache_file"  	"scripts/game_sounds_namvet.txt"
	 "precache_file"  	"scripts/game_sounds_teengirl.txt"
	 "precache_file"  	"scripts/game_sounds_npcs.txt"
	 "precache_file"  	"scripts/game_sounds_npc2.txt"


	 "precache_file"  	"scripts/game_sounds_music.txt"
	 "precache_file"  	"scripts/game_sounds_doors.txt"

	 "preload_file"  	"scripts/game_sounds.txt"
	 "preload_file"  	"scripts/game_sounds_physics.txt"
	 "preload_file"  	"scripts/game_sounds_weapons.txt"
	 "preload_file"		"scripts/game_sounds_ambient_generic.txt"
	 "preload_file"		"scripts/game_sounds_world.txt"

	 // Level sounds

	 "preload_file"		"scripts/level_sounds_general.txt"
}

List of L4D Soundscripts