How to add new subtitles for L4D2: Difference between revisions
Jump to navigation
Jump to search
(Created page with "'''Creating Custom Subtitles in Left 4 Dead 2''' Esta guía explica cómo crear subtítulos personalizados para Left 4 Dead 2") |
No edit summary |
||
| Line 1: | Line 1: | ||
= Creating Custom Subtitles in Left 4 Dead 2 = | |||
This guide explains how to create custom subtitles for your own campaigns in **Left 4 Dead 2**. | |||
== Step 1: Create a sound script == | |||
First, create a file named: | |||
<code>your_campaign_level_sounds.txt</code> | |||
Inside, define the sound event you want to subtitle. Example: | |||
<pre> | |||
"npc.command_intro" | |||
{ | |||
"channel" "CHAN_VOICE" | |||
"volume" "1.0" | |||
"pitch" "PITCH_NORM" | |||
"soundlevel" "SNDLVL_90dB" | |||
"wave" "sblitz/command_radio0.wav" | |||
} | |||
</pre> | |||
*The identifier (e.g. <code>npc.command_intro</code>) will later be referenced in your subtitles.* | |||
== Step 2: Reference the sound name == | |||
Copy the name you defined (e.g. <code>npc.command_intro</code>). | |||
This will be used inside your subtitle file. | |||
== Step 3: Create a closecaption file == | |||
Now create a new file named: | |||
<code>closecaption_english.txt</code> | |||
(or <code>closecaption_spanish.txt</code>, depending on the language). | |||
**Important:** the word <code>closecaption</code> must be present in the filename, otherwise it will not work. | |||
== Step 4: Subtitle file structure == | |||
The file should follow this format: | |||
<pre> | |||
"lang" | |||
{ | |||
"Language" "Latam" | |||
"Tokens" | |||
{ | |||
"testcommands" "<clr:255,0,0>This is red<I> and italics<B> and <cr>bold<B><I><clr:255,255,255> white again." | |||
"ambient.nocopyrightxmas" "<sfx><norepeat:15><clr:204,0,0>[Playing 'Christmas Spirit' by Shane Ivers.]" | |||
} | |||
} | |||
</pre> | |||
* Each line starts with the sound event identifier. | |||
* After that, write the text to display. | |||
* You can use formatting codes like: | |||
* <code><clr:R,G,B></code> = text color. | |||
* <code><sfx></code> = marks sound effects. | |||
* <code><norepeat:15></code> = avoid repeating subtitles too often. | |||
* <code><B></code>, <code><I></code> = bold/italic. | |||
== Example: linking sound and subtitle == | |||
Sound script file: | |||
<pre> | |||
"ambient.elev_music" | |||
{ | |||
"channel" "CHAN_STATIC" | |||
"volume" "1" | |||
"soundlevel" "SNDLVL_NONE" | |||
"pitch" "PITCH_NORM" | |||
"wave" "maps/mymap/elevator_music.wav" | |||
} | |||
</pre> | |||
Subtitle file: | |||
<pre> | |||
"ambient.elev_music" "<sfx><norepeat:15><clr:255,158,71>[Elevator Music]" | |||
</pre> | |||
== Step 5: Place files == | |||
* Place your <code>.txt</code> subtitle file inside: | |||
<code>resource\</code> (either in your map folder or a custom addon folder). | |||
* Make sure your <code>gameinfo.txt</code> references the folder correctly. | |||
== Step 6: Compile subtitles == | |||
Finally, subtitles must be compiled with **captioncompiler**. | |||
Open Command Prompt and run: | |||
<pre> | |||
cd "C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2" | |||
"../bin/captioncompiler" "../../<your_folder>/resource/closecaption_english.txt" | |||
</pre> | |||
Example: | |||
<pre> | |||
cd "C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2" | |||
"../bin/captioncompiler" "../../bts_patch/resource/subtitles_english.txt" | |||
</pre> | |||
== Notes == | |||
* Always close your braces <code>{ }</code> properly in both files. | |||
* If the game does not display your subtitles, check encoding (UTF-8 without BOM) and paths. | |||
* You can add multiple languages by creating multiple files (e.g. <code>closecaption_spanish.txt</code>). | |||
[[Category:Left 4 Dead 2]] | |||
[[Category:Subtitles]] | |||
[[Category:Localization]] | |||
Revision as of 15:41, 30 August 2025
Creating Custom Subtitles in Left 4 Dead 2
This guide explains how to create custom subtitles for your own campaigns in **Left 4 Dead 2**.
Step 1: Create a sound script
First, create a file named:
your_campaign_level_sounds.txt
Inside, define the sound event you want to subtitle. Example:
"npc.command_intro"
{
"channel" "CHAN_VOICE"
"volume" "1.0"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_90dB"
"wave" "sblitz/command_radio0.wav"
}
- The identifier (e.g.
npc.command_intro) will later be referenced in your subtitles.*
Step 2: Reference the sound name
Copy the name you defined (e.g. npc.command_intro).
This will be used inside your subtitle file.
Step 3: Create a closecaption file
Now create a new file named:
closecaption_english.txt
(or closecaption_spanish.txt, depending on the language).
- Important:** the word
closecaptionmust be present in the filename, otherwise it will not work.
- Important:** the word
Step 4: Subtitle file structure
The file should follow this format:
"lang"
{
"Language" "Latam"
"Tokens"
{
"testcommands" "<clr:255,0,0>This is red<I> and italics<B> and <cr>bold<B><I><clr:255,255,255> white again."
"ambient.nocopyrightxmas" "<sfx><norepeat:15><clr:204,0,0>[Playing 'Christmas Spirit' by Shane Ivers.]"
}
}
- Each line starts with the sound event identifier.
- After that, write the text to display.
- You can use formatting codes like:
*<clr:R,G,B>= text color. *<sfx>= marks sound effects. *<norepeat:15>= avoid repeating subtitles too often. *<B>,<I>= bold/italic.
Example: linking sound and subtitle
Sound script file:
"ambient.elev_music"
{
"channel" "CHAN_STATIC"
"volume" "1"
"soundlevel" "SNDLVL_NONE"
"pitch" "PITCH_NORM"
"wave" "maps/mymap/elevator_music.wav"
}
Subtitle file:
"ambient.elev_music" "<sfx><norepeat:15><clr:255,158,71>[Elevator Music]"
Step 5: Place files
- Place your
.txtsubtitle file inside:
resource\ (either in your map folder or a custom addon folder).
- Make sure your
gameinfo.txtreferences the folder correctly.
Step 6: Compile subtitles
Finally, subtitles must be compiled with **captioncompiler**.
Open Command Prompt and run:
cd "C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2" "../bin/captioncompiler" "../../<your_folder>/resource/closecaption_english.txt"
Example:
cd "C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2" "../bin/captioncompiler" "../../bts_patch/resource/subtitles_english.txt"
Notes
- Always close your braces
{ }properly in both files. - If the game does not display your subtitles, check encoding (UTF-8 without BOM) and paths.
- You can add multiple languages by creating multiple files (e.g.
closecaption_spanish.txt).