Skip to content

Planned Features

Chitak 985 edited this page Dec 10, 2025 · 1 revision

Welcome to the KittenPatcher wiki!

KittenPatcher is an analog of ModuleManager for KSP, made to patch .xml files effectively. This wiki will provide detailed information on how KittenPatcher works and what it does.

How to create a KittenPatcher patch:

A patch must be located in an .xml file. The mod the .xml file is in must be included in the manifest.toml file in order to be loaded by KSA and KittenPatcher.

KittenPatcher patch example:

Example:
<Patch>
<PatchItem Order="FIRST" NeedsFolder="Core">
<PatchFile File="Core/Astronomicals.xml">
<PatchDelete Name="KittenEva" All="true"/>
</PatchFile>
</PatchItem>
</Patch>

This example would replace all kittens in EVA mode at the start of the game. Below is a detailed description of every KittenPatcher patch component.

KittenPatcher patch components:

The <Patch>...</Patch> root tag must exist for KittenPatcher to read the file. If the tag is not present, the patch will not be loaded or executed.


Inside, every <PatchItem> tag will be first loaded and then executed based on the Order, NeedsFolder, and NeedsFile values:

  • If Order is not present, it will be run in the DEFAULT patching pass, otherwise it will be run in the pass specified.
  • If NeedsFolder is not present, the patch will run no matter what, otherwise it will only run if the folder specified in NeedsFolder exists.
  • If NeedsFile is not present, the patch will run no matter what, otherwise it will only run if the file specified in NeedsFile exists.

Both NeedsFolder and NeedsFile can exist at the same time.

Inside the <PatchItem> tag, all <PatchFile> are executed. <PatchFile> selects the file to patch using the File value which will specify the path from Content. (for example, if you want to access Kitten Space Agency/Content/Core/Astronomicals.xml, you will use Core/Astronomicals.xml) The file is checked to exist first, if it does not the <PatchFile> will be skipped and this will be logged.

Every <PatchFile> contains the patch needed to be executed for that specific file. The tags inside can be:

  • <PatchDelete Name [All]/>: This will delete the tag "Name". "All" specifies if all matching tags should be deleted instead of only the first one, by default it is "false".
  • <PatchCopy Name [NewName]/>: This will copy the tag "Name" and rename it to "NewName". If "NewName" is not specified or is the same as "Name", the tag will be copied without changing the name. If there are multiple tags named "Name", the first one will be used.
  • <PatchEdit Name ValueName Value [All]/>: This will edit the value "ValueName" of tag "Name" to be "Value". If "ValueName" does not exist on the specified tag, the patch will be ignored and this will be logged. "All" specifies if all matching tags should be edited instead of only the first one, by default it is "false".
  • <PatchRename Name NewName [All]/>: This will rename the tag "Name" to be named "NewName". "All" specifies if all matching tags should be renamed instead of only the first one, by default it is "false".

If the tag specified in "Name" does not exist, the patch will be ignored and this will be logged.

KittenPatcher patching passes

KittenPatcher, similarly to ModuleManager, will execute patches in order. If multiple patches have the same order, they will be executed in lexicographically ascending order. (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz)
Here are all of the default patching passes:

  • FIRST
  • SECOND
  • DEFAULT
  • LAST
  • FINAL

Clone this wiki locally