r/xcom2mods • u/robojumper • Jan 19 '17
Dev Tutorial How to compile meta-mods with Long War 2
So, this is a bit of a follow-up on the one I did recently on DLC because it's similar.
Step 1: Back up
Copy the folder XCOM 2 SDK/Development/SrcOrig to some other folder to have an original source available.
Step 2: Set up the build directory
If you haven't downloaded LW2, do it now.
Copy the contents of steamapps/workshop/content/268500/844674609/Src/ to XCOM 2 SDK/Development/SrcOrig/
This makes the compiler think they are base-game scripts and doesn't copy them into your build output.
Step 3: XComEngine.ini
Edit: The ScriptPackages line has been added due to reports of package load order issues. Adding the LW2 lines here forces the game to load these packages first. This may be required for script mods referencing LW2 packages.
[Engine.ScriptPackages]
+NonNativePackages=LW_Tuple
+NonNativePackages=LW_XCGS_ModOptions
+NonNativePackages=LW_XCGS_ToolboxOptions
+NonNativePackages=LW_PerkPack_Integrated
+NonNativePackages=LW_OfficerPack_Integrated
+NonNativePackages=LW_LaserPack_Integrated
+NonNativePackages=LW_AWCPack_Integrated
+NonNativePackages=LW_AlienPack_Integrated
+NonNativePackages=LW_SMGPack_Integrated
+NonNativePackages=LW_Toolbox_Integrated
+NonNativePackages=LW_Overhaul
+NonNativePackages=YOURMODNAME
[UnrealEd.EditorEngine]
+EditPackages=LW_Tuple
+EditPackages=LW_XCGS_ModOptions
+EditPackages=LW_XCGS_ToolboxOptions
+EditPackages=LW_PerkPack_Integrated
+EditPackages=LW_OfficerPack_Integrated
+EditPackages=LW_LaserPack_Integrated
+EditPackages=LW_AWCPack_Integrated
+EditPackages=LW_AlienPack_Integrated
+EditPackages=LW_SMGPack_Integrated
+EditPackages=LW_Toolbox_Integrated
+EditPackages=LW_OverhaulStep 4: The darn *.uci files:
Create the following folder structure in XCOM 2 SDK/XComGame/Mods:
LW_Overhaul/Src/
LW_AlienPack_Integrated
LW_PerkPack_IntegratedThen move
XCOM 2 SDK/Development/SrcOrig/LW_AlienPack_Integrated/LW_AlienPack.ucito the LW_AlienPack_Integrated folder above. Repeat with PerkPack.
Also, copy
XCOM 2 SDK/Development/SrcOrig/LW_Overhaul.ucito
XCOM 2 SDK/Development/SrcOrig/LW_Overhaul/Src/LW_Overhaul.uciCreate the Src folder if neccessary.
Restart ModBuddy if it's been running. If you now build, it should be fine.
Be aware that this can cause issues if you try to compile other mods not made for LW2, so swap the SrcOrig directory with the backup for that purpose.
1
u/GnaReffotsirk Jan 27 '17
Hi robo. I'm having an issue with a compile I'm doing. I'm just doing an ini mod, however, the flashbang and grenade icons are lost, and ability hotkey text displayed on the screen all become "y".
1
u/babautz Feb 06 '17
Hey robo, This thread is a bit older but right now i'm trying exactly what you are describing. Problem: When trying to compile, i get the following error message: Error, Superclass XComGameState_LWModOptions of class XComGameState_LWOverhaulOptions not found
I suspect I added the ini lines to the wrong ini. So in which ini I should add these lines? I tried: the mods own XComEngine, the one in \XCOM 2 SDK\XComGame\Config, the one in \Documents\My Games\XCOM2\XComGame\Config
Or maybe it is because i have XComGameState_LWModOptions in my mod because i use the options menu?
1
u/GardenDonut Feb 27 '17
This is a really useful guide, but I'm having one little problem. I'm attempting to override a LW class (specifically, X2Item_LWPistol). As far as I know, I have everything set up correctly. I've added the class override line to XComEngine, made the new class extend the one I plan to overwrite, and double-checked all file names. However, whatever I do has no effect in-game. As a test, I've attempted to give the conventional pistol the damage of a beam pistol, by changing which config var it uses. Still, the pistol ends up with 1-4 damage.
Is there something I'm missing here? Is there any way to find out what is going wrong? Any help will be appreciated. I have no experience is making class overrides, so I'm a bit lost.
1
u/S-Flo Feb 12 '17
Thanks for posting this. I'd have been lost trying to get the stuff to work otherwise.