# String Modding

Information for people who are looking to create mods that affect Text.

# Extracting Strings

<p class="callout warning">See [Extracting Resources](https://wiki.eternalmods.com/books/beginners-guide-how-to-create-mods/page/extracting-resources) before proceeding. You must have **gameresources.resources** extracted.</p>

<p class="callout info">A [string](https://en.wikipedia.org/wiki/String_(computer_science)) is a sequence of characters (text) that appears literally.</p>

### Extracting Tools

**BlangJsonGeneratorUI by PowerBall253 - [Download](https://github.com/PowerBall253/BlangJsonGeneratorUI/releases)** Modifies BLANG files and exports the changes as JSON.

**BlangJsonGenerator by PowerBall253 - [Download](https://github.com/PowerBall253/BlangJsonGenerator/releases)**  
Exports BLANG files into JSON, a format that can be edited with raw text editor, such as [Notepad++](https://notepad-plus-plus.org/).

**BlangParser by proteh - [Download](https://github.com/dcealopez/BlangParser)**  
Directly modifies BLANG files with a simple GUI.

<p class="callout warning">Currently, there are no released packages for BlangParser.  
You will either need to find a compiled version in the 2016+ Modding Discord server  
or compile it with a C# compiler.</p>

<p class="callout info">Each BLANG file usually range from 1.5 MB to 2 MB of storage.</p>

### Finding BLANG files

- As of Update 6.66 - Rev 1.1, the highest-priority string files are located in **gameresources\_patch1\\strings** from your resource output directory.
- Copy any language BLANG file of choice and paste is somewhere safe.   
    This will be the string file that you will modify.

### Extraction Instructions ( BlangJsonGenerator )

<p class="callout warning">It is **recommended** to create a folder containing both "**BlangJsonGenerator.exe**" and the unmodified **BLANG** file.</p>

- Run "**BlangJsonGenerator.exe**".
- Select option **1**.
- Input the name of the **.blang** file. ( ex: **english.blang** )
- Input the language name. ( ex: **english** )
- Input the name of the output file. ( ex: **english.json** )
- Close the executable.
- You may now edit each string value. See [Creating String Mods](https://wiki.eternalmods.com/books/beginners-guide-how-to-create-mods/page/creating-string-mods) for more information.

<p class="callout danger">The output folder **must** end with **.json**</p>

### List of Resources

<table border="1" id="bkmrk-resource-name-inform" style="border-collapse: collapse; width: 100%; height: 403px;"><tbody><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;"><span style="text-decoration: underline;">**Resource Name**</span></td><td class="align-center" style="width: 50%; height: 31px;"><span style="text-decoration: underline;">**Information**</span></td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">english.blang</td><td style="width: 50%; height: 31px;">Contains strings for the English language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">french.blang</td><td style="width: 50%; height: 31px;">Contains strings for the French language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">german.blang</td><td style="width: 50%; height: 31px;">Contains strings for the German language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">italian.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Italian language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">japanese.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Japanese language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">latin\_spanish.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Latin American Spanish language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">polish.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Polish language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">portuguese.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Portuguese language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">russian.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Russian language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">simplified\_chinese.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Simplified Chinese language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">spanish.blang</td><td style="width: 50%; height: 31px;">Contains strings for the European Spanish language</td></tr><tr style="height: 31px;"><td class="align-center" style="width: 50%; height: 31px;">traditional\_chinese.blang</td><td style="width: 50%; height: 31px;">Contains strings for the Traditional Chinese language</td></tr></tbody></table>

# Creating String Mods

<p class="callout info">See [Extracting Strings](https://wiki.eternalmods.com/books/beginners-guide-how-to-create-mods/page/extracting-strings) before proceeding.</p>

<p class="callout danger">Make sure to backup the unmodified **BLANG** file.</p>

<p class="callout success">Strings can be added to **BLANG** files, but you must reference them with **decls** files.</p>

### String Editing ( BlangJsonGeneratorUI )

- Extract the contents of **BlangJsonGenerator-\*.zip**.
- Open **BlangJsonGenerator.exe**, then go to **File** -&gt; **Open blang** **file...** to edit an existing BLANG file, or to **File** -&gt; **Open blang from .resources file** to edit a BLANG file contained in a .resources file. You can also go to **File** -&gt; **New...** to create a new BLANG JSON mod from scratch.
- You should now see something like this:

[![screenshot.png](https://wiki.eternalmods.com/uploads/images/gallery/2022-03/scaled-1680-/screenshot.png)](https://wiki.eternalmods.com/uploads/images/gallery/2022-03/screenshot.png)

- You may edit any string **Identifier** or **Text** you wish.
- To add a string, use the **+** button in the top-right corner.
- After modifying the strings go to **File** -&gt; **Save...** -&gt; Give it the same name as its original BLANG file, with the extension changed to JSON. (ex: **english.json**).
- Create the following folder directories in your **DOOMEternal\\Mods** folder:

**gameresources\_patch1\\EternalMod\\strings**

- Copy your **modified** JSON file into the strings folder.
- Run the **EternalModInjector** like normal.

### String Editing ( BlangJsonGenerator )

<p class="callout success">Any unused string can be **deleted**, so it can be **compatible** with other mods that affect other strings.</p>

- Create a backup for the string JSON file.
- Open the string JSON file. ( ex: **english.json** )
- The strings should be formatted like this:

[![image-1631218573399.png](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/image-1631218573399.png)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/image-1631218573399.png)

- If they are not, see the [Extracting Strings](https://wiki.eternalmods.com/books/beginners-guide-how-to-create-mods/page/extracting-strings) page, under **Extraction Instructions: ( BlangJsonGenerator )**
- Go to the Replace tab (CTRL + F) -&gt; Replace -&gt; Search Mode: Check **Regular expression**
- Input the following and select **Replace All** for each:

[1) ![image-1631217604007.PNG](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/image-1631217604007.PNG)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/image-1631217604007.PNG)  
**"identifier":**  
**"name":**

<p class="callout info">The "**Replace with :** " box is empty for screenshot 2.</p>

[2) ![image-1631217614687.PNG](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/image-1631217614687.PNG)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/image-1631217614687.PNG)  
**"modified": 0**

<p class="callout info">The "**Replace with :** " box is empty for screenshot 3.</p>

[3) ![image-1631217622425.PNG](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/image-1631217622425.PNG)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/image-1631217622425.PNG)  
**^(?:\[\\t \]\*(?:\\r?\\n|\\r))+**

- The results should be formatted like this:

[![image-1631218052834.png](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/image-1631218052834.png)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/image-1631218052834.png)

- The JSON file is now in a format that can be properly re-injected into DOOM Eternal.  
    Save a backup of this JSON file as well, so you would not need to go through this process again   
    (before the next DOOM Eternal update).
- Find the strings that you wish to modify. (CTRL + F)
- After modifying the strings of your choice, delete all other **unmodified** strings.
- Save your **modified** JSON file with the same name as it was exported. ( ex: **english.json** )
- Create the following folder directories in your **DOOMEternal\\Mods** folder:

**gameresources\_patch1\\EternalMod\\strings**

- Copy your **modified** JSON file into the strings folder.
- Run the **EternalModInjector** like normal.

<p class="callout info">The commas "," at the end of each string name and text are unnecessary and can be deleted.  
However, they do not impact the syntax in any way.</p>

<p class="callout success">Since JSON files can be edited with raw text editors,   
you can execute scripts or [regular expressions](https://en.wikipedia.org/wiki/Regular_expression) to edit strings more efficiently.</p>

### String Editing ( BlangParser )

<p class="callout danger">The entire **BLANG** file will be modified, which means it will be **incompatible** with other string mods.</p>

- Extract the contents of **BlangEditorv#.#.zip**
- Open **BlangEditor.exe** you should be prompted with the following:

[![image-1631220049230.PNG](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/image-1631220049230.PNG)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/image-1631220049230.PNG)

- You may edit any string **Identifier** or **Text** you wish.
- Upon highlighting a string line, you may select the **DELETE** key to remove it.
- To add a string, scroll down to the bottom of the list and add your own **Identifiers** and **Text** lines.
- After modifying the strings go to **File** -&gt; **Save As...** -&gt; Give it the same name as its original BLANG file.   
    (ex: **english.blang**)
- Create the following folder directories in your **DOOMEternal\\Mods** folder:

**gameresources\_patch1\\strings**

- Copy your **modified** BLANG file into the strings folder.
- Run the **EternalModInjector** like normal.

<p class="callout warning">It is not recommended to delete existing string lines because DOOM Eternal will fail to recognize them.</p>

# String Customization

<p class="callout info">Strings can be customized to help specific characters stand out.</p>

<p class="callout success">String customization applies to both **BLANG** files and **idGuiEntity\_Text** entities.</p>

### Available Colors

<p class="callout info">Start with ^ then a character from the list below, then end with ^7   
Ex: "^5sample text^7" (without quotations) This will make the text <span style="color: #00ffff;">**teal**</span>.</p>

^a - <span style="color: #ffcc00;">**Gold**</span>  
^b - <span style="color: #00ccff;">**Light Blue**</span>  
^c - <span style="color: #99cc00;">**Green Yellow**</span>  
^d - <span style="color: #ff6600;">**Orange** </span>^z - <span style="color: #ffffff; background-color: #333333;">**White**</span>  
^0 - <span style="color: #000000; background-color: #ffffff;">**Black**</span>  
^1 - <span style="color: #ff0000;">**Red**</span>  
^2 - <span style="color: #00ff00;">**Green**</span>  
^3 - <span style="color: #ffff00; background-color: #333333;">**Yellow**</span>  
^4 - <span style="color: #0000ff; background-color: #ffffff;">**Blue**</span>  
^5 - <span style="color: #00ffff;">**Teal**</span>  
^6 - **<span style="color: #ff00ff;">Purple</span>**  
^7 - <span style="color: #ffffff; background-color: #333333;">**White**</span>  
^8 - <span style="color: #808080;">**Gray**</span>  
^9 - <span style="color: #000000; background-color: #ffffff;">**Black**</span>

<p class="callout info">In general, helpful tips are colored <span style="color: #00ffff;">**teal**</span>, dangerous threats are colored <span style="color: #ff0000;">**red**</span>.</p>

#### Spacing

\\n - New Line  
\\t - Tab

#### Examples

^2Green Yellow^7 -&gt; <span style="color: #99cc00;">**Green Yellow**</span>  
^1Red^7 ^aGold^7 -&gt; **<span style="color: #ff0000;">Red</span> <span style="color: #ffcc00;">Gold  
</span>**^1R^7^da^7^3i^7^2n^7^5b^7^bo^7^6w^7 -&gt; **<span style="color: #ff0000;">R</span><span style="color: #ff6600;">a</span><span style="color: #ffff00;">i</span><span style="color: #00ff00;">n</span><span style="color: #00ffff;">b</span><span style="color: #00ccff;">o</span><span style="color: #ff00ff;">w</span><span style="color: #ffcc00;">  
</span>**This is a ^5sample^7 tip -&gt; **This is a <span style="color: #00ffff;">sample</span> tip** First line\\nSecond line -&gt; **First line**  
 **Second line** Sample\\tText -&gt; **Sample Text**

<p class="callout warning">**Up to 9 separate color identifiers can be present in one string line.   
Any additional colorization will cause some to be ignored.**</p>

### **See Also**

- [idGuiEntity\_Text](https://wiki.eternalmods.com/books/entities-custom-encounters/page/idguientity-text)

# String File Extensions

<p class="callout info">These are the string file types you will be interacting with.</p>

##### .blang

String files that **CANNOT** be read by a raw text editor.  
BLANG files **CAN** be re-injected into DOOM Eternal.  
<span style="text-decoration: underline;">Example:</span>  
**`english.blang`**

##### .json

Extracted string files that **CAN** be read by a raw text editor.  
JSON files **CANNOT** be re-injected into DOOM Eternal.  
<span style="text-decoration: underline;">Example:</span>  
**`english.json`**