Patch Script Specification for SR3, SR4 & SRGOH (looking for feedback)

Discussion in 'Guides and Tutorials' started by Quantum, Feb 1, 2015.

  1. Quantum

    Quantum Administrator Staff Member

    Note: This post applies to Saints Row: The Third, Saints Row IV, and Saints Row: Gat Out Of Hell.

    I've been trying to figure out a way to make it easier for mod users to install multiple mods. Currently, there are various batch installers and Minimaul's ubiquitous "ThomasJepp.SaintsRow.Stream2Update.exe" tool which already make it significantly easier for mods to co-exist. But there's still one remaining issue: It's difficult to merge multiple mods that make changes to the same ".xtbl" file. Corrodias's excellent tutorial describes how to merge multiple mods, but it's still difficult and a bit overwhelming for non-technical users.

    I wanted to try to find a simple automated way to modify just the parts of an ".xtbl" file I need to change without affecting the rest of the file (including the indentation and spacing). I also wanted to make this easy for the end user without requiring them to install additional applications.

    I believe I have found a good solution, but I'd like to hear your feedback.

    The main caveat is that the mod authors need to become familiar with basic Windows PowerShell scripting and the very powerful .NET XmlDocument class. Using XmlDocument with XPath searches is a relatively simple way to find and modify just the parts of an ".xtbl" file you need to change.

    Let me know what you think.

    If you have any questions or would like some help with PowerScript, let me know. I just recently taught myself PowerScript, so I'm no expert by any means, but I do have many years of programming experience. Thanks!

    Also, if anyone has something simple they'd like me to write a patch script for, let me know. I know there's a lot of merging going on with "customization_items.xtbl" and maybe there's something I could help with.

    See my Rainy Weather mod for a working example of Patch Scripts. Please let me know if you have any problem getting them to run on your system.

    Attached Files:

    Last edited: Feb 2, 2015
  2. Minimaul

    Minimaul Site owner Staff Member

    It's a nice idea but still doesn't help with conflicting mods - plus it's awkward for a relatively non-technical/non-programmer modder to make the scripts. Something more automatic would be better - ideally something that generates a diff between the original file and the new file - that would also be more able to identify conflicting changes.
  3. Quantum

    Quantum Administrator Staff Member

    Thanks for taking a look at it, Minimaul. I appreciate your comments.

    I know conflicting mods could potentially be a problem if they modify the same section of an ".xtbl" file, and I don't have a great solution for that other than to clearly document what they change. I think it's more of a problem with complicated mods that add or delete whole sections, but problems can be minimized with careful programming. Unfortunately, as you said and I agree, it is awkward for a relatively non-technical/non-programmer modder to make the scripts. I don't have a good way to automate that in Windows, but all I can do is offer my help to anyone who wants to give it a try.

    One thing the patch scripts can do well is to make very specific small changes. Those are relatively easy to write and probably won't conflict with anything. The example script I gave in the specification (Example 1) would be one of those small "safe" patches that won't conflict with anything else. I think most mods that simply change a value or two in a table would be pretty safe.

    It sounds like what you're looking for is something like the Linux "diff -e" command, which can compare two different files and generate a patch script automatically. But even that has problems with multiple mods (and it's not available in Windows).

    Well, I'll continue to add patch scripts to any mods I make, especially if they modify one of the "customize_*.xtbl" files. If people find them useful, great! If not, maybe it will elicit some other ideas.

    If anyone else has any comments, suggestions, or questions, please let me know.
    Thanks, again!
    Last edited: Feb 3, 2015
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice