边缘世界 RimWorld

边缘世界 RimWorld

Xml Patch Helper
81 条留言
Leutian Kane 8 月 12 日 下午 6:51 
a walkthru on how this works would be nice, as the profiler for the Xpaths keeps erroring out
Nepenthe 8 月 4 日 下午 9:30 
Just want to say thanks for this mod - I've been using it for years and makes XML patching a lot easier.
Sisyphus 7 月 21 日 下午 2:53 
your the man Phil!
Proxyer 6 月 19 日 上午 3:35 
YES! YES! Ty update!! Making patches just got easier!
Aria Victoria 6 月 18 日 下午 11:18 
TY <3
Aria Victoria 6 月 18 日 下午 7:39 
Oh, I guess the github link is old? Last update on the repo is showing as last year.
Smash Phil  [作者] 6 月 18 日 下午 7:33 
Oh yea sorry, this is already updated to 1.6 I just haven't pushed it to steam.
Aria Victoria 6 月 18 日 下午 7:15 
No rush (As I know you're already super busy as it is), but, is there any chance of a 1.6 version? I've only been without it for a few days and am already looking at the mod page longingly.
cyanobot 2 月 21 日 上午 9:04 
Thank you for many diagnosed typos, invaluable tool.
Smash Phil  [作者] 2024 年 9 月 28 日 下午 5:38 
This isn't really set up to test those, but the concept would be the same as just trying to add that single <li/> node. The point is being able to quickly validate that your xpath is correct and that you're inserting the value exactly where you want it. Nested nodes or not, it would be the same.
123nick 2024 年 9 月 28 日 上午 6:40 
How do you test a patch that adds multiple layers of nodes to a node?

For example, when theres a weapon that has a "costList" field, and each node below it is <ResourceName>x</ResourceName>, where X is the count of resources, then its easy to just add one using the node and value fields this mod has

But if im trying to add an ingredient to a recipedef, to the <ingredient> node, each ingredient is layed out as such:
<li>
___<filter>
________<thingDefs>
__________________<li>ComponentSpacer</li>
________</thingDefs>
___</filter>
___<count>6</count>
</li>

How do i test a patch that adds the li node AND its child nodes to the ingredients node?
aikixd 2024 年 9 月 10 日 下午 10:31 
Here's a larger samples with coloration removed:
<li></color>
<def></color>Spine</color><<i></i>/def></color>
<coverage></color>0.05</color><<i></i>/coverage></color>
<depth></color>Inside</color><<i></i>/depth></color>
<<i></i>/li></color>
aikixd 2024 年 9 月 10 日 下午 10:30 
Yeah, it's a malformed tag. I'm no modder, but a sw dev. If you can point me, I can try to find the source. It seems that `<i></i>` it pushed after the tag opener on an ending tag. If you remove that, then the ending tag becomes correct: `</def>`. When I find-replace `<i></i>` -> ``, the document becomes well formed.
Smash Phil  [作者] 2024 年 9 月 10 日 下午 12:06 
As an FYI you have
<li>
< (this is the invalid character)
</li>
in your results. Which is no good
Smash Phil  [作者] 2024 年 9 月 10 日 下午 12:05 
That’s usually when the result has some symbol I didn’t account for. The coloration of the text is just rich text, so if some symbol closes the rich text brackets prematurely then you’ll see those brackets instead of their color effect.

In this case, < is one such symbol. Not sure what def has that as input, it’s already a reserved character in xml.
aikixd 2024 年 9 月 10 日 上午 11:26 
Yeah, there's something weird going on here: `<color=#3CBEF0FF><<i></i>/def></color>`
aikixd 2024 年 9 月 10 日 上午 11:14 
Same issue as @Jesse - color tags are shown as literals. Path: `Defs/BodyDef[defName="Bird"]`
Smash Phil  [作者] 2024 年 8 月 12 日 上午 1:32 
doesn't matter
Carxofing 2024 年 8 月 11 日 下午 5:45 
What is the best position of Xml Patch Helper in the mod list? At the beginning or at the end?
Mana 2024 年 7 月 19 日 下午 12:43 
I'm late to the modding game and want to thank you PROFUSELY for sharing this. Lifesaver.
Carxofing 2024 年 5 月 30 日 上午 3:10 
@smash Phil Thanks:steamthumbsup::steamdance:
Smash Phil  [作者] 2024 年 5 月 19 日 上午 6:49 
You don’t have to compile anything. Harmony is a dependency, so you’ll need to download that mod on the workshop which will come with a pre compiled dll.
Carxofing 2024 年 5 月 19 日 上午 6:46 
@Smash Phil I downloaded the mod from github and now I was reading the readme file. I just can't figure out how to compile the Harmony file or what program to do it with. I would appreciate it if you could tell me how to do it.
The Dutchman 2024 年 5 月 4 日 下午 1:03 
@Rokuni Try paying attention to the pictures....
Rokuni 2024 年 4 月 30 日 下午 4:03 
is there a guide or something? once i click on it there's no xml whatsoever
Jesse 2024 年 4 月 21 日 上午 12:35 
I was looking at the BodyDef for snakes.
Smash Phil  [作者] 2024 年 4 月 20 日 上午 12:55 
I'll look into it. Which body def?
Jesse 2024 年 4 月 20 日 上午 12:02 
There seems to be some kind of glitch when looking at BodyDefs with the patch helper in 1.4. Everything inside the codeblock turns grey with the color tags showing.
Smash Phil  [作者] 2024 年 4 月 11 日 下午 6:31 
Updated to 1.5
The Blind One 2024 年 3 月 10 日 下午 7:28 
Roger that, thanks for the clarification.
Smash Phil  [作者] 2024 年 3 月 10 日 下午 5:53 
That’s intentional, since it would be arbitrary which patches do or don’t apply to the xml shown in the window. It would end up being confusing without additional UI
The Blind One 2024 年 3 月 10 日 上午 12:37 
So I was using this tool but it doesn't seem to recognize when a patch has patched another mod.

For example;

I have a mod that adds a building to the game
I then have a mod that patches that building's defs to some degree.

Now if I use this tool to check the def of that building, it shows the original def values of the building but not the actual in-game defs as when the patch is applied.

It's a minor thing but it got me confused for well over two hours thinking my patch didn't apply :lunar2019crylaughingpig:
Monkey Magic 2024 年 3 月 9 日 下午 6:46 
Is there a video on this? Would be nice to see this running as an example
Ixcatl 2024 年 3 月 4 日 下午 12:46 
really helpful little piece of kit to remind me how to work with this shit. thank you!
CTH2004 2023 年 11 月 19 日 上午 11:56 
Just to double check, this is soeley for debuging, so it won't be necessary as a requirment if used to assist in creation?

I'm pretty sure that's accurate, just double checking! Thanks!
Smash Phil  [作者] 2023 年 9 月 26 日 下午 2:03 
well it wouldn't be a one liner fix, but knowing that it's just not picking up the type certainly helps. The xpath field would need to be fetched via reflection. The mod is open source btw, github link is in the description if you'd like to submit a PR, but it might be a good idea to chat with me on discord before you do that so you don't take an approach that wouldn't be acceptable.

Just ping me if you decide to work on it yourself, I'm open to PRs on all my mods as long as the code is solid and there aren't any potentially performance ruining changes.
Malnormalulo 2023 年 9 月 26 日 下午 1:46 
I totally understand. I took a quick look, and it seems the problem is that you're retrieving subclasses of PatchOperationPathed, while XML Extensions directly extends PatchOperation to add some extended functionality. Its pathed operations still have a String field named xpath, though, and it looks like that's all you're really relying on, so this might be a one-line fix (or nearly – might need to handle operations without an xpath field differently).

Hopefully that bit of digging helps. If implementing it and testing it is still a ways off with that figured out, I could try to submit a PR. Probably about time I get around to setting up an environment for C# development anyway.
Smash Phil  [作者] 2023 年 9 月 26 日 下午 12:41 
I can look into it when I have time, but it likely won't be any time soon. I'm incredibly busy. If their patches aren't working by default, then they might require some special handling.
Malnormalulo 2023 年 9 月 26 日 上午 10:15 
The dropdown of different patch operations includes various ones added by other mods, but the patches added by XML Extensions aren't listed. Any chance of enabling support for these? I'm currently debugging an issue using one of those operations where this tool would be super helpful.
Auld 2023 年 9 月 10 日 上午 10:05 
Extremely helpful mod, thanks!
Smash Phil  [作者] 2023 年 8 月 8 日 下午 7:05 
You're gonna have to elaborate, I'm not sure what you mean
Codingale 2023 年 8 月 8 日 下午 6:38 
Hey is it possible to have it cache the playmode fetch? Or would that result in a large amount of memory used in the runtime? Thanks for this mod, so much easier now
Marcy 2023 年 5 月 21 日 下午 3:29 
this finally helped me actually figure out how xpaths worked and saved me hours of frustration, i owe this mod my life
Expectation... 2023 年 4 月 4 日 上午 1:51 
What a useful mod for creating patches!
sel 2023 年 1 月 29 日 下午 3:03 
thank you for this mod! this helped immensely in understanding how to make patches.
klvlt 2023 年 1 月 12 日 上午 4:45 
This mod has been (and still is) immensely helpful to me while learning the mysteries of the xpath. Thank you so much for creating and sharing it!
Smash Phil  [作者] 2023 年 1 月 8 日 下午 12:09 
@Kaedys Yea, this is intentional otherwise I would have to determine the execution order of the mod list's patches based on where Xml Patch Helper is in the list. In the future I may add some menu to toggle which mods to execute their patches but this is a bigger task than you think and I'm very pressed on personal time already.

So to answer your question, no. This is strictly the combined xml doc before inheritance and before any xml patches. Maybe in the future when I have more time
Kaedys 2023 年 1 月 8 日 上午 11:39 
Seems like the XML is sees is *before* patches are applies. For example, I have a patch that modifies the leatherdef of a bunch of animals (my own local frankenstein of the various Optimized Leather mods), including one that patches out every usage of, say, Leather_Rhinoceros. I know this is working, because the game does not complain about a missing def for a Race wanter, and the animals in question drop the altered leather def. Yet when I search for "Defs/ThingDef[race/leatherDef="Leather_Rhinoceros"]", it shows me all of the original defs that had it. Is there a way for the mod to show me the XML as it exists *after* all of the existing patches are applied?

It makes it annoyingly difficult to use the mod to test a new patch, since I cannot build off of any existing patches. With Unified XML Export defunct, this appears to be the best window into the XML available, but if it only shows me the XML before patches are applied, that usefulness is rather more limited than I'd like.
The Blind One 2022 年 11 月 29 日 上午 11:45 
Ayo thanks for this mod, figured out how to do a few xpath patches thanks to the tool saving me a lot of time and work <3
Smash Phil  [作者] 2022 年 11 月 13 日 下午 3:34 
Ask in the RW discord server, not here.