Jump to content

XCOM INI Patcher


taleden

Recommended Posts

I'm looking for mod authors to beta test a new DefaultGameCore mod installer tool. This new tool can be a drop-in replacement for modpatcher, but it is also able to combine the effects of multiple INI mods at the same time, without them overwriting each other like they do with modpatcher.

 

The initial tester(s) will need to install Python 2.7 (free download) and be familiar with the command line and the DefaultGameCore.ini file format. Later on I'll release a native Windows executable and add a GUI, but I want to test the core functionality first.

 

Please post here or send me a PM if you're interested in trying it out.

Link to comment
Share on other sites

I cannot see how it will be able to combine several mods, surely if two mods change the same value you will have to choose one or the other.

 

If they change the very same value, yes, of course, there can be only one final result.

 

But the problem right now is that every INI mod has to specify not only the values they want to actually change, but also every other value in the original INI file which was not changed. What xcominipatch allows is for a mod to change what it wants to without touching anything else.

 

For example, let's say this is the original default INI file:

 

ONE=1
TWO=2
STRUCT=(FIRST=1, SECOND=2, THIRD=3)

 

Now we have one mod that wants to change the "ONE" and "STRUCT.FIRST" settings, so it supplies a modified INI:

 

ONE=10
TWO=2
STRUCT=(FIRST=11, SECOND=2, THIRD=3)

 

So far so good; but now we want to use a second mod that only changes the "TWO" and "STRUCT.SECOND" settings:

 

ONE=1
TWO=20
STRUCT=(FIRST=1, SECOND=22, THIRD=3)

 

If we use modpatcher to install these two mods, whichever one is installed second will overwrite the first one. Instead, xcominipatch can combine them so that you get the effects of both:

 

ONE=10
TWO=20
STRUCT=(FIRST=11, SECOND=22, THIRD=3)

 

Notice not only did both ONE and TWO get changed by the two different mods, but the individual properties of STRUCT were also blended, including the default value for THIRD which neither of them touched.

 

In order to accomplish this, all you have to do is use xcominipatch to generate "diffs" of each mod against the original file. So instead of installing those two modified INIs that contain every setting, the two mod's patches would look like this:

 

ONE=10
STRUCT(FIRST=11)

 

TWO=20
STRUCT(SECOND=22)

 

Does that make sense?

Link to comment
Share on other sites

If you post it. it will be tested.

 

Fair enough; have at it. As I mentioned, for the moment you'll need Python 2.7.3 (32 bit, even if your OS is 64) from python.org, and the xcominipatch.pyc attached to this post. Later on I'll make it a standalone program, and I'm also planning to release the source code under GPL2, I just want to make sure there are no serious bugs first.

 

To get started, you'll need both an original and a modified DefaultGameCore.ini, from which we'll create a patch:

 

C:\SomeDir> xcominipatch.pyc --ini Original-DefaultGameCore.ini --diff Modified-DefaultGameCore.ini

 

If your original INI is embedded in a backup EXE file, you can do it that way too:

 

C:\SomeDir> xcominipatch.pyc --exe Original-XComGame.exe --diff Modified-DefaultGameCore.ini

 

Or, if your current primary XComGame.exe file is unmodified (like after re-verifying via Steam), then it should be found and used automatically:

 

C:\SomeDir> xcominipatch.pyc --diff Modified-DefaultGameCore.ini

 

This will compare the two INIs and create a new file called "ModifiedDefaultGameCore.ini.patch". The patch file contains only the specific settings that were actually changed in the modified INI; everything that was left the same as the original is not included at all. You can do this as many times as you want to generate .patch files for multiple mods.

 

To install these patches, just leave out the --diff option:

 

C:\SomeDir> xcominipatch.pyc FirstMod.patch SecondMod.patch ThirdMod.patch

 

This will make a backup of your XComGame.exe file, and then patch it with all the mods simultaneously. As long as those mods didn't modify exactly the same setting, you should see the effects from all of them (as always, you might have to start a new game first).

 

If you want to apply mods to a specific EXE rather than the automatically located one, you can use the --exe option again:

 

C:\SomeDir> xcominipatch.pyc --exe XComGame-ToPatch.exe FirstMod.patch SecondMod.patch ThirdMod.patch

 

Or, you can apply the patches to a specific standalone INI file:

 

C:\SomeDir> xcominipatch.pyc --ini DefaultGameCore-ToPatch.ini FirstMod.patch SecondMod.patch ThirdMod.patch

 

Any file which will be modified is always backed up first, and old backups are never deleted or overwritten, so you should always be able to undo anything.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...