How to add new subtitles for L4D2: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Lt.Mori moved page Closed Captions l4d2 to Valve Developer Community:How to add new subtitles for L4D2: me equivoque de titulo xd)
No edit summary
Line 1: Line 1:
= Cómo crear subtítulos personalizados en Left 4 Dead 2 =
= How to Create Custom Subtitles in Left 4 Dead 2 =


Hola a todos, esta será una guía que se va a dividir por secciones de cómo añadir nuevos subtítulos.
Hello everyone, this will be a guide divided into sections on how to add new subtitles.




{{note|Se supone que estás familiarizado con en usar Hammer, manejar archivos como '''.lmp''' y '''level_sounds.txt''', ya que esto implica modificar mapas.}}
{{note|It is assumed that you are familiar with using Hammer, and handling files such as '''.lmp''' and '''level_sounds.txt''', since this involves modifying maps.}}


== Secciones ==
== Sections ==
* Agregar subtítulos nuevos para campañas oficiales
* Adding new subtitles to official campaigns
* Agregar subtítulos nuevos para campañas custom
* Adding new subtitles to custom campaigns
* Agregar subtítulos a tu propia campaña custom
* Adding subtitles to your own custom campaign


== Agregar subtítulos nuevos para campañas oficiales ==
== Adding new subtitles to official campaigns ==


=== Primer paso ===
=== First step ===
Tener ya el audio o los audios que vas a subtitular, para luego crear una carpeta llamada <code>maps</code> y ahí agregar 2 archivos:
Have the audio file(s) you want to subtitle ready, then create a folder named <code>maps</code> and add 2 files inside:
* Un archivo <code>.lmp</code>
* A <code>.lmp</code> file
* Un archivo <code>level_sounds.txt</code>
* A <code>level_sounds.txt</code> file


=== Segundo paso ===
=== Second step ===
Abrir el archivo <code>level_sounds.txt</code> del mapa.   
Open the map's <code>level_sounds.txt</code> file.   
{{note|los mapas oficiales no cuentan con este archivo, así que tendrás que crear uno nuevo. Esto es fácil: solo busca cómo se llama el mapa y crea el <code>level_sounds.txt</code> correspondiente.}}
{{note|Official maps do not come with this file, so you'll have to create a new one. This is easy: just find the map's name and create the corresponding <code>level_sounds.txt</code>.}}


*Ejemplo:*   
*Example:*   
Dark Carnival mapa 4 = <code>c2m4_barns</code>   
Dark Carnival map 4 = <code>c2m4_barns</code>   
El archivo tendría que llamarse: <code>c2m4_concert_level_sounds.txt</code>
The file should be named: <code>c2m4_concert_level_sounds.txt</code>


{{note|si no sabes el nombre base del mapa, abre la consola del juego y escribe <code>map </code>. Ahí verás los nombres.}}
{{note|If you don't know the map's base name, open the game console and type <code>map </code>. You'll see the names there.}}


=== Tercer paso ===
=== Third step ===
Es simplemente poner el nombre del título y editar los valores.   
Simply define the sound name and edit the values.   
Ejemplo:
Example:


<pre>
<pre>
Line 43: Line 43:
</pre>
</pre>


Una vez hecho, copia el nombre que está arriba de las llaves <code>{ }</code> y úsalo después en Hammer.
Once done, copy the name above the curly braces <code>{ }</code> and use it later in Hammer.


=== Cuarto paso ===
=== Fourth step ===
Abre el mapa ya descompilado en Hammer. En lugar de enlazar directamente al archivo <code>.wav</code>, inserta el nombre del sonido (p. ej., <code>npc.map4_hippie1</code>).   
Open the decompiled map in Hammer. Instead of linking directly to the <code>.wav</code> file, insert the sound name (e.g., <code>npc.map4_hippie1</code>).   
Luego compila el mapa.
Then compile the map.


=== Quinto paso ===
=== Fifth step ===
Abre el <code>.lmp</code> que previamente extrajiste del <code>.bsp</code> (ubicado en <code>left4dead2/maps</code>).
Open the <code>.lmp</code> file that you previously extracted from the <code>.bsp</code> (located in <code>left4dead2/maps</code>).


Ejemplo:
Example:


<pre>
<pre>
Line 58: Line 58:
</pre>
</pre>


Una vez abierto, ve hasta el final del archivo. Luego abre el nuevo <code>.bsp</code> compilado y copia las líneas editadas.
Once opened, scroll to the end of the file. Then open the new compiled <code>.bsp</code> and copy the edited lines.


[[File:Ejemplo.png|thumb|left|300px|Al final agregas las líneas que hiciste]]
[[File:Ejemplo.png|thumb|left|300px|Add the lines you created at the end]]
<br clear="all" />
<br clear="all" />
[[File:Captura_de_pantalla_2025-08-30_230518.png|thumb|left|300px|Algo así parecido]]
[[File:Captura_de_pantalla_2025-08-30_230518.png|thumb|left|300px|Something like this]]
<br clear="all" />
<br clear="all" />


Una vez hecho eso, arrastras el archivo <code>.lmp</code> al programa <code>lmpfix</code> para que este mismo lo arregle.
Once that's done, drag the <code>.lmp</code> file into the <code>lmpfix</code> program so it can fix it.


=== Sexto paso ===
=== Sixth step ===
Crear una carpeta llamada <code>resource</code> y dentro un archivo:   
Create a folder named <code>resource</code> and inside it, a file:   
<code>closecaption_tu_idioma.txt</code>
<code>closecaption_your_language.txt</code>


Contenido básico:
Basic content:


<pre>
<pre>
// PLANTILLA
// TEMPLATE
"lang"
"lang"
{
{
     "Language" "Tu idioma"
     "Language" "Your language"
     "Tokens"
     "Tokens"
     {
     {
         "testcommands" "<clr:255,0,0>This is red<I> italics<B> bold <cr><clr:255,255,255>white again."
         "testcommands" "<clr:255,0,0>This is red<I> italics<B> bold <cr><clr:255,255,255>white again."
         "titulo_del_nombre" "<clr:255,255,255>Línea de subtítulo"
         "title_name" "<clr:255,255,255>Subtitle line"
     }
     }
}
}
</pre>
</pre>


Ejemplo:
Example:


<pre>
<pre>
// EJEMPLO
// EXAMPLE
"lang"
"lang"
{
{
Line 95: Line 95:
     "Tokens"
     "Tokens"
     {
     {
         "npc.map4_hippie1" "<clr:255,255,255>hippie: Hola mundo"
         "npc.map4_hippie1" "<clr:255,255,255>hippie: Hello world"
     }
     }
}
}
</pre>
</pre>


Guarda el archivo.
Save the file.


=== Séptimo paso ===
=== Seventh step ===
Crear un archivo <code>gameinfo.txt</code> en la misma carpeta, de esta forma:
Create a <code>gameinfo.txt</code> file in the same folder, like this:


<pre>
<pre>
resource > "closecaption_tu_idioma.txt"
resource > "closecaption_your_language.txt"
gameinfo.txt
gameinfo.txt
</pre>
</pre>


=== Octavo paso ===
=== Eighth step ===
Arrastrar el archivo <code>closecaption_tu_idioma.txt</code> sobre <code>captioncompiler.exe</code> (que está en la carpeta <code>bin</code>).
Drag the <code>closecaption_your_language.txt</code> file onto <code>captioncompiler.exe</code> (found in the <code>bin</code> folder).


Esto debería generar: <code>closecaption_tu_idioma.dat</code> en la carpeta <code>resource</code>.
This should generate: <code>closecaption_your_language.dat</code> in the <code>resource</code> folder.


{{note|si no funciona, abre CMD y escribe:}}
{{note|If it doesn’t work, open CMD and type:}}


<pre>
<pre>
cd C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2
cd C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2
"../bin/captioncompiler" "../../left4dead2_subtitles_custom/resource/closecaption_tu_idioma.txt"
"../bin/captioncompiler" "../../left4dead2_subtitles_custom/resource/closecaption_your_language.txt"
</pre>
</pre>


(Asegúrate de ajustar la ruta y el nombre de la carpeta según tu instalación.)
(Make sure to adjust the path and folder name according to your installation.)


== Conclusión ==
== Conclusion ==
¡Listo! Eso sería todo para que aparezcan los subtítulos en las campañas oficiales en caso de que quieras añadir nuevos.
Done! That’s everything you need to do for subtitles to appear in official campaigns, in case you want to add new ones.

Revision as of 21:59, 30 August 2025

How to Create Custom Subtitles in Left 4 Dead 2

Hello everyone, this will be a guide divided into sections on how to add new subtitles.


Note.pngNote:It is assumed that you are familiar with using Hammer, and handling files such as .lmp and level_sounds.txt, since this involves modifying maps.

Sections

  • Adding new subtitles to official campaigns
  • Adding new subtitles to custom campaigns
  • Adding subtitles to your own custom campaign

Adding new subtitles to official campaigns

First step

Have the audio file(s) you want to subtitle ready, then create a folder named maps and add 2 files inside:

  • A .lmp file
  • A level_sounds.txt file

Second step

Open the map's level_sounds.txt file.

Note.pngNote:Official maps do not come with this file, so you'll have to create a new one. This is easy: just find the map's name and create the corresponding level_sounds.txt.
  • Example:*

Dark Carnival map 4 = c2m4_barns → The file should be named: c2m4_concert_level_sounds.txt

Note.pngNote:If you don't know the map's base name, open the game console and type map . You'll see the names there.

Third step

Simply define the sound name and edit the values. Example:

"npc.map4_hippie1"
{
    "channel"    "CHAN_VOICE"
    "volume"     "1.0"
    "pitch"      "PITCH_NORM"
    "soundlevel" "SNDLVL_90dB"
    "wave"       "map4/hippy/hippie1.wav"
}

Once done, copy the name above the curly braces { } and use it later in Hammer.

Fourth step

Open the decompiled map in Hammer. Instead of linking directly to the .wav file, insert the sound name (e.g., npc.map4_hippie1). Then compile the map.

Fifth step

Open the .lmp file that you previously extracted from the .bsp (located in left4dead2/maps).

Example:

c2m4_barns_l_0.lmp

Once opened, scroll to the end of the file. Then open the new compiled .bsp and copy the edited lines.

Add the lines you created at the end


Something like this


Once that's done, drag the .lmp file into the lmpfix program so it can fix it.

Sixth step

Create a folder named resource and inside it, a file: closecaption_your_language.txt

Basic content:

// TEMPLATE
"lang"
{
    "Language" "Your language"
    "Tokens"
    {
        "testcommands" "<clr:255,0,0>This is red<I> italics<B> bold <cr><clr:255,255,255>white again."
        "title_name" "<clr:255,255,255>Subtitle line"
    }
}

Example:

// EXAMPLE
"lang"
{
    "Language" "english"
    "Tokens"
    {
        "npc.map4_hippie1" "<clr:255,255,255>hippie: Hello world"
    }
}

Save the file.

Seventh step

Create a gameinfo.txt file in the same folder, like this:

resource > "closecaption_your_language.txt"
gameinfo.txt

Eighth step

Drag the closecaption_your_language.txt file onto captioncompiler.exe (found in the bin folder).

This should generate: closecaption_your_language.dat in the resource folder.

Note.pngNote:If it doesn’t work, open CMD and type:
cd C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2
"../bin/captioncompiler" "../../left4dead2_subtitles_custom/resource/closecaption_your_language.txt"

(Make sure to adjust the path and folder name according to your installation.)

Conclusion

Done! That’s everything you need to do for subtitles to appear in official campaigns, in case you want to add new ones.