Build Patches - squidgy617/BrawlInstallerPlugins GitHub Wiki

This serves as a guide for the Create Build Patch and Install Build Patch plugins.

Build patches make use of file patches, so if you have not already, you should read the guide on Comparing and Patching first.

Build patches allow you to search a build for relevant files and patch them if they're found. They also allow you to supply files that can be used if a match is not found or to always be installed.

The main purpose of build patches is to provide a way to package mods that make changes to multiple files in a build without requiring users to replace entire files in their build. This means they can install your mod while retaining any changes they've already made to BrawlCrate-compatible files that your mod makes changes to. This can be useful for menu mods, Subspace Emissary mods, or really any mod that would otherwise require manually editing files in BrawlCrate. By utilizing file and build patches, you can package virtually any mod in an easy-to-install format.

Creating Build Patches

Once you have some patches and/or files you'd like to include in a build patch, you can navigate to Plugins > BrawlInstaller Plugins > Files > Create Build Patch. A form will populate.

image

This form has the following controls:

  • File Entry List - a list of entries that make up the build patch. Each entry has any combination of a path, patch file, and a file. There are small + and - buttons on the side of the control that can be used to add new entries.
  • Path - The path for the selected entry. This is the location in a build where the file that is to be patched or replaced can be found, starting at the root of the build. For example, if you are trying to patch or replace the file sc_selcharacter.pac in Project+, you would set this field to \pf\menu2\sc_selcharacter.pac. When the build patch is installed, this entry will search for the file at this location.
  • Patch File - The .filepatch to install if the file in the Path filed is found. If it is found, this patch will be applied to the file automatically just like applying a regular file patch (see Applying Patches), but the user will not be prompted to make any selections and the file will save automatically.
  • File - If the file in the Path field cannot be found, or if the Patch File field is left empty, this file will be installed instead at the location specified in the Path field. If this file is meant to be a backup in the former case, it is recommended to set this file to an already patched version of the file you would like to otherwise patch. If you do not expect the file to already exist in a user's build, you may just supply this file without a patch.
  • Overwrite file if it exists - If this is selected, then if the Patch File field is empty and the File field is filled in, the file at the location specified in the Path field will be completely replaced with the supplied file. The main purpose of this is if you have files that cannot be read by BrawlCrate, and thus cannot be patched, but that you wish to update in the build when installed.
  • Update fighter IDs - This field is only used when installing a character. If you include a build patch in a character package, the user will have the option to install the build patch during installation. If the user does so and this field is checked, the file patched or installed by this entry will be checked for Fighter/Cosmetic/Slot/CSSSlot IDs matching those in the Ex Configs of the character package. If a match is found, the IDs will be updated appropriately while the character is installed to ensure the right IDs are present after installation. This field would primarily be used if your patch involves adding a character to certain parts of the game, such as SSE, where you want to ensure the new fighter shows up instead of a totally different fighter.
  • Open - Open an existing build patch, allowing you to modify it.
  • Save as... - Save the build patch as a .buildpatch file, allowing you to use it later or share it.
  • Cancel - Close the form without saving.

Generally speaking, you should at minimum supply a path and a file for any entry in the build patch. If the file can be read by BrawlCrate and you expect it to appear in users' builds, you should also try to supply a patch file. If you don't expect the file to appear in users' builds or it's a file that can't be ready by BrawlCrate, you don't need to supply a patch file, and in the latter case you may want to set it to overwrite the file if it is found.

The update fighter IDs field is only useful if you intend to include the patch in a character package, and even then, only matters if the file contains fighter IDs tied to the new fighter.

When you save a build patch, only entries with a value in the Path field and at least one other field (that is, either the File or Patch File field) will be included. Any other entries are not valid.

Once you've added all the entries you wish, you can save the file to any location.

Installing Build Patches

If you have a build patch to install, you can navigate to Plugins > BrawlInstaller Plugins > Files > Install Build Patch to do so. A prompt will appear asking you to select the build patch to apply, and upon doing so, you will get a progress bar as the patch is installed. Once it finishes, you will get a message indicating such.

Build patches, unlike file patches, are immediately applied to the build set in your Default Build Path, rather than you selecting files to apply them to. Also unlike file patches, when installing a build patch you will not be prompted to make changes to what nodes are modified in the patching process. Like other plugins, however, backups of all modified files will be created, so you can simply restore a backup if the build patch contains unexpected changes.