How to Add a New Email (LE2) - ME3Tweaks/LegendaryExplorer GitHub Wiki

This tutorial goes over how to add emails to LE2. An explanation of the technical side of how adding emails works can be found here

Set up Your DLC Mod

There is a really good guide on setting up a DLC mod found here. You won't need to go beyond Step 3, opening your DLC mod folder.

Creating the .emm file

Open a new, blank Notepad or Notepad++ document, then save it in your DLC folder's CookedPCConsole as EmailMergeInfo.emm

  • You must save it with the title and file extension exactly as it's written here. This has to do with how the Mod Manager adds new emails to the game. The documentation on it can be found here
  • To find your mod's CookedPCConsole folder, follow the directory of Me3TweaksModManager/mods/LE2/YourDLCFolderName/CookedPCConsole

We will come back to this file once the new emails have been added into the mod

Adding New Emails to the TLK File

Within Legendary Explorer, open the TLK Editor. Go to File ->Open, then select the TLK file you want to edit from the CookedPCConsole folder of your DLC folder. INT is the file for English, ESN is Spanish

It should look like Figure 1

Figure 1

The numbers on the lefthand side are TLK string IDs. These are what the game references to load emails and their contents

Figure 2

We don't need the Male and Female strings, so you can delete those. Click on the string, then Delete String. These are the ONLY strings you should delete.

Figure 3

Click on "Add String"

Figure 4

A box will pop up that says "Set new string ID". You can choose the number you set

Figure 5

These need to be unique to add a new email. The string IDs are referenced in the EmailMergeInfo.emm file, and are used to tell the game what email to load. If you have the same string ID as another email, yours might not show, or it might overwrite the other one.

I highly recommend checking the mod pages of other email mods to see which TLK String IDs they use in their mods.

Known string IDs in use as of 12/29/23:

  • 5300-5302
  • 5300123-5300128
  • 226221
  • 392073
  • 36629886-36629951
  • 2634759 - 2634984
  • 5931300-5931411

I recommend using numbers that are sequential to make it easier to keep them straight. Personally, I do mod number+123, mod number+124, etc. Once you've typed in your new string ID, click OK

The box at the bottom that says New Blank Line is where you'll type what you want to show in game. When you're done, click enter or save

You'll need 2 lines for adding a single email, 1 line for the subject and one for the body. Once you've added all the content you want, click File -> Save

Now do the same thing for the TLK strings in all the other language files.

  • NOTE: You might be able to edit the line with the language and Save as -> Select the language you just edited for. I haven't tested this myself however, because the code for the language is not a one to one. For example, the name of the TLK file might be DEU, but the TLK string for the language is de-de.

Congrats, you've added your new emails! Now it's time to make them show up in game

Setting the Email Send Triggers

Open the EmailMergeInfo.emm file you saved earlier.

Copy and paste the code below into your document

{    
    "game": "LE2",
    "modName": "YOUR MOD NAME HERE",
    "emails": [
        {
            "emailName": "YOUR EMAIL NAME HERE",
            "statusPlotInt": XXXXX,
            "triggerConditional": "local BioGlobalVariableTable gv;gv = bioWorld.GetGlobalVariables();return gv.GetInt(XXXXX) == 0 && gv.GetBool(XX) == FALSE;",
            "titleStrRef": EMAIL SUBJECT TLK ID,
            "descStrRef": EMAIL BODY TLK ID
        },
    ]
}

Some of the information will need to stay exactly the same, but some of it needs be changed

The statusPlotInt needs to be a unique number. You CANNOT have multiple emails with the same statusPlotInt or it will cause issues with getting the emails to send.

Current known integers as of 12/23/23:

  • 23400-23403
  • 1200-1210
  • 1220-1259
  • 28210-28265

Once you've set the statusPlotInt for the email, you'll also want to put that number in for returngv.GetInt( )

The trickiest part of the EmailMergeInfo.emm file is the "triggerConditional" section. This is where you'll determine what causes the email to trigger.

Setting Conditions for Emails to Trigger

ME2 uses plot variables such as bools to determine whether certain parts of the game are completed, and/or to mark which choices were made in previous games. They are assigned a certain number, which can be found in the asset database. If you're looking to trigger something after a main mission, they are marked as CR for critical.

For this tutorial, we're going to use part of my Platonic Horizon emails mod. For the first email, I wanted it to send after Horizon, if Kaidan was alive, if he was not romanced, and if the player had fought Cerberus. The first variable I decided to deal with was the timing of when the email would send; after Horizon was completed. To do this, I needed to find what the plot bool was for completing Horizon. In order to find the plot bool, I used the plot database to look up what bool notated it was done. Since Horizon is a Critical Mission and the first one, it's CR_1. So the plot bool is 312. So for our first conditional, it's going to be gv.getBool(312) == TRUE.

  • True means a box in the save editor IS checked, whereas false means it is NOT checked.
  • For something to send after a certain mission, the plot bool for it being Done needs to be checked, thus TRUE

Now we still have 3 more conditions to add, WHEW. The next one we'll do is if Kaidan is alive. To add another condition, we'll add on && gv.getBool(

To determine what the bool is, you can use the plot database to search for "Kaidan" and see which one is listed for Kaidan being dead. Now we can add this onto our code. However, since we want this to send when Kaidan is NOT dead, this bool would be set to FALSE gv.getBool(1541) == FALSE For any additional conditions, add on && gv.getBool() ==

Okay, you've set up your first email, woohoo!! If you have more than one email you're adding, you'll want to start a new line between where the arrow is pointing, then copy/paste the template below and follow the same steps to fill it out

        {
            "emailName": "YOUR EMAIL NAME HERE",
            "statusPlotInt": XXXXX,
            "triggerConditional": "local BioGlobalVariableTable gv;gv = bioWorld.GetGlobalVariables();return gv.GetInt(XXXXX) == 0 && gv.GetBool(XX) == FALSE;",
            "titleStrRef": EMAIL SUBJECT TLK ID,
            "descStrRef": EMAIL BODY TLK ID
        },

Once you've added all the emails to your EmailMergeInfo.emm file you want to, I HIGHLY recommend putting it through a json verifier to make sure all the symbols and code are as they should be. If everything comes back fine, go ahead and save your EmailMergeInfo.emm file

Now that it's saved, apply your mod and test it out!!!

If you have a lot of conditionals for your emails, test them after adding each one to make sure they're still firing when they should be, otherwise you might get to the end of adding 5 conditionals, have the email not send, and not know which one is the problem.

Go forth and send emails to your heart's content!