XCOM 2
75 ratings
XCOM 2 SDK (Modding) - Quick Start Guide
By Formaldeído
I will give you instructions on how to start creating XCOM 2 mods using the Development Kit.
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
http://gtm.you1.cn/storesteam/app/268500/

The XCOM2 SDK for making mods consists of three main components:
  1. Firaxis’ Modbuddy, with XCOM2 extensions
  2. XCOM2’s 64 bit version of UnrealEd.
    a. This executable is also capable of running UE3 commandlets such as the script compiler
    or cooker.
  3. XCOM2’s shipping content
    a. Uncooked maps and packages
    b. Unreal script source code
This quick start guide will focus on getting Modbuddy up and running, and demonstrate how to use it to open and publish an example mod.
Getting Started
The first step creating an XCOM2 mod is to launch Modbuddy.

Install the XCOM2 SDK on Steam
The XCOM2 SDK is available on steam under Library > Tools
  1. Navigate to Tools:



  2. Find the XCOM2 SDK under the name “XCOM 2 Development Tools” and select Install from the right click menu option.

Install the 2013 Visual Studio Isolated Shell Redistributable
Modbuddy for XCOM2, similar to previous versions of Modbuddy released for Civilization, uses the visual studio isolated shell to provide an IDE for modding. You can find the redistributable installed in the game’s installation directory under the “Binaries\Win32” folder.

Example: “\SteamLibrary\steamapps\common\XCOM 2 SDK\Binaries\Redist”

Launch Modbuddy for XCOM2
Choose “Play Game” on the XCOM 2 SDK in steam and this will launch Modbuddy for XCOM2. The IDE may take a while to load for the first time.



First Time Setup
After launching Modbuddy for the first time, users will want to set general settings on the IDE related to where XCOM2 is installed. Choose Tools > Options, and then scroll down to the bottom of the options menu as shown below. Verify that the paths are set correctly.
  • XCOM 2 Install Path – This path should point to the GAME installation, ending in XComGame.



  • XCOM 2 User Path – This path should point to the SDK installation, ending in XComGame.


By default, build information in the Visual Studio Isolated Shell is set to “minimal’. To get information from the build process / script compiler, you will want to change this setting. Choose Tools > Options > Projects and Solutions > Build and Run. Change the two verbosity dropdowns at the bottom of the options panel to “Normal”, then hit OK.



Start Page
When the IDE first launches the user will be presented with a start page that presents options for creating new mod projects, opening an existing mod project, and accessing the list of recently opened mod projects.

In this quick start guide we will create a new mod project, so select “New Mod












New Project
After selecting “New Mod”, the user will be presented with the dialog shown to the right. By default, the dialog shows installed XCOM2 project templates that can be used to create a new project.

In this guide, we will choose the ExampleWeapon template project. This project is an example project and so contains all the script code, configuration files, localization files, and content packages necessary to add a new weapon to the game.



Choose ExampleWeapon and select OK.
The Mod Pipeline
Now that we have created a mod project, we can review the components that go into a mod as well as build, test, and publish our mod.

Mod Components
Mods for XCOM2 are composed of many different types of data that combine to form changes to the XCOM 2 base game.

  • Script Code: Script code is the most powerful type of mod content. In our example weapon mod, the script code defines a data template which is the gameplay data describing how the new weapon works. How much damage does it do? Which upgrades can it use? What tech level does it require? Does it need to be built or is it available from the start? How much will it cost? Data templates just scratch the surface for what can be added using script. Script code, if it overrides script that shipped with the game can be used to make a radically different XCOM game.

  • Unreal Content Packages: Unreal content packages can be UPK files or MAP files. These files contain the content of the game: meshes, textures, animations, sounds, physics models, archetypes, etc. In our example weapon mod, there is a single package called WP_ModExampleWeapon_CV that defines how our new weapon will look, sound, shoot, what projectiles it will use, how it will fall when dropped, etc. This package is referenced by the script data template above. Content packages are created through UnrealEd, which will be covered later.

  • Config Files: Config files, or INIs, are used to provide settings and default values to the game. They are convenient to use because changing them does not require
    the game to be recompiled, and because the UE3 config file processing system allows for individual config settings to be overridden while leaving the rest unchanged. This handy behavior can be seen in our example weapon mod where XComEditor and XComEngine, both config files with a large amount of settings, simply adds our mod package to the lists that let the engine know our modded script package exists. In this way, many mods making edits to the same config files can co-exist … for the most part.

  • Localization Files: Loc files are really just config files in disguise but they have a specialized purpose: to provide all player facing text in the game. In our example weapon mod, English language (INT) strings are provided to fill out the friendly name and other fields the weapon needs to display correctly in the game.

  • Readme.txt & ModPreview.jpg: The ModPreview image will be used to depict the mod on steam workshop, while the readme.txt can provide instructions or other information related to the mod.

Building
Once the mod content has been created and is ready for testing, it is time to build the mod into a form that the game can load. To do this, use the Build > Build Solution option on the toolbar

Output Window: After hitting Build Solution, the IDE will display build progress in the output window of the app. During the build process, Modbuddy will create the files necessary to test and upload the mod. Part of this process is the compilation of script code. Be sure to check the script compilation results for success or error codes.



Testing
While developing a mod, it is recommended to test the mod out locally before making it available on steam workshop. The XCOM2 SDK provides a mechanism to do this through the DEBUG menu.


Click the Start Debugging menu option under the DEBUG menu to begin the testing process. This will build the mod, and then start the XCOM 2 launcher.

Select the “ExampleWeapon” mod and hit Play. The launcher will enumerate all mods that are subscribed or installed by the user. Local, or stand-alone mods will have their relative path in the description field. Hitting play will launch XCOM2 with the ExampleWeapon mod enabled.



Verify that the mod is operating correctly in the game. The ExampleWeapon mod adds a new weapon that is available from the beginning of the game, so to test it we will launch a single player campaign and equip a soldier with the new weapon. Here is the script code from the template defining the properties we want to see on the weapon:



And the mod as running in XCOM2:



Now that we have confirmed the mod operates as intended, we are ready to publish it.

Publishing
Mods can be published through Steam Workshop or distributed as stand-alone bundles.

Publishing to Steam Workshop
To publish to the Steam Workshop, first visit the Steam Workshop page and verify that your account has agreed to the license agreement there. This can be found under Community > Workshop > Your Files > View Legal Agreement.






Next, use the Tools > Publish menu option available in the XCOM2 IDE. This will launch the steam workshop UGC upload process.



Information regarding the workshop item creation and uploading process will be reported to the output window of the IDE.



Visit your user’s Steam Workshop item page to view the published mod. Note that the first time a mod is uploaded its visibility will default to Hidden. In order to make the mod available publicly the visibility of the mod item will need to be set.



Publishing Stand-alone
Publishing stand-alone mods involves bundling up the mod content for distribution through a non-steam source.

To publish a stand-alone mod, locate the XCOM2 SDK base directory, and the XComGame\Mods folder within it. It will typically be contained within a steam library or steam installation folder – an example is shown to the right.

Zip up / package the ExampleWeapon folder for redistribution.

All that is necessary to install the mod on a user’s machine is to unpack the ExampleWeapon folder into the same XComGame\Mods location in their installation of XCOM2.


Note
This will just get you started. The more in-depth docs for each type of mod (Audio, Animation, etc) are downloaded with the XCOM 2 Mod Tools and should appear in the Steam folder for them on your machine. Your Windows file location should look something like this:

C:\Program Files (x86)\Steam\SteamApps\common\XCOM 2 SDK\Documentation
Video Tutorials (if necessary)
All the following videos are made and published by Kwahn, please check his channel!

XCOM 2 Modding Tutorial Video 0 - Good Modding tips


XCOM 2 Modding Tutorial 1: Setup and Your First Mod


XCOM 2 Modding Tutorial 2: Finding Things and Reading Code (Feat. Shotguns)


XCOM 2 Modding Tutorial 3: Making A Shotgun!


XCOM 2 Modding Tutorial 4: Stealing Code and Weapon Stat Boosts

Special Thanks


I hope that I've helped you, leave a comment below if you have any suggestions, thanks!

Collaborators
  • All the content of this guide can be found on your XCOM 2 SDK game folder;
  • Thanks to Kwahn for the tutorial videos.
19 Comments
Aoykav 10 Oct, 2021 @ 4:35am 
does it work with the newest version of visual studio (2019) or does it have to be 2013?
Karasukan 29 Jun, 2021 @ 6:14am 
hi this still works in 2021? with the new launcher and such :AnnoyedSally:
Detective Muffins 14 Mar, 2021 @ 8:44pm 
One thing i need to know is that is it possible too add Lily Shen's head model in WoTC
Dreg_Master 7 Nov, 2020 @ 1:10pm 
Can anyone tell me if its possible to just change the Australian Blue flag to the proper Australian Federal Red Ensign? I can code and all, but its just an Image i would think?
fightingsloth on Kick&YT 24 Nov, 2018 @ 2:43pm 
NVM I opened UE3Redist instead of vx_isoshell in the binaries>Redist folder.
fightingsloth on Kick&YT 24 Nov, 2018 @ 2:37pm 
I'm getting a "cannot find one or more components. Please re-install" error when I try to launch. PLease tell me there is a quick fix and I don't have to re-download 42gb on my shitty Australian internet! I have validated the files and it's not coming up with an error.
anybis 18 Aug, 2018 @ 2:05pm 
@Corvo Good afternoon. Please tell me. Will you be able to make a mod to reduce the construction time "Spark" to 1 day, or increase the number of engineers in the "Proving Ground", or increase the bonus from engineers to the speed of construction in the "Proving Ground" 100%. For simple Xcom 2.


I'm ready to pay for the mod. Reasonable price of course.

There are analogues of mods that I want, but they are all for "war of the chosen" and do not work in simple Xcom2.
SapphicFail 7 Jun, 2018 @ 10:16am 
And as far as I've googled (for those who have made it public) I'm pretty much the only one (or one of) to not be able to see the tool
Formaldeído  [author] 7 Jun, 2018 @ 10:14am 
I don't think so.
SapphicFail 7 Jun, 2018 @ 10:12am 
I don't see it in the Tools section.
Is there a way to download it externally?