XCOM: Enemy Unknown
0 of 0

File information

Last updated

Original upload

Created by

Dubiousintent

Uploaded by

dubiousintent

Virus scan

Safe to use

About this mod

This is a Windows CMD file script that utilizes the open source package \"bspatch\" to apply a patch file (created with the companion program \"bsdiff\") to the XComGame.EXE file. It turns the orginal game file into a backup (XComGame.exe.bak), and the patched version becomes the executable. Requires separate \"bsdiff\" package.

Requirements
Permissions and credits
EXEPatcher Script
This script is released to the public domain. You may do anything you wish with it.

This is a Windows CMD file script that utilizes the open source package "bspatch" to apply a patch file (created with the companion program "bsdiff") to the XComGame.EXE file. It turns the orginal game file into a backup (XComGame.exe.bak), and the patched version becomes the executable. It can be installed anywhere, but the patch file MUST be placed in the same location as the game executable.

The included patch file(s) will apply the "Disabling Hash checks" and "Enabling INI loading" mods to a Steam XCOM game as described at [http://wiki.tesnexus.com/index.php/Basic_Guide_to_installing_mods#Recent_Discoveries here]. See the History section for which of these patch files applies to which game patch version of the executable.

Please note that you can manually do everything this script does yourself, if all the components are present in the same location. The primary advantage of the script is that it can be used with components in various locations, and will alert you if you are missing the required Patch_File parameter, and saves including all the paths on the commandline.

Why a Script?
A script file was chosen to implement this patch mechanism because it is an easily modified tool for anyone's Windows environment and any game, and permits the components (except the patch file itself) to be installed anywhere.

Requirements:
"bsdiff" package, available [http://sites.inka.de/tesla/f_others.html#bsdiff]. This is free/open source. It is not included here.

Script Adjustments:
* Only variables defined at the beginning of the script should require altering.

* The "bsdiff" package may be installed anywhere, but if the "bspatch.exe" file (which is included in that package) is not found in either the "Steam\steamapps\common\XCom-Enemy-Unknown" or the ".\Binaries\Win32" subfolder, the script should be modified to point to it's location. There is a variable defined near the top of the script (diffpath) just for this purpose. As the "bsdiff package" does not make any registry entries when it is installed, it is not possible to determine where you have installed it otherwise.

* The script utilizes WMIC (if available; it's part of the WMI toolset included in Windows versions from XP Professional onwards) to retrieve the XCOM install folder. If WMIC is not available, it relies upon the value of a variable defined near the top of the script (exepath) just for this purpose. This might also need modifying by you. All the defined variables are checked for validity first.

Syntax:
The script is called with a single command line parameter which consists of the name of the Patch_File created by "bsdiff", and that filename can take any form. (For example: "EXEPatcher.cmd XComGame_Patch_20130711-233432".) This enables the script to be used with multiple patch files. You can get away with only providing the "date-time" portion (i.e. "20130711-233432", with or without the leading underscore) as long as the prefix of the file is named "XComGame_Patch". Other filename patterns must be given in full or the scripting altered to match. It is recommended you create a "shortcut" to the script with the name of the Patch_File as a parameter as the easiest method to apply the patch. More shortcuts can be used with different Patch_File parameters as required. With simple adjustments to the variables it can be used in a similar manner to patch any executable.

Confirmation Test:
Edit the 'DefaultGameCore.INI' (DGC.INI) file in a 'text editor' (like Notepad) as follows to confirm the patch is functioning:

* Search for 'eItem_Shotgun', and replace the original line 'Properties[1]=' entry assignment of 'eWPAssault' with 'eWP_Anyclass' as shown below. You can just copy and paste this line with any text editor. (Save your '.BAK' file to restore the original DGC.INI.)

[The line below must appear in the DGC.INI file as a single line, without any word-wrapping or line breaks.]

Weapons=(iType=eItem_Shotgun,ABILITIES[0]=eAbility_ShotStandard,ABILITIES[1]=eAbility_Overwatch,ABILITIES[2]=eAbility_NONE,ABILITIES[3]=eAbility_NONE,ABILITIES[4]=eAbility_NONE,ABILITIES[5]=eAbility_NONE,Properties[0]=eWP_AnyClass,Properties[1]=eWP_AnyClass,Properties[2]=eWP_None,Properties[3]=eWP_None,Properties[4]=eWP_None,Properties[5]=eWP_None,iDamage=6,iEnvironmentDamage=30,iRange=22,iReactionRange=8,iReactionAngle=360,iRadius=0,iCritical=40,iOffenseBonus=10,iSuppression=10,iSize=eItemSize_Large,iHPBonus=0,iWillBonus=5)

* Load any previous save where you are in the XCOM base (the Strategy game phase) or play a new game to that point, go into the Barracks, View Soldiers, and change the Loadout of a Sniper or Support to equip a Shotgun. (The Heavy has other class restrictions that prevent it from using a Shotgun with just this simple fix).
* Anyone other than an Assault class equipping a Shotgun proves you are loading the DGC from the '\config' folder. The 'vanilla' DGC.INI that's in the embedded 'Resource cache' of the game executable only permits an Assault to equip a Shotgun. With this change, Snipers and Supports can as well.
* Subsequent changes to the DGC.INI that do not appear to work are most likely due to needing additional settings altered, or incompatibilities of specific classes, abilities or properties with specific items, or something similar. Check out the Wiki article 'DefaultGameCore.ini settings - XCOM:EU 2012' [http://wiki.tesnexus.com/index.php/DefaultGameCore.ini_settings_-_XCOM:EU_2012] for known DGC alteration issues (and please update any new discoveries for others benefit.)
* An altered 'XComGame' or 'XComStrategyGame' UPK file that loads without applying a correction to it for the "Hash Check" (such as XSHAPE) indicates the other component of the patch has taken effect. Note that "ToolBoks" [http://xcom.nexusmods.com/mods/79/?] also has the same capability to disable the "Hash Check".

Installation:
* Obtain and install bsdiff package to any location.
* Unpack the archive to any location.
* Move/copy the patch file [XComGame_Patch_20130711-233432] to the same folder as the game executable (i.e. "Steam\steamapps\common\XCom-Enemy-Unknown\Binaries\Win32").
* Edit the script 'EXEPatcher.cmd' to point to the 'bsdiff' package install folder, and any others as required and described above.

Uninstallation:
Move/delete the patch file [XComGame_Patch_20130711-233432] from the executable folder.
Remove the "EXEPatcher.cmd" file from the installation folder.

Known incompatibilities:
None known.

Future development:
Improved selection handling of multiple patch files.

History:
v1.0 XComGame_Patch_20130711-233432 for XCOM game patched to Patch 4 (dated: 2013-Feb-20, file properties version: 1.0.0.28586, changelist: 356266). Disables Hash Checks and enables loading DGC & DLO INIs.

v1.1 Updated documentation to include a test to confirm the patch is working.

Update XComGame_Patch_20130815-003451 - Disables Hash Checks and enables loading DGC, DMP, & DLO INIs. All 3 are required by some mods like 'Long War' which work around the 'Total INI Size Limit' problem by stealing some space from other INI files to use in another.