Jump to content

XCOMModHelper


UberJumper

Recommended Posts

I made a tool to help with modding. Since the only way to get the game to read DefaultGameCore.ini, is to hex patch currently and that is kind of painful for mod installs. So I thought it would be a good idea to make a command line tool that automatically does this. Then since i got a lot of people bugging me to allow patching UPK files, i did that.

I am making this thread because i have gotten way more PM's that i thought and its painful. This is only really going to appeal to a very small number of people.

Note: If you get an error 0x0000142. I CANNOT FIX THIS. Go ask the people who made your "alternative version" why they have an exe checksum.

Features

  • Allows modders to define hex strings that the tool will find and replace in a specified file.
  • It will also patch UPK files (it will also decompress them as needed, and deal with uncompressed_size files)
  • It will backup any files it changes
  • Automatically determines the location of XCOM in steam folder (you can manually specify it by -x argument)

Credits

  • Johnnylump (for the idea/telling me what to patch)
  • Grenademagnet (for helping test/pointing out my dumb mistakes)

Sample Configurations (You can start screaming):

https://github.com/fperks/xcom-mod-helper/blob/master/XCOMModHelper/Configs/EWDataGameCorePatchConfig.xml

  • Patches XComEw.exe to read the DefaultGameCore.ini file in XEW/Config

https://github.com/fperks/xcom-mod-helper/blob/master/XCOMModHelper/Configs/EWConfig.xml

  • Patches XComEw.exe to read the DefaultGameCore.ini file in XEW/Config
  • Patches XCOMGame.upk so there is a 1/8 chance of getting female recruits

https://github.com/fperks/xcom-mod-helper/blob/master/XCOMModHelper/Configs/EWUnlockSecondWaveConfig.xml

  • Unlocks all the second wave options for enemy within (Amineri)

Source Code: https://github.com/fperks/xcom-mod-helper
Documentation: https://github.com/fperks/xcom-mod-helper
Latest Version: https://github.com/fperks/xcom-mod-helper/releases

Edited by UberJumper
Link to comment
Share on other sites

  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

Hi, do you mind giving me a step by step guide to using the ModHelper? I am not familiar with the cmd. I tried following the directions on the link you provided but I kept running into an error: 'XCOMModHelper' is not recognized as an internal or external command, operable program or batch file.

 

What I did was unzipped the file to Desktop, then changed the dr to

 

C:\Users\<username>\Desktop

 

and ran the command line you provided. I know I probably did something stupid, but I would appreciate it if you or someone would point me in the right direction.

Link to comment
Share on other sites

Hi, do you mind giving me a step by step guide to using the ModHelper? I am not familiar with the cmd. I tried following the directions on the link you provided but I kept running into an error: 'XCOMModHelper' is not recognized as an internal or external command, operable program or batch file.

 

What I did was unzipped the file to Desktop, then changed the dr to

 

C:\Users\<username>\Desktop

 

and ran the command line you provided. I know I probably did something stupid, but I would appreciate it if you or someone would point me in the right direction.

 

"'XCOMModHelper.exe' is not recognized as an internal or external command"

 

Means its not on your desktop, if you enter dir into the command prompt do you see XCOMModHelper.exe?

Link to comment
Share on other sites

 

Hi, do you mind giving me a step by step guide to using the ModHelper? I am not familiar with the cmd. I tried following the directions on the link you provided but I kept running into an error: 'XCOMModHelper' is not recognized as an internal or external command, operable program or batch file.

 

What I did was unzipped the file to Desktop, then changed the dr to

 

C:\Users\<username>\Desktop

 

and ran the command line you provided. I know I probably did something stupid, but I would appreciate it if you or someone would point me in the right direction.

 

"'XCOMModHelper.exe' is not recognized as an internal or external command"

 

Means its not on your desktop, if you enter dir into the command prompt do you see XCOMModHelper.exe?

 

Silly me, I had to go down another directory. It works now, thanks! :)

Link to comment
Share on other sites

Hi UberJumper

 

First off, thank you for creating this tool. Editing the DefaultGameCore.ini file directly will be very nice. In EU, I used ModPatcher.exe to help mod my game.

 

In running your tool, I ran into an error message and I wanted to see if you could help me out. Below is my output.

 

[iNFO]> ==========XCOMModHelper========
[iNFO]> Attempting to Locate XCOM Root Directory
[iNFO]> Found XCOM Root Directory of [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown ]
[iNFO]> Backup Target Directory is [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Backup ]
[iNFO]> Backup Directory does not exist, creating
[iNFO]> Decompressed UPK Folder [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked ]
[iNFO]> Decompressed UPK Output Directory does not exist, creating
[iNFO]> Patching [2] Targets
[iNFO]> Patching Target [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ]
[iNFO]> Applying Patch [ Read DefaultGameCore.ini from Config Folder ]
[iNFO]> Applying Patch at Index [ 21464864 ]
[iNFO]> Patch Successfully Applied [ Read DefaultGameCore.ini from Config Folder]
[iNFO]> File [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ] Backed up to [ c:\program files (x86)\steam\Stea
mApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ]
[iNFO]> Saving Changes to [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ]
[iNFO]> Patching Target [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]
[iNFO]> Decompressed Upk File [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked\XComGame.upk ]
[ERROR]> An Error occured during processing:Could not find a part of the path
'c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked\XComGame.upk'.
[ERROR]>
The Patching Process was Aborted

 

So it looks like the XComEW.exe file was updated (I verified this in the ...\XEW\Binaries\Win32 folder) but the changes to XComGame.upk file did not take.

 

Have you seen this before?

 

Thank you for your time.

 

drake8888

Link to comment
Share on other sites

Hi UberJumper

 

First off, thank you for creating this tool. Editing the DefaultGameCore.ini file directly will be very nice. In EU, I used ModPatcher.exe to help mod my game.

 

In running your tool, I ran into an error message and I wanted to see if you could help me out. Below is my output.

 

[iNFO]> ==========XCOMModHelper========

[iNFO]> Attempting to Locate XCOM Root Directory

[iNFO]> Found XCOM Root Directory of [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown ]

[iNFO]> Backup Target Directory is [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Backup ]

[iNFO]> Backup Directory does not exist, creating

[iNFO]> Decompressed UPK Folder [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked ]

[iNFO]> Decompressed UPK Output Directory does not exist, creating

[iNFO]> Patching [2] Targets

[iNFO]> Patching Target [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ]

[iNFO]> Applying Patch [ Read DefaultGameCore.ini from Config Folder ]

[iNFO]> Applying Patch at Index [ 21464864 ]

[iNFO]> Patch Successfully Applied [ Read DefaultGameCore.ini from Config Folder]

[iNFO]> File [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ] Backed up to [ c:\program files (x86)\steam\Stea

mApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ]

[iNFO]> Saving Changes to [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\Binaries\Win32\XComEW.exe ]

[iNFO]> Patching Target [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]

[iNFO]> Decompressed Upk File [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked\XComGame.upk ]

[ERROR]> An Error occured during processing:Could not find a part of the path

'c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked\XComGame.upk'.

[ERROR]>

The Patching Process was Aborted

 

So it looks like the XComEW.exe file was updated (I verified this in the ...\XEW\Binaries\Win32 folder) but the changes to XComGame.upk file did not take.

 

Have you seen this before?

 

Thank you for your time.

 

drake8888

 

Hi can you please run the tool with the option:

 

-v

 

so

 

XCOMModHelper -c EWConfig.xml -v

Link to comment
Share on other sites

Thank you very much UberJumper :smile:

 

There may be an issue with Texmod. The original executable is renamed and wouldn't be patched. Thought I'll let you know, so you can let ppl know, they have to put the original executable back for patching. A feature to identify and patch the right executable is definitely up to you.

Link to comment
Share on other sites

Hey UberJumper

 

Here is the output with the above command used (I only included the important part since the .exe patch had already been applied).

 

 

[iNFO]> Patching Target [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]
[DEBUG]> Loading UPK File Data [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]
[DEBUG]> Decompress Arguments [ -out=c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked
c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]
[DEBUG]> Decompress Log:
ERROR: Unable to find/load package files

[DEBUG]> Decompress exited with code [ 1 ]
[iNFO]> Decompressed Upk File [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked\XComGame.upk ]
[DEBUG]> Checking for uncompressed_size [ c:\program files
(x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk.uncompressed_size ]
[DEBUG]> uncompressed_size [ c:\program files
(x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk.uncompressed_size ] file exists
[DEBUG]> File [ c:\program files
(x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ] Loaded Into Patcher Successfully
[iNFO]> Applying Patch [ Changes Gender Chance from 1/2 chance of female, to 1/8 chance of female ]
[DEBUG]> Patch State ==> SequenceNotFound
[ERROR]> An Error occured during processing:Could not find the specified hex value for patch
[ Changes Gender Chance from 1/2 chance of female, to 1/8 chance of female ]
[ERROR]>
The Patching Process was Aborted

 

Hopefully this helps. Looks like a hex value for the patch is missing/erroring out.

Link to comment
Share on other sites

Hey UberJumper

 

Here is the output with the above command used (I only included the important part since the .exe patch had already been applied).

 

 

[iNFO]> Patching Target [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]

[DEBUG]> Loading UPK File Data [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]

[DEBUG]> Decompress Arguments [ -out=c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked

c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ]

[DEBUG]> Decompress Log:

ERROR: Unable to find/load package files

[DEBUG]> Decompress exited with code [ 1 ]

[iNFO]> Decompressed Upk File [ c:\program files (x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\UpkUnpacked\XComGame.upk ]

[DEBUG]> Checking for uncompressed_size [ c:\program files

(x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk.uncompressed_size ]

[DEBUG]> uncompressed_size [ c:\program files

(x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk.uncompressed_size ] file exists

[DEBUG]> File [ c:\program files

(x86)\steam\SteamApps\common\XCom-Enemy-Unknown\XEW\XComGame\CookedPCConsole\XComGame.upk ] Loaded Into Patcher Successfully

[iNFO]> Applying Patch [ Changes Gender Chance from 1/2 chance of female, to 1/8 chance of female ]

[DEBUG]> Patch State ==> SequenceNotFound

[ERROR]> An Error occured during processing:Could not find the specified hex value for patch

[ Changes Gender Chance from 1/2 chance of female, to 1/8 chance of female ]

[ERROR]>

The Patching Process was Aborted

 

Hopefully this helps. Looks like a hex value for the patch is missing/erroring out.

 

Hi i have made a new version for you to try out:

 

https://github.com/fperks/xcom-mod-helper/releases/tag/v0.31

 

Please let me know if the same issue occurs.

Link to comment
Share on other sites

Thank you very much UberJumper :smile:

 

There may be an issue with Texmod. The original executable is renamed and wouldn't be patched. Thought I'll let you know, so you can let ppl know, they have to put the original executable back for patching. A feature to identify and patch the right executable is definitely up to you.

 

The only problem with Texmod would be that some slight alterations to a configuration file, lets say the XComEW.exe has been renamed XComEwOriginal.exe, here is a configuration file:

 

<?xml version="1.0" encoding="utf-8" ?>
<PatcherConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <BackupDirectory>XEW\Backup</BackupDirectory>
  <DecompressedUPKOutputDirectory>XEW\UpkUnpacked</DecompressedUPKOutputDirectory>
  <PatchTargets>
    <PatchTarget>
      <!-- The file we want to patch-->
      <TargetPath>XEW\Binaries\Win32\XComEW.exe</TargetPath>
      <IsUPKFile>false</IsUPKFile>
      <Patches>
        <PatchEntry>
          <Description>Read DefaultGameCore.ini from Config Folder</Description>
          <FindValue>   25 00 64 00 00 00 00 00 49 00 6e 00 69 00 56 00 65 00 72 00 73 00 69 00 6f 00 6e 00 00 00 00 00 2e 00 2e 00 5c 00 2e 00 2e 00 5c 00 58 00 43 00 </FindValue>
          <ReplaceValue>   25 00 64 00 00 00 00 00 49 00 6e 00 69 00 56 00 65 00 72 00 73 00 69 00 6f 00 6e 00 00 00 00 00 2e 00 2e 00 5c 00 2e 00 2e 00 5c 00 57 00 43 00 </ReplaceValue>
        </PatchEntry>
      </Patches>
    </PatchTarget>
  </PatchTargets>
</PatcherConfiguration>

All that needs to be changed would be:

<TargetPath>XEW\Binaries\Win32\XComEwOriginal.exe</TargetPath>
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...