RimWorld

RimWorld

211 ratings
PatchOperationHighlander
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.1, 1.2, 1.3, 1.4, 1.5
File Size
Posted
Updated
83.180 KB
19 Jul, 2021 @ 4:36pm
11 Apr @ 8:54pm
8 Change Notes ( view )

Subscribe to download
PatchOperationHighlander

In 1 collection by Charlotte
Multiplayer-able!
236 items
Description
A library of useful patch operations intended for collaboration.

Due to the nature of RimWorld DLL loading, there can only be one Assembly for the PatchOperation namespace. Feel free to contribute.

PatchOperation.LoadOnDemand[github.com]
Given a set of mods and a set of folders, LoadOnDemand loads the defs found in the folders located inside Defs_OnDemand if the mods exist. Makes it easier to manage optional dependencies as you can combine it with other PatchOperations.

PatchOperation.Context[github.com]
Given a xpath, using the following operations, limit their context to the xpath and run them in sequence. Huge performance gain as multiple operations are limited to small portions of the xml document. Can apply to any xpath with children.

PatchOperation.Set[github.com]
Given a xpath, add or replace child elements. Useful to change a single element that contains multiple children without setting Context. It'll avoid adding duplicates or complain if any is missing.

PatchOperation.Evaluate[github.com]
Given a member field or property with the syntax Type:Member, compare the member's value with the given value. Optionally, log the current value.

PatchOperation.FindModByID[github.com]
Just like its vanilla PatchOperationFindMod counterpart, executes the PatchOperation in match if found otherwise nomatch. Optionally, match all mods in the list.

PatchOperation.LogXML[github.com]
Writes the XML in its current state to the log, very useful to find out what happened. xpath is optional, combos well with Context.

PatchOperation.LogText[github.com]
Writes text, very useful for debugging, don't understimate.

Visit the wiki[github.com] for documentation and examples.
Source at Github[github.com]
20 Comments
SnekiChaos 12 Apr @ 7:40am 
Yeah it was that, I did a clean reinstall and it did fix it, thank you <3
Charlotte  [author] 12 Apr @ 7:26am 
Probably steam hasn't updated it on your side. I checked my workshop folder and it's correctly updated to 1.5. Also steam wouldn't show the 1.5 otherwise.
SnekiChaos 12 Apr @ 4:25am 
Hey, so I see there was an update today...but for some reason the Mod still appears as outdated in both Mod settings and RimPy
Charlotte  [author] 19 Feb @ 7:34am 
Yeah, it's been mostly superseded. The only benefit from them is that you can combine them with other logic operations, you can't do that with the tools in base game. Some may find it useful to load on demand according to some variable from Evaluate or something.
Thundercraft 15 Feb @ 6:22pm 
(Part 1)
Quote, "PatchOperation.LoadOnDemand
Given a set of mods and a set of folders, LoadOnDemand loads the defs found in the folders located inside Defs_OnDemand if the mods exist."


Quote, "PatchOperation.FindModByID
Just like its vanilla PatchOperationFindMod counterpart, executes the PatchOperation in match if found otherwise nomatch."


I'm sure these operations are useful in certain circumstances, such as FindModByID's ability to match all mods in a list. But - and correct me if I'm wrong - can't most of the functionality of these two operations now be found in the base vanilla game?
Thundercraft 15 Feb @ 6:22pm 
(Part 2)
I did some searching and found the outdated mod ModCheck [ludeon.com] and ModCheck (Continued) . The description of the latter says:
"The primary task for ModCheck is to remove the need for patch mods. It's done by adding test operations, which can tell if another mod is loaded, if one mod is before another, is of at least a certain version, either in About or in ModSync."

But, it also says, quote:
"All functionality of this mod exists in the base-game now so it will not be updated further"
(つ◉益◉)つ 26 Nov, 2023 @ 5:56pm 
@orravan kek
Orravan 9 Nov, 2023 @ 12:47pm 
@ZzZombo
POH literally predates XML Extensions.
Witch ~ 16 Nov, 2022 @ 3:27am 
Hes just saying
Undeadbanana 16 Nov, 2022 @ 2:22am 
@ZzZombo Are you getting paid for gatekeeping what people can do or is it just like a passion project?