XCOM 2
Not enough ratings
XCOM 2 Voicepack Creation Definitive Guide
By Ayser
This guide details how to the use the XCOM 2 mod tools to create a cooked voicepack with Voice Patcher support, and user adjustable volume in 2024.

This guide assumes you're using Windows 10 or higher.
3
3
   
Award
Favorite
Favorited
Unfavorite
Information Section
What is a voicepack in this game?
A 'voicepack' is the voice that is used by your soldiers in the tactical engagements of the game. The game offers many different voice options within the character customization, but some people may want to add their own. This guide will hopefully help with that.

What is cooking?
'Cooking' is the act of compressing the assets used in the packages to greatly reduce file size, and thus, loading times in-game.

For voice mods in particular, the size of the mod can be reduced as much as 90% when comparing to an uncooked version of the same mod. This is extremely helpful since before this development, sound files were kept in uncompressed WAVs within the asset packages, leading to some voice mods being hundreds of megabytes in size, even if they don't actually add that much content.

Only thing is, you have to set up the mod in a very specific way or it won't work. And there are still parts of the process that can be confusing even with the current documentation, or just haven't been documented at all. Part of the purpose of this guide is to provide a set method that anyone can use to easily cook their voice mod, so long as they can read a step-by-step process.

If you want to know more about cooking in this game, you can follow
>this link<.

What is Voice Patcher?
Voice Patcher is a mod created by Aquilio that adds additional voice events that can be supported by your soldier voice in the mod creation process.

A 'voice event' is a trigger that allows dialogue to play. If a happening within the game does not have a voice event assigned to it, you cannot set dialogue to play during it. The vanilla game is somewhat lacking in its voice events, but having Voice Patcher will allow you to assign dialogue to almost anything you might want to.

It should be noted that the mod is only supported if you're using the 'War of the Chosen' expansion pack. If a user of your mod does not have that DLC, they can still use your voice mod, they just won't be able to subscribe to Voice Patcher to hear the additional dialogue supported by it.

Additional note:
You don't actually need to have the mod installed during the mod creation process. All voice events are included in the copy of Robojumper's script that is talked about later.

What is user volume adjustment?
Exactly as it sounds. A method to allow the user of the mod to adjust the volume of the voice as they see fit. This is a somewhat new development, as before, a users only option was to adjust the volume of every voice in the game via the games 'volume' sound slider. That, or ask the mod creator to manually adjust the volume of every voice cue used in the mod, and hope they accept your pleas.

Implementing this feature will allow a user of your mod to configure the volume of the voice however they see fit within a config file located in your mods directory. This also makes it easier on you, the mod creator, because you won't have to adjust the volume of each sound cue one at a time.
Installing the SDK
Step 1
Go to your Steam Library and install the 'XCOM 2 Development Tools'. Wait for it to finish installing.




Notes:
For the purpose of making a voice mod, the 'XCOM 2 War of the Chosen Development Tools' should not be used. Using the WotC tools to make a voicepack will mean the mod won't work if you don't have WotC installed. I have tested this personally.
If you absolutely need to use the WotC SDK, make sure you have the first-time fixes applied. Without those, you will not be able to cook any type of mod in WotC SDK.

Other note:
Please, please, do not install the SDK onto Onedrive. These tools are finicky enough as it is without being on the Cloud.



Step 2
After finishing installation, install both the redistributables located in the games directory at:
..\steamapps\common\XCOM 2 SDK\Binaries\Redist
It will prompt you to restart once they're done installing. Do so.
SDK Setup
ModBuddy shortcut
1. Go to the directory at:
..\steamapps\common\XCOM 2 SDK\Binaries\Win32\ModBuddy
2. Make a shortcut of 'XCOM Modbuddy.exe' and move it to your desktop.

Unreal Editor Shortcut
1. Go to the directory at:
..\steamapps\common\XCOM 2 SDK\Binaries\Win64
2. Make a shortcut of 'XComGame.exe' and move it to your desktop.
3. Rename the shortcut to 'UnrealEditor.exe', since that's essentially what it is.
4. Right click the shortcut and edit properties.
5. Add the following text at the end of the 'Target:' box.
editor -noscriptcompile -nogadwarning

Make sure there's a space between the quotation mark and 'editor'.

Example:
"..\steamapps\common\XCOM 2 SDK\Binaries\Win64\XComGame.exe" editor -noscriptcompile -nogadwarning


Setting Modbuddy Paths
ModBuddy needs to have the paths for your game and SDK directorys set.
1. Open ModBuddy and navigate to the options.


2. At the bottom of the new window, expand 'XCOM 2' and set the install path and the user path.

The install path should be set to the 'XComGame' folder in your regular game directory.
..\steamapps\common\XCOM 2\XComGame\

The user path should be set to the 'XComGame' folder in your SDK directory.
..\steamapps\common\XCOM 2 SDK\XComGame\
Additional Tools & Setup
Iridar's Enhanced Mod Project Template
Iridar's Enhanced Project Template makes the cooking process MUCH easier. This guide assumes you'll be using it.

1. Download the 'EnhancedModProjectTemplate.zip' from >this link<[github.com].

2. Place the newly downloaded zip file in the following directory:
..\steamapps\common\XCOM 2 SDK\Binaries\Win32\ModBuddy\Extensions\Application\ProjectTemplates\XCOM2Mod\1033\

Robojumper's Voice Script
Robojumper's Voice Script is necessary to support additional voice events added in Voice Patcher. This guide also assumes you'll be using this.

1. You don't have to download anything for now, just keep track of >this link<[pastebin.com] for later. It is a version of the script that has all possible voice events already listed, and also allows support for volume adjustment via a config file. I would, however, look through the comments of each voice event to know exactly what in-game instances can have dialogue assigned, and what the event for it is named.

Alternative Mod Uploader
Generally a good thing to be using. Without it, your options for tagging and updating the mod are much more limited. It's not required for this guide, but it is highly recommended.

1. Download it by subscribing to its workshop item >here<.

2. Navigate to:
..\steamapps\workshop\content\268500\1134322341\
Copy the 'Binaries' folder here.

3. Paste that folder at:
..\steamapps\common\XCOM 2 SDK\Binaries\

4. Create a shortcut of 'Firaxis.SteamWorkshop.exe' and put it on your desktop. We'll use this later when you're about to upload your mod.

Audacity
Audacity is popular free sound editor. Apparently some don't like it, but the 'Sound File Editing' section of this guide assumes you're using it.

1. Download the Audacity installer from >this link<[www.audacityteam.org].

2. Install it.
Sound File Editing
This section covers how the voice lines you collect can be processed through Audacity.
This guide will not cover how to actually obtain all the voice lines you'll be using. That will be entirely up to you, whether it be from a game resource website, spliced from a Youtube video, or extracted directly from the files of a game.

Once you have all your lines, you should organize them by naming them according to the action you plan to have them play on. This will likely take a considerable amount of time, depending on how meticulous you want to be. You can reference Robojumper's script from earlier if you need to know exactly what can have dialogue assigned.

The file names cannot have spaces, special characters, or non-Latin scripts characters in them like Cyrillic or Kanji.

For reference, this is how XCOM: Enemy Within labeled the voice lines:



I've personally labelled all the lines I'm using as shown below:



Open Audacity.
What we'll be doing is creating a macro we can use to easily process all the voice lines in bulk with minimal user input.
At the top, click 'Tools > Macro Manager'.


It will open the list of macros you have saved. Ignore the clutter.
Click 'New'.


It will prompt you for a name. Enter one.


Click the 'Insert' button on the right so we can begin inserting commands into the macro.


First command you should apply is 'Mix Stereo down to Mono'. All sound files used in the game must be in mono format, or they won't work.


If you intent to apply a radio filter to your voice lines, insert the 'Filter Curve EQ' command in the macro. You should adjust the parameters until you get. You can also use one of the many presets available. In this case, I'm using the 'Telephone' preset.





Now, you should insert the 'Normalize' command. This will do one of two things, either make the sound louder, or do nothing if the waveform already reaches peak at some point. This should be applied after the radio filtering because it slightly lessens the sounds amplification, and normalizing will fix that.



Second to last at the end, the sample rate for the sound should be set to either 22050Hz or 44100Hz. If the sounds sample rate deviates from these, it will not work in-game.



Final command in the process should be 'Export as WAV'. All sounds used in voicepacks must be in 16-bit WAV format.


If you are knowledgeable about sound editing, you are more than free to further modify the macro to whatever extent you wish. For me, the final macro is shown below.
Click 'Files..' at the bottom.


It will open a Windows Explorer instance. Navigate to where you stored all your voice lines. Ctrl + A to select them all. Click 'Open'


It will begin processing all your lines. This could take some time, depending on how many lines there are, and how powerful your PC is.


You will find all the newly filtered voice lines in the following directory:
..\Documents\Audacity\macro-output\

You are now free to begin the process of actually making the mod using the SDK.
Creating the Mod Project
This marks the beginning of the process for creating the actual mod. Follow the instructions in this section to the letter, as ModBuddy can be very picky about the mods contents when compiling. Especially if you're going to cook it.

Step 1.
Open Modbuddy and select 'New Mod..'




Step 2.
In the new window, make sure you select the 'Enhanced Mod Project Template' that was downloaded earlier.




Step 3.
Give the mod a name. The 'Name' and 'Solution name' fields must be identical. This has to do with the way the game cooks the mod when we get to that step.



Once you've decided the name, click 'OK'.


Step 4.
A new window will open to allow you to change the mods title and description. The mod title here must be the same as the mod name and solution name from earlier. The description can be changed later, so it's fine to ignore it.



Once it's done, click 'Finish' at the bottom.


Step 5.
The mod project is now created and ModBuddy should have it open. It should look like this:


Immediately close ModBuddy



Step 6.
Navigate to the project directory in Windows Explorer and run the .bat file contained within.


After running it, the directory should now look something like this:



Step 7.
Open ModBuddy again and re-open the project. Expand all folders. ModBuddy should now look like this:



Step 8.
Delete the items specified in the image below. The items marked in red must be deleted or the project will not successfully build. This is because those scripts reference things that pertain only to the 'War of the Chosen' expansion pack, but we're using the base-game SDK.


Note:
You might want to check in Windows Explorer if the files were actually deleted, since ModBuddy can be kinda iffy when deleting files.

Other Note:
You can probably delete 'X2DLCInfo_ExampleMod.uc' too, but I didn't for this guide.


Step 9.
Right click the 'Config' folder on the left pane and select 'Add > New item'.


Step 10.
In the new window, select 'Configuration File' and name the file 'XComContent.ini'. This is case sensitive.


Click the 'Add' button at the bottom when you're done. We will edit this file at a later point.


Step 11.
Create another new file in the same way, but call it 'XComVolumeConfig.ini' instead. This is case sensitive.


Click the 'Add' button at the bottom when you're done. We will edit this file at a later point.


Step 12.
Right click the 'Classes' folder on the left pane and select 'Add > New item'.



Step 13.
In the new window, select 'UnrealScript' and name it something entirely unique that likely won't conflict with other mods. This is the file that will house Robojumper's voice script.


Click the 'Add' button at the bottom when you're done.


Step 14.
Now that the file is created, select it in the viewer. It should be completely empty, minus the one comment.


Open the pastebin link from before that had the copy of Robojumper's voice script. Copy the script.



Step 15.
Paste the script into the newly created UnrealScript file in ModBuddy.


Step 16.
At the top of the script file, change 'InsertFileNameHere' to the name of the script file.
Change 'InsertConfigFileNameHere' to the name of the volume config file we made earlier, but without the 'XCom' at the beginning.


It should now look something like this:


Save changes once you're done.

Step 17.
Select the 'XComVolumeConfig.ini' file we made earlier. This file houses the configuration setting for the voices volume. Enter the following information into it.
[InsertModNameHere.InsertScriptFileNameHere]

VOLUME_MULTIPLIER=1



Save changes once you're done.

Step 18.
Click 'Save All' and then 'Build Solution' at the top.


If it doesn't give you an error, then you did everything up to this point correctly.

IMPORTANT NOTE:
If you do not build solution at this step, you will not see the script in Unreal Editor once we start using it. Building solution is necessary every time you make changes to the script file so those changes are reflected in the Unreal Editor.
Creating the Voice Package Pt.1
We will now be creating a package that contains all the assets for the voice, those being:
1. The sound cues.
2. The voice archetype.
3. The sound files themselves.

If your mod will have more than one voice in it, go through this section again after finishing each.

Step 1.
Open Unreal Editor that we made a shortcut for earlier in the SDK setup section. If it pops up any windows with prompts, either select 'No' or 'OK'.

Step 2.
When it pops up, you'll see this:


We are only concerned with the 'Content Browser' window for this whole process. Ignore the actual Unreal Editor in the back.
Your Content Browser will ikely look a bit different from mine at first. Click 'Packages' at the top left to expand that menu. Then click the icon at the bottom to switch to Horizontal Split View if you wish to follow along with what I do as closely as possible.


Step 3.
Click the 'Import' button at the bottom so we can import our sound files into a new package.


Step 4.
Navigate to where you have all your voice lines stored after you processed them through Audacity. Once you're there, use the Ctrl + A hotkey to select all items in the directory.


Once you've selected them, click 'Open'.

Important Note:
Do not import the lines anywhere in the package but its root directory. If you import them into a sub-directory, you will not be able to cook the mod later.

Step 5.
It will open a new 'Import' window, as shown below:


You will enter the name of the package that the files will go into. If the package name does not exist, it will create a new one. The actual name of the package doesn't need to be specific, but you shouldn't use special characters or alternate scripts. Click 'OK To All' once you've named it.


Important Note:
Do not give the content package the same name as your mod. They must use different names.

Step 6.
The package will now be showing in the left pane, and all the sound files on the right pane.
Immediately save the package to a backup location.



Note:
When you save the package again after editing the files within, it will prompt you with a message that says "The following packages have references to external packages". This is completely normal. Just click 'Yes' at this prompt to finish saving.


Step 7.
On the right pane, right click empty space and select 'New SoundCue'. Sound cues are how we set up voice lines to play at random.


Important Note:
Do not copy sound cues from other packages in the Unreal Editor. If the sound cue was already set up to play lines, it will still be pointing to the old location for those files, and the cue won't work. You should create all sound cues within the package they will stay in.

Step 8.
It will open a new window asking for the name of the sound cue.


The name should reflect the action you're planning to use the cue for. In this case, I'm making one for Psi Insanity.
Click 'OK' once you've named it.


Note:
Like everything else contained in the package, the cue name cannot have spaces or special characters. It also cannot use non-Latin script characters like Cyrillic or Kanji.

Step 9.
As soon as you click 'OK', it will open the sound cue editor for that cue. Ignore it for a second. We are now going to select all the voice lines we are planning to use in this voice cue.
Use the Shift + Click hotkey shortcut to select a grouping of voice lines. You can also use Ctrl + Click to select lines individually.




Step 10.
Now that the lines are selected, move the mouse to the sound cue editor window. Right click empty space and click 'Random: [NameOfFirstSoundFile]'


This will automatically place all the sounds in the editor and connect them to a random node.


Step 11.
Connect the random node to the speaker via the black input and output stubs.


You can now close the sound cue editor. Repeat steps 7-11 for every single sound cue you wish to make. This will take some time.

Note:
You can use Ctrl + Click to physically move nodes around within the editor.

Step 12.
Now that you've made all of your sound cues, we are going to assign the 'Voice' sound class to them. This is what determines what volume slider they use in the settings menu in-game.

Filter items by 'Sound Cues'.




Step 13.
Ctrl + A to select every single voice cue you've made.

Right click and select 'Sound Classes: > Voice'


Save the package.

Step 14.
We are now going to begin making the voice archetype. The 'archetype' is essentially what determines which cues play during what actions in-game.

At the top, switch to the 'Actor Classes' tab.


It should look like this:


Step 15.
Uncheck the boxes in the top left.


Step 16.
Search for the name of the Robojumper script we made earlier.


Note:
If you do not find your script after searching its name, close the editor, build solution again in ModBuddy, then search for it again.

Step 17.
Right click it and select 'Create Archetype'.


Step 18.
A new window will open where you will enter the package name that the archetype will go in, and the name of the archetype itself.


Click 'OK' when you're done.


Note:
You cannot specify your package name if you have not saved your package yet.

Other Note:
You also cannot specify your package name if it is not open in the Content Browser tab.
Creating the Voice Package Pt.2
Alternate section necessary because of section specific character limits. We are almost done with this part anyway.


Step 19.
Go back to the Content Browser tab. Look for the archetype you just created. When you find it, right click it and click 'Properties'.


Step 20.
It will open another new window.


Collapse 'XComCharacterVoice' and expand the Robojumper script name directly above it.
Click the wrench icon in the top right and click 'Expand All Categories'.


The window should now look like this:


This is the list of voice events in Robojumper's voice script.

Step 21.
We will now begin assigning sound cues to each of the voice events. In the Content Browser window, select the sound cue you wish to assign, then click the green arrow icon next to the voice event in the Archetype properties you wish it to play in.




Repeat this step for every single voice event you wish to assign dialogue to.

Note:
You do not need to assign a cue to every single voice event in the archetype. Leaving them unassigned simply means dialogue won't play during them. With how many voice events there are, some will naturally have to remain silent.

Other Note:
If you mistakenly assign something to a voice event that you didn't mean to, you can right click it and click 'Reset to Default' to unnassign the voice event.


Other other Note:
If you add a voice event to your script in ModBuddy and build solution, you'll notice that it won't show up automatically in the Archetype you already made. To add the new event, you can use the green plus sign in the top right of the Archetype properties window to add it manually. Otherwise, you'd have to create a whole new Archetype.

Step 22.
Now that you are done assigning cues to voice events, we can close out the archetype properties window. Click the X in the top right.


Note:
If you ever want to make changes to the archetype after closing the editor, Build Solution in ModBuddy to ensure it detects the script.

Other Note:
One disadvantage of using Robojumper's voice script is that if you move the package to another mod project, you must remake the archetype from scratch. Keep this in mind if you ever decide to merge multiple voice mods into one.

Step 23.
In the Content Browser, right click the archetype and click 'Copy Full Name to Clipboard'.


Paste in somewhere you won't lose it, such as a text editor. We will need it later.


If your mod will have more than one voice, repeat this section (both Pt.1 and Pt.2) for each voice.


Step 24.
Save the package and close the Editor.

Voice Event Notes
This section is dedicated to providing information on specific voice events.

Dashing
This is the voice event that's used for the preview in the customization menu in-game.

SquadMemberDead
This triggers the very instant another one of your soldiers dies. I would recommend putting a delay module on it so it plays a bit after the death screen and stinger sound effect. In this instance, I put a 2 second delay on it.


All Hacking Related Events
Some of the hacking related voice events are, putting it lightly, broken. Refer to the following youtube video.
https://www.youtube.com/watch?v=cuDbRZzruTY
So what does this mean? You should probably leave the 'HackTurret', 'AttemptingHack', and 'HaywireProtocol' events unassigned, lest they risk doubling up dialogue at certain points in-game. Do note that it is only a chance to double up, so there is still some incentive to providing dialogue for them if you really wanted to.

TargetHeard & AlienMoving
These both play during the exact same scenarios. The game uses randomization to decide which one is used for a specific instance. You should assign the same sound cue to both of these.

In XCOM 2, these events trigger the very instant that the soldier begins hearing the sound. In XCOM: Enemy Unknown, there is a roughly 1.5 second delay before the line plays after the visual cue. You could use a delay module to mimic the EU behavior for the event.

HostileVIP
This triggers both when spotting and after picking up a Dark VIP. Unknown why it's coded like that. Just keep it in mind when assigning dialogue to it.
Config Edits & Localization
Step 1
Open ModBuddy (again) and open your mod project.

Step 2
Right click on the 'Content' folder and select 'Add > Existing Item'.


Step 3
It will open a Windows Explorer instance. Navigate to where you saved your voice package from before.


Click 'Add' once you've selected it.

It should now look like this:


Step 4
Click the 'XComContent.ini' file we made earlier. It should be empty at the moment.


We will now begin editing it to add the voice entries. At the top, there should be the following text:
[XComGame.X2BodyPartTemplateManager]


Now on a new line below that, insert the following text:
+BodyPartTemplateConfig=(PartType="Voice", Language="none", Gender=eGender_Male, TemplateName="UniqueTemplateName", ArchetypeName="PackageName.ArchetypeName", bCanUseOnCivilian=false)
Once both lines are pasted, the file should look like this:




Step 5
You will now change the various fields in the entry based on however you want the voice to be configured. I'm going to go over each one individually.

PartType="Voice"
Leave this unchanged, as it's what determines what menu the part shows up in.

Language="none"
This is what determines what soldier nationality will get assigned the voice at random.
Language="none"
No soldier will get the voice at random. You can still assign it to them manually in-game.

Language="english"
Soldiers with their nationality set to 'United States' will get assigned the voice at random.

Language="englishUK"
Soldiers with their nationality set to 'United Kingdom' or 'Scotland' will get assigned the voice at random.

Language="englishAUS"
Soldiers with their nationality set to 'Australia' will get assigned the voice at random.

Language="french"
Soldiers with their nationality set to 'France' will get assigned the voice at random.

Language="spanish"
Soldiers with their nationality set to 'Spain' or 'Mexico' will get assigned the voice at random.

Language="german"
Soldiers with their nationality set to 'Germany' will get assigned the voice at random.

Language="italian"
Soldiers with their nationality set to 'Italy' will get assigned the voice at random.
Note:
If the 'Match soldiers language to nationality' option in your game settings is turned off, then all soldiers will only use voices for whatever your games language is set to.

Gender=eGender_Male
This is what determines which soldier gender the voice can be assigned to.
Gender=eGender_Male
The voice can be assigned to male soldiers.

Gender=eGender_Female
The voice can be assigned to female soldiers.
Note:
If you want the voice to be available for both genders, you will have to make a separate entry in the config with a different template name.

TemplateName="UniqueTemplateName"
The name of this doesn't need to be anything specific, but it shouldn't conflict with anything another modder may have used. Make note of whatever you name this for later.

In my case, I'm changing it to:
TemplateName="Ay_TestVoice"

ArchetypeName="PackageName.ArchetypeName"
The named of the archetype that we copied the name from ealier will go here. Only the selected text that's enclosed in quotations is relevant to the configuration.


In my case, it would be:
ArchetypeName="PhoenixCoopVoicePkg.PhoenixCoopVoiceArchetype"

bCanUseOnCivilian=false
This is what determines if your voice can be randomly assigned to civilians on Retaliation missions. You should probably keep this on false, because it can break immersion if a civilian dying has the voice of Solid Snake for some reason.

Repeat this process for however many voices you're doing.
Save changes once you're done.


Now that we've gone through the configuration, the completed entry for me looks like this:

For the information I've entered, the voice:
1. Will not randomly appear on any soldiers.
2. Is available for male soldiers.
3. Will not randomly appear on civilians.


Step 6
Open the 'XComGame.int' file in the 'Localization' folder. If there is information already stored in it that you didn't enter yourself (because of the template we used), you can delete it.


Step 7
Insert the following text:
[TemplateNameHere X2BodyPartTemplate]
Replace 'TemplateNameHere' with the template name you made earlier. In my case, it's 'Ay_TestVoice'.


Step 8
On the line directly underneath that, insert the following text:
DisplayName="In-Game Display Name"
Replace 'In-Game Display Name' with whatever you want the voice to appear as in the customization menu in-game. In my case, I'm making it 'Example Voice'


Step 9
Build Solution.

If there are no build errors, the mod should now be in a playable state.

Important Note:
Make sure Unreal Editor is closed when building solution. Building always fails if the Editor has not been closed.

Step 10
Load the game up and verify the voice is working properly. Make sure the mod is enabled in your mod loader. If the voice does not show in the customization menu, or if it doesn't play anything on the preview, you've done something wrong.
Menu Icon (Optional)
Some mods you'll notice have a little icon that is displayed in the customization menu next to the name of the item. Example below.



This section will detail exactly how to do this. This is entirely optional and otherwise has no bearing on the functionality of the mod. You can skip this section if you're not interested.

There are two methods to inserting UI into the customization menu:
1. The localization method.
2. The screen listener method.

This guide will show how to use the localization method as it's newer, easier to implement, and uses slightly less system resources in-game.

If, for some reason, you want to use the alternate screen listener method of icon injection for this, follow >this guide<.

Step 1
Find the image you want to use for the icon. Using an ODST icon as an example here.


Step 2
Import it into your paint program of choice. I personally use paint.net, so that's what I'll be using in the images.


Step 3
If the image is not 1:1 aspect ratio, convert it to one.




Step 4
The background should be transparent, so use the magic wand tool to select all the flat color that's not part of the icon and delete it.



Step 5
Resize the image to 32x32 pixels.




Step 6
Export the image as a .png file.



Step 7
Open Unreal Editor.
Import the image into a package with the naming format 'UILibrary_[ModName]'.



Click 'OK To All'.

Important Note:
Same as with the sound files, do not import the image files anywhere in the package but its root directory. If you import them into a sub-directory, you will not be able to cook the mod later.

Step 8
Right click the image in Unreal Editor and copy the full name. Paste it somewhere you can access it later.




Step 9
Save the package anywhere.


Step 10
In modbuddy, add the package to your mods content folder.



Step 11
In your XComGame.int file, paste the following at the beginning of the display name:
<img src='img:///PackageName.ImageName' width='26' height='26' vspace='-4'>



Replace 'PackageName.ImageName' with the name you copied earlier. In my case, it's 'UILibrary_ExampleVoicePack.ODST_Icon'.






Save changes.

Step 12
Build solution and verify it works in-game.
Cooking (Optional)
This section is technically considered optional because you could feasibly skip right to uploading the mod as it currently is and it would be fully functional. If you're not interested in cooking, just skip right to the 'Uploading' section.

Firstly, before attempting to fiddle with anything necessary to start cooking the mod:
Make. A. Backup.
Your entire project directory should be copied and placed somewhere safe.


Step 1
Open ModBuddy and open the 'ContentOptions.json' file. This file determines what packages are cooked during the cooking process. If you haven't touched it, it will look like this:


Step 2
All packages are named in this json file. I would label them in alphabetical order.

This is roughly what it should look like for you when it's complete. All but the last package will have a comma directly after the quotation mark.


Step 3
Move all packages in the 'Content' folder to the 'ContentForCook' folder.
Add the existing packages to the 'ContentForCook' folder in ModBuddy.



Step 4
Delete the original ones from the 'Content' folder.




Step 5
Using Windows Explorer, navigate to the .scripts folder in your project directory.


Use a notepad program to edit 'build.ps1'


Step 6
Scroll to the bottom of the script to the line where it says:
# $builder.SetContentOptionsJsonFilename("ContentOptions.json")


Remove the # and space directly proceeding it, so the line should now be:
$builder.SetContentOptionsJsonFilename("ContentOptions.json")


Save changes.

Step 7
Build solution in ModBuddy.


Step 8
Hope it doesn't give you a build error.
Uploading
Now for the process of actually uploading the mod to the steam workshop.

You may want to have a thumbnail image prepared at this point. The thumbnails used by XCOM 2 mods are 512x512 in resolution and use the jpg image format.

Step 1.
Using Windows Explorer, navigate to where your mod is stored in the SDK directory:
..\steamapps\common\XCOM 2 SDK\XComGame\Mods

The whole mod is placed here after you build solution for the first time.


Step 2.
Open your mod folder here and find the item with the file extension '.XComMod'. Edit it with a notepad editor.


Step 3.
In notepad, change the 'RequiresXPACK=true' from true to false. This is what determines if the game thinks your mod requires the War of the Chosen expansion. The only reason it was set to true here is because the cooking process automatically sets it to true, but your mod should work without the expansion if you're using the base-game SDK like you should. If you are using the WotC SDK, ignore this step.




If you plan on updating your mod in the future, every time you build solution in ModBuddy, you will have to set this back to false again.

Step 4. (Optional)
If you want to reduce file bloat, you can also go through and manually delete the following files:
1. XComEditor.ini
2. XComEngine.ini
3. XComGame.ini

These files are only relevant when building the mod, and aren't needed in the actual compiled directory, as they're just providing unneeded bloat.

WARNING:
This next part of the step is only valid for people that cooked their mod. If you didn't cook, go straight to step 5.

If you cooked the mod, you can also remove:
4. RobojumperScriptUniqueName.uc (Won't be the same for you)
Do not remove this file if you did not cook the mod.

This file is built into the packages of your mod after it's been cooked, and isn't needed in the actual compiled directory, as it's just providing unneeded bloat.

Step 5.
Open the alternative mod uploader that was talked about in the 'Additional Tools & Setup' section.
Click the 'Upload' button in the top right.


Step 6.
Click the '...' next to the text box to search for your mod project to upload.


Step 7.
Go to the same directory we were just at:
..\steamapps\common\XCOM 2 SDK\XComGame\Mods
Then select the 'XComMod' item again.


Click 'Open' once you've selected it.

Step 8.
Click 'Next'.


Step 9.
You should now be on a page that specifies all the information the mod will have in its workshop page once it's done uploading.


The title at the top does not change the internal name of your mod, it's just what your mod shows as in the Steam Workshop. This means you can have as many spaces and special characters as you want.

The description has a character limit and will give you a very unhelpful error if you surpass it. Be aware.

If you have a thumbnail prepared, you can upload it here. I do not.

Visibility is self-explanatory. Look at the options and you'll know.

Tags are separated by a comma and space.

The checkboxes directly under the tags are the set categories in the workshop search. For voice mods, they should probably be set to 'Voice' and 'Soldier Customization'.



Click 'Next' at the bottom when you're ready to proceed.

Step 10.
Click 'Upload on the next menu.


Step 11.
It will open a Windows Explorer window. You will navigate to your project directory and select the 'x2proj' file from there. This is so the uploader knows what mod to be used if you ever update in the future.


Click 'Open' after selecting it.

Step 12.
Click 'Finish' when it's done uploading.


Congradulations. Your mod is now fully finished and uploaded. You can go to its Steam Workshop page to edit the description, title, preview images and videos to your hearts content.

Note:
If you ever want to change the thumbnail, you must update the mod through the Alternative Mod Uploader. You cannot change it through the Steam Workshop.
Retroactive Implementation
This section is only for people that wish to update one of their old mods to use the newer features mentioned earlier.


Adding user volume adjustment
If your mod is using one of the older supplements of Robojumper's voice script[pastebin.com], it will not have the parts necessary support the config volume edits.

Good news is that this is extremely easy to implement. You don't even need to open the Unreal Editor.

Step 1.
In ModBuddy, open your script. It will probably look like this:


On the very first line, add the following text after 'XComCharacterVoice'
config(VolumeConfig)
The semicolon will directly proceed this text. This establishes the name of the config file that will be used to provide values to any unspecified variables in the script. It should look like below.


Step 2.
Two lines below that, add the following text:
var config float VOLUME_MULTIPLIER;
This establishes the variable we will use to change the volume of the cues in the voice package. It should not look like this:


Step 3.
Now moving a bit further down, directly underneat the 'Cue = FindSoundCue(nEvent)' text, insert the following:
Cue.VolumeMultiplier = default.VOLUME_MULTIPLIER;
This will make the archetype use this variable for the volume of the cues that are assigned to it, regardless of the actual value they were set to in the Unreal Editor. The script should now look like this:


Save changes

Step 4.
Right click the 'Config' folder and add a new Configuration file. Call it 'XComVolumeConfig.ini'.


Step 5.
Now you're basically doing the same thing we did in the 'Creating the Mod Project' section. In the file, add the address of the script file at the top and specify the variable on a line below. Then add the default value you want the cue volume to be in it. It will look something like this once you're done:


Step 6.
Build solution and make sure it works in-game. Update your mod afterwards.


Adding Voice Patcher support
If your mod is using one of the older supplements of Robojumper's voice script[pastebin.com], it will not have the newer Voice Patcher events listed. Alternatively, Voice Patcher may have received an update that added new voice events, and you wish to add support for them. Either way, this part will show how to do so without creating an entirely new script or archetype.

Step 1.
First, have a look at the voice events added through the mod on >this page<.

Step 2.
Once you've decided what voice events you want to add support for, open your project in ModBuddy and open your script file. Add the event on a new line somewhere. In my case, I'm adding the 'MimicBeaconThrow' event to my script.


Step 3.
Once you've added all the events you want, save changes and build solution.

Step 4.
Open the Unreal Editor, then open your voice package in it. Open the archetype properties window.

Step 5.
You will notice that the new voice event is nowhere to be seen. You have to manually add it. Click the green plus button in the top right.


Step 6.
This will cause a new unlabeled voice event to be added at the bottom of the list. Scroll all the way down.


Step 7.
Click the 'None' next to Event Name and manually enter the name of the voice event. In my case, it's 'MimicBeaconThrow.


Repeat steps 5-7 for each voice event you are trying to add.

Step 8.
Assign the cue you wish to use for each voice event.

Step 9.
Save the package and build solution in ModBuddy.

16 Comments
GigaLechu Mar 17 @ 9:37am 
I followed every instruction in the guide and I was able to make the mod, but for some reason only the movement cue are playing, not the grenades, misses, shots, anything. Any idea what could be happening? Also, the sound test wasn't playing any lines
Estevez Fuentes Rios Feb 3 @ 1:22am 
Another question, but sometimes some of the voice cues in game are very, very quiet, but sometimes they are normal volume. I find it confusing to understand why that might be. Any help is appreciated, thank you in advance.
Aquilio Jan 27 @ 9:31am 
Also, the .upk file needs to be inside the "ContentForCook" folder as well.
Aquilio Jan 27 @ 2:41am 
Are you trying to cook the mod? Check if your build.ps1 file has cooking enabled and check if the package name is correctly specified in the ContentOptions.json file.
Cara Jan 20 @ 10:21am 
@AlleeCatBlues I'm having the same exact error, but as far as I can tell, I have the directories fine :(

"Error 1 The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'E:\Games\Steam\steamapps\common\XCOM 2 SDK\XComGame\Script\BridgetsVoicePack.u' because it does not exist. C:\Users\Cara\Documents\Firaxis ModBuddy\XCOM\BridgetsVoicePack\.scripts\X2ModBuildCommon\XCOM2.targets 69 10 BridgetsVoicePack"
AlleeCatBlues Dec 25, 2024 @ 11:40pm 
Never mind. Looks like I didn't set up the paths correctly in my SDK options.
AlleeCatBlues Dec 25, 2024 @ 11:24pm 
When I try to build the solution at the end of Creating the Mod Project I get this error:

Error 1 The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'Documents\Firaxis ModBuddy\XCOM\PracticeVoiceMod\XComGame\Config\DefaultEngine.ini' because it does not exist. Documents\Firaxis ModBuddy\XCOM\PracticeVoiceMod\.scripts\X2ModBuildCommon\XCOM2.targets 69 10 PracticeVoiceMod

There's no XComGame folder in the project. I'm not even sure why it's looking for that. Did I do something wrong?
Ayser  [author] Dec 7, 2024 @ 7:54am 
Build solution for that project again, then search for it in the package. The archetype will not be visible in the package if you have built solution in a separate project since then. Dunno if I mentioned that anywhere in the guide, might have to add it.
Estevez Fuentes Rios Dec 6, 2024 @ 9:15pm 
I actually managed to make a successful voice pack due to your guide, thank you very much! I do have another concern though. I tried to edit the voice archetype in in XCOM 2 Editor, and I can't for the life of me seem to locate it. All of my Sound Cues and Sound Node Waves are still present though. Making t anew archetype with the same name resulted in it telling me, "Name is already in use by another object". So my original archetype is still present. My filters seem fine too. Again I'm sorry for bothering you with these, this is my very first mod hah. Thanks again.
Estevez Fuentes Rios Dec 5, 2024 @ 4:47pm 
Ahh yes thank you hah, I actually didn't know what to change the output verbosity to specifically. This is my first ever mod so I'm going into this a bit new. I managed to figure out that it was a name mismatch; just my poor typing skills. Thank you again. I'm still working at it. It's just a voicepack mod.