Guide: How to package and install mods with the current editor
After stumbling around the current editor until I figured out how to get my mod working with the base game, I thought a guide might be a helpful resources for others who aren't very familiar with Unreal's editor. The target audience of this guide is those who, like me, are new to making and packaging mods using Unreal Engine.
Please note that I am in no way an expert with Unreal Engine. There may be faster or more efficient ways to prepare mods for shipping. If so, please let me know and I'll update the guide! Another side note is that this way of preparing mod files for installation requires that you have Unreal Engine installed. With that, let's dive right in.
TLDR
- Cook your modded files
- Pack the cooked files into a .pak file named MW5Mercs-WindowsNoEditorX.pak (substitute a number for X)
- Move the .pak file into the Paks folder in your MW5Mercs installation directory
Cooking your files
So you've had a chance to play around in the editor and you've changed some files around to improve your gameplay experience. Congratulations! The first thing you will need to do is cook the files in Unreal Editor so that the game will recognize them. To do this, select Project Launcher from the Window tab. This will bring up the following window:
You want to focus on the WindowsNoEditor option. The default value for me in the Data Build section is On the fly. I change this to By the book or else my files won't cook.
After this has been changed click Launch and prepare to wait! Cooking the files takes my computer about an hour because it cooks all of them, not just the modified ones. If you know how to limit the number of files you're cooking, let me know!
*Edit* It turns out you can cancel the cook after the files you are interested in have finished cooking. It only takes my computer a couple of minutes to cook the .uasset weapon files, for example. I can cancel after that and move forward with packing.
You may run into an error at the end, but that's okay. To check that the mod files are ready for packaging, navigate to MW5Mercs folder in your Mechwarrior5Editor install. There should be a folder called Saved. Click on that, then click on the Cooked folder. There should be a folder called WindowsNoEditor that contains two folders, Engine and MW5Mercs. These are the folders you'll need to reference when packing your mod. The address to find these files will probably look something like this:
C:\Program Files\Epic Games\MechWarrior5Editor\MW5Mercs\Saved\Cooked\WindowsNoEditor
If your files are inside one of these two folders, congratulations! You're ready to pack your mod.
Preparing the packing instruction file
I use the command prompt to pack my files. There may be other ways, but I'm unaware of them. The first thing I do is create a .txt file detailing which files the computer should pack and what access permissions those packed files will have.
To do this, create a text document. Each line will need two pieces of information, separated by a space. The first piece of information is the location of the files you are going to pack. For example, if I had made changes to PPCs I would need to find the address of the cooked files and enter that as my first piece of information. On my computer that would be:
"C:\Program Files\Epic Games\MechWarrior5Editor\MW5Mercs\Saved\Cooked\WindowsNoEditor\MW5Mercs\Content\Objects\Weapons\PPC\*"
The asterisk tells the packing utility to pack every object within the specified folder. If you just want to pack specific files, you can replace the asterisk with the exact filename and create a separate line for each file you want to pack.
Enter a space after the packing address and enter the following:
"../../../MW5Mercs\..."
Replace the ... with the address to the file folder where the original packed files are located within the MW5Mercs directory (or Engine directory, if you've changed files there). With the PPC example above, I would enter the following:
"../../../MW5Mercs\Content\Objects\Weapons\PPC\"
This will let your new packed files access and override the original game files once your final .pak file is placed in the Paks folder in the MW5 install directory. In the PPC mod example, the first line of text in my .txt file would be:
"C:\Program Files\Epic Games\MechWarrior5Editor\MW5Mercs\Saved\Cooked\WindowsNoEditor\MW5Mercs\Content\Objects\Weapons\PPC\*" "../../../MW5Mercs\Content\Objects\Weapons\PPC\"
Add additional lines for additional content you want included in your packed mod and when you're done and your .txt file has been saved, it's time to pack your files!
Packing your files
To pack them with the command prompt, open it as an administrator. Now you'll need to find UnrealPak.exe, which should be located within the Unreal Engine install directory. Mine is here:
The address will probably look something like:
C:\Program Files\Epic Games\UE_4.23\Engine\Binaries\Win64
You may be able to drag this file directly into command prompt, or you may have to enter the address manually, as so (the quotation marks are necessary): "C:\Program Files\Epic Games\UE_4.23\Engine\Binaries\Win64\UnrealPak.exe"
Next you'll enter the location and filename for your new packed file. The filename will need to be the following or the packed mod will not work: MW5Mercs-WindowsNoEditorX.pak (substitute a number for X).
Enter a space, then enter -Create=.txt file location. This will point the packing utility to your instruction file, which will tell it which files to pack and what permissions to give them. To pack the PPC mod I have been using as an example, I would use the following text:
C:\Users\Agram\Documents\Backups\MW5\Mods\TextFiles\PPCdataToPack.txt
So to provide a complete example, if I were packing the PPC mod mentioned earlier I would enter the following text in the command prompt, then click enter:
"C:\Program Files\Epic Games\UE_4.23\Engine\Binaries\Win64\UnrealPak.exe" C:\Users\Agram\Documents\Backups\MW5\Mods\MW5Mercs-WindowsNoEditor1.pak -Create=C:\Users\Agram\Documents\Backups\MW5\Mods\TextFiles\PPCdataToPack.txt
A quick note on quotation marks and the command prompt: if your file address or path includes folders or filenames with spaces, you will need to surround the entire address in quotation marks. If it doesn't, they aren't necessary.
Installing your mod
Now for the easy part. To install the mod, simply copy the new .pak file you created to the Paks folder in your MW5Mercs installation directory. Mine is located here:
C:\Program Files\Epic Games\MW5Mercs\MW5Mercs\Content\Paks
A quick note - a .pak file with a higher number will override a .pak file with a lower number. If MW5Mercs-WindowsNoEditor1.pak and MW5Mercs-WindowsNoEditor2.pak both make changes to identical files, the game will ignore the changes in MW5Mercs-WindowsNoEditor1.pak.
And that's it! If there are ways this guide can be improved, please let me know. As stated at the beginning, I am no expert with modding or Unreal Engine. I'm hoping PGI releases tools soon that make this whole process easier.
Additional Help
u/Night_Thastus posted a video guide in the comments that walks you through the steps of making .pak files for MW5 Mercs. Linking it here: https://www.youtube.com/watch?v=MKjEfqXwH3k
Posted Jan 19, 2020, 5:18 PM UTC · edited
Thanks for this!
I actually tried cooking my files before but ran out of disk space and so I tried something else, to no avail.
I am cooking now and will let you know how the rest goes (which I'm already familiar with.)
Just to be clear you are doing the cooking and editing with the MW5Editor correct? Not some other version of UE4?
You are welcome! I am using the MW5Editor, not my other version of UE4.