XPath Patching

Started by larSyn, September 22, 2017, 02:38:55 PM

Previous topic - Next topic

larSyn

Hey all

So I just posted my first mod, Smokeleaf Industry, and had a user ask for a patch for another mod.  I was able to get a patch working fine with xpathing, so, no problems there, works as intended. 

My question is, is it better to release the patch as a separate download, or can it be left in my main mod?  I tried running my patched mod without the other mod and everything seemed to be working normally.  I'm new at this stuff and just want to make sure I'm following good practices.

Thanks

CannibarRechter

I'm building a big texture mod, which not only retextures the main game, but many popular mods. I have an entire subdirectory dedicated to those other mods. The trick is just setting the <success>Always</success> parameter, or using the the Sequence-Test method (which I recommend against, as it is incompletE). In any case, if you have set success Always, then your patches cannot fail, and therefore can cause no harm by being included with your mod.

As a precaution, I would make sure you test your mod with the mod that you are modding both enabled AND disabled. Otherwise users of your mod who don't have the other mod may have problems.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

larSyn

Quote from: CannibarRechter on September 22, 2017, 02:56:58 PM
The trick is just setting the <success>Always</success> parameter, or using the the Sequence-Test method (which I recommend against, as it is incompletE). In any case, if you have set success Always, then your patches cannot fail, and therefore can cause no harm by being included with your mod.

I do have the <success>Always</success> in there.  I tested it out without the other mod and all appeared to be working normally.  I may go the separate route now though thinking about it, as there are quite a few things to change and I would like some cross use between the mods.

Thanks for your help!

Nightinggale

I worked xPath in order to do what you have done. However I have not been able to get it to work reliably in all cases. I have just released a tool called ModCheck, which reliably detects the presence of other mods based on their name rather than xPath, which should make it more reliable. This means you should be able to add the patch to your mod rather than having two mods. It's also able to do other tasks and one of them seems to be interesting for you as well. You can make it print an error to the log (hence making it popup) if Architect Sense is loaded after your mod.
ModCheck - boost your patch loading times and include patchmods in your main mod.

AngleWyrm

Quote from: larSyn on September 22, 2017, 02:38:55 PM
My question is, is it better to release the patch as a separate download, or can it be left in my main mod?

Let's say a player with several dozen mods finds this one and would like to try it.
  • Option one: Download mod and try it
  • Option two: Download several disconnected pieces or else problems
Additionally, it becomes a maintenance headache when the various pieces go through version updates.

So my vote is for a single mod download that contains all it's compatibility patch features.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

Albion

Yeah I second AngleWyrms opinion. Putting it all in one mod makes it easier for the user who just downloads one thing and is done with it.
However it's also more work to maintain all patches since the mods the patches are refering too get updates too sometimes.

Nightinggale

I agree that fewer mods would be better. Setting up mods and meet requirements and make sure you have all the needed patchmods for the mods you use is a big mess. Having just one mod makes it a whole lot easier to set up for the user.

Quote from: Albion on November 01, 2017, 05:17:54 AMHowever it's also more work to maintain all patches since the mods the patches are refering too get updates too sometimes.
The right question to ask here is the workload for patch mods vs workload in a single mod. If a mod updates, which adds a need to update the patch file, will it be more work to have the file in the mod or in a patch mod? 99% of the work will be in the patch file where it doesn't really matter if the patch file is in one mod or the other.
ModCheck - boost your patch loading times and include patchmods in your main mod.

larSyn

I intend to combine the mod and patch(es) for A18.  I did end up running into a couple issues at first, the patches didn't throw any errors, but they didn't do what they were supposed to either.  They worked as intended as a separate mod though.  I'm gonna spend some more time working it out before the stable release.

Quote from: Nightinggale on October 31, 2017, 11:06:38 PM
I worked xPath in order to do what you have done. However I have not been able to get it to work reliably in all cases. I have just released a tool called ModCheck, which reliably detects the presence of other mods based on their name rather than xPath, which should make it more reliable. This means you should be able to add the patch to your mod rather than having two mods. It's also able to do other tasks and one of them seems to be interesting for you as well. You can make it print an error to the log (hence making it popup) if Architect Sense is loaded after your mod.

Cooool...I'm gonna check this out.  thanks!