XCOM Enemy Unknown\ Enemy Within

Intro:

This page should cover what is needed to get the most out of XCom, including information for modding the game.

 

Installation (From Disc):

Sadly, because of Steam XCom automatically Updates. I can only make teh following Recommendations to avoid steam making changes to your game.

  • Login to Steam > Set offline Mode > Install XCom Enemy Unknown

Installation (From Steam):

  • Login to Steam > Turn off “Automatically Update this game” > Install XCom Enemy Unknown
  • Once installed Play game in Offline Mode

Modding the game:

 

  • Download “ResourceHacker”
  • Make a Backup of “XCOM.exe”
  • Open “XCOM.exe” (With Resource hacker?)
    – RCData
    – 1020
  • Make config changes > e.g.change reward schemes etc

Change Default Map List :

[XComGame.XComMapManager]
;change map list

 

Unlock Secret Characters:

  • Enter the names below to Unlock
    Sid Meier – Support
    Ken Levine – Sniper
    Joe Kelly – Heavy
    Otto Zander – Assault

Unlock 2nd Wave Extras:

  • Run DecomPress

– extract “decompress.exe” to “/XCom-Enemy-Unknown/XEW/XComGame/CookedPCConsole/”.

– Rename XComGame.upk.uncompressed_size to something else.

– Fire command line and type decompress.exe -lzo XComGame.upk

– Decompressed files are placed in Unpacked folder

– move them to CookedPCCConsole and delete Unpacked folder.

  • Run Hexeditor ~(HxD or other Hex editor)

– open XComGame.upk,

– CTRL+R search datatype hex values and search for and replace code below.

Save the file, run the game.

– in hex editor, offset base to decimal

– view > offset base > decimal

 

Hex Editing:

Enemy Within: (original hex)
07 B4 00 81 19 19 2E 98 69 00 00 19 12 20 36 FE FF FF 0A 00 9D F9 FF FF 00 1C DD FB FF FF 16 0A 00 9C F9 FF FF 00 1B A0 3A 00 00 00 00 00 00 16 09 00 F4 68 00 00 00 01 F4 68 00 00 15 00 01 6A 00 00 00 1B 9D 44 00 00 00 00 00 00 38 3D 00 CB 1C 00 00 16 16 06 7F 03

Enemy Within: (new hex)
0B 0B 0B 81 19 19 2E 98 69 00 00 19 12 20 36 FE FF FF 0A 00 9D F9 FF FF 00 1C DD FB FF FF 16 0A 00 9C F9 FF FF 00 1B A0 3A 00 00 00 00 00 00 16 09 00 F4 68 00 00 00 01 F4 68 00 00 15 00 01 6A 00 00 00 1B 9D 44 00 00 00 00 00 00 38 3D 00 CB 1C 00 00 16 16 0B 0B 0B

Links:

==============================
Instructions: (UDK Version)
==============================

[1] Download “September 2011 UDK” [XCOM compatible UDK]

[o] Optional Compile scripts in Debug Mode (create shortcut)
<Path-To-UDK>\Binaries\Win32\UDK.exe make -DEBUG

[2] create AN “XComGame” & “XComStrategyGame” folder.

[3]
(a) Create “Classes” folders (projects to hold dummy XCOM scripts.)
<Path-To-UDK>\Development\Src\XComGame\Classes
<Path-To-UDK>\Development\Src\XComStrategyGame\Classes
<Path-To-UDK>\Development\Src\XComMod\Classes\TestMod.uc

[3]
(b) Create script file: “TestMod.uc”
=====================

=====================
class TestMod extends XComMod;

simulated function StartMatch()
{
    local XGStrategy GameCore;

    super.StartMatch();

    GameCore = XComHeadquartersGame(class'Engine'.static.GetCurrentWorldInfo().Game).GetGameCore();

    GameCore.HQ().AddResource(0, 100000);

    return;
}
=====================

=====================

[4] Clone XCOM-Mutator project
Copy XComMutator folder from inside Src folder of the cloned project to <Path-To-UDK>\Development\Src:
<Path-To-UDK>\Development\Src\XComMutator\Classes

[5] Navigate to <Path-To-UDK>\UDKGame\Config, open DefaultEngine.ini with n++, find [UnrealEd.EditorEngine] section and append newly created XCOM projects there:
[UnrealEd.EditorEngine]
+EditPackages=UTGame
+EditPackages=UTGameContent
+EditPackages=XComGame
+EditPackages=XComStrategyGame
+EditPackages=XComMutator
+EditPackages=XComMod

[6] Create a source folder(s):
<Path-To-UDK>\Development\Src\MyXComMutator\Classes

[7] Create a new class:
<Path-To-UDK>\Development\Src\MyXComMutator\Classes\MyXComMutator.uc

[8] create new uc “MyXComMutator.uc”:
class MyXComMutator extends XComMutator;

[9] Add your package to DefaultEngine.ini as described above:
[UnrealEd.EditorEngine]
+EditPackages=UTGame
+EditPackages=UTGameContent
+EditPackages=XComGame
+EditPackages=XComStrategyGame
+EditPackages=XComMutator
+EditPackages=MyXComMutator

[10] Run either shortcut you created or Unreal Frontend to compile the package.
find MyXComMutator.u package under <Path-To-UDK>\UDKGame\Script folder.

===================================
[]. Compiled and cooked into Path-To-UDK\UDKGame\Script\XComMod.u
[] Renamed XComMod.u to XComMod.upk
[] copied it to Path-To-XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole
[]. Edited DefaultEngine.ini, section Engine.ScriptPackages:
+NonNativePackages=XComMod

9. Edited DefaultGame.ini, added a new section:

[XComStrategyGame.XComHeadquartersGame]
+ModNames=XComMod.TestMod
Since XComGame and XComStrategyGame packages content is cooked into XComMod.u as a set of import objects, those object doesn’t have to be fully implemented. We just need a correct package, class, variable and function names.

XComGame\Classes\XComGameInfo.uc:


class XComGameInfo extends FrameworkGame
    native
    abstract;

A class definition, nothing more, as I don’t need anything for my simple script.
XComGame\Classes\XComMod.uc:

 

class XComMod extends Object;

simulated function StartMatch()
{
    return;
}

A copy of decompiled class. It’s important, as TestMod class extends XComMod class.
XComStrategyGame\Classes\XGStrategyActorNativeBase.uc:

 

class XGStrategyActorNativeBase extends Actor
    native
    notplaceable;

enum EResourceType
{
    eResource_Money,
    eResource_Elerium,
    eResource_Alloys,
    eResource_Engineers,
    eResource_Scientists,
    eResource_Power,
    eResource_MonthlyNet,
    eResource_Meld,
    eResource_Max
};

function XGHeadQuarters HQ()
{
    return XComHeadquartersGame(class'Engine'.static.GetCurrentWorldInfo().Game).GetGameCore().GetHQ();
}

Same as before: only functions, which are actually used. Functions can be empty. Or totally different from original. But they must have the same header and return value.

XComStrategyGame\Classes\XGStrategyActor.uc:

class XGStrategyActor extends XGStrategyActorNativeBase
    abstract
    notplaceable;

function AddResource(XGStrategyActorNativeBase.EResourceType eResource, int iAmount, optional bool bRefund)
{
    return;
}

Empty AddResource function. Again, it doesn’t matter as actual game will use actual package with AddResource correctly defined.

XComStrategyGame\Classes\XGStrategy.uc:

 

class XGStrategy extends XGStrategyActor
    notplaceable;

var XGHeadQuarters m_kHQ;

function XGHeadQuarters GetHQ()
{
    return m_kHQ;
}

XComStrategyGame\Classes\XGHeadQuarters.uc:

class XGHeadQuarters extends XGStrategyActor
notplaceable;

XComStrategyGame\Classes\XComHeadquartersGame.uc:

class XComHeadquartersGame extends XComGameInfo;

var protected XGStrategy m_kGameCore;

function XGStrategy GetGameCore()
{
return m_kGameCore;
}

Links:

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s