Adding an SSE Battle to a Character Package - squidgy617/BrawlInstallerPlugins GitHub Wiki

One use of build patches included in a character package is to automatically add a battle to SSE mode when the character is installed. In combination with setting a door ID for your character package, you can make it so that installing your character also makes them unlockable in SSE mode through normal play! This guide explains what steps need to be taken to ensure your SSE mods work as expected when included in a character package.

There are a few prerequisites to this guide:

  • You must have a build with Subspace Emissary Ex, By Kapedani. P+Ex comes with this by default, but other builds may require it to be installed manually.
  • If you do not already know how to add level content to Subspace Emissary, you should read this guide.

This guide does not cover how to create an SSE level in the first place - see the above guide for how to do that. Instead, this guide covers what specific changes you need to keep in mind for it to work correctly when included as a build patch in a character package, and how to package it up.

Preventing Conflicts

The first thing to keep in mind when creating an SSE mod intended for a character package is that some values you use need to be unique. The build patch tools have some ability to ensure certain properties, such as bone indexes, are unique, but they are limited. For SSE mods, consider the following.

Door ID/Index

A typical SSE battle will be added as a door to a stage that exists in vBrawl. When doing this, you have the opportunity to choose your door index. Typically, the door index is just one higher than the previous door index in a given GDOR node. However, this isn't a hard rule - the door index can theoretically be anything.

image

This door has an index of 8, even though there is only one other door with an index of 1. This functions normally in-game.

When choosing your door index, if you think there's a chance the number you're picking might be taken, consider a different one. Alternatively, if you prefer, you can actually change the LevelID, LevelSequenceID, or LevelSegmentID fields to pick something unique, but these should typically match your level so this is not recommended.

File IDs

When adding to SSE mode, you will find yourself creating stepjumps. Every stepjump has a corresponding GDOR, which typically represents the door you came from to get to it, as well as a File ID, which is a series of hex bytes that represent the name of the file for the level to jump to. When you're configuring your stepjump, you want to make sure your file ID is unique - if not, when someone installs your mod, they may find your stepjump taking them to the wrong location.

The first byte of the file ID typically matches the first byte of the ID of the stage you came from, but with the other bytes, you have more freedom. Each byte consists of two hex digits. Here are the values you can use for the bytes:

  • Byte 1 - Should typically match the stage ID (e.g. Skyworld uses 04)
  • Byte 2 - For a regular stage, can be anything from 00 to 44. For savepoint, set to 45. For a match Vs. Enemies, can be 46 to 4F. For a match Vs. Boss, can be 50 to 59. For a match Vs. Fighter (usually the case for a character package), can be 5A to 63.
  • Byte 3 - This byte can be anything between 00 and 63.
  • Byte 4 - The substage ID, can be anything from 00 to 1A.

Like with a door ID, when choosing these bytes for the file ID, try to choose a combination that isn't likely to already be used in someone's build.

As long as you ensure both the door ID and any referenced file IDs are unique, there should be no conflicts when the patch is installed.

Setting Fighter IDs

The other thing to keep in mind when configuring your SSE mod is that, during installation, the character being installed may have their ID changed. If you intend to add a Vs. battle with this character, you've likely already set up the IDs for the fighter in whichever location they are fought. Fortunately, when you include a build patch with a character package, it is able to automatically detect and update these IDs during installation.

Ensuring IDs are updated correctly is simple. When creating a character package, you include a set of ExConfigs, each of which ends with an ID. For example, you might have a fighter config of ID B8 named FighterB8.dat. To ensure IDs are updated appropriately, all you have to do is make sure that anywhere you specify a fighter, slot, cosmetic, or CSS slot ID, you select the ID matching the config file in the ExConfigs in the character package.

For example, if I have a character package with FighterB8.dat included, and I'm creating a Vs. Battle against them, I would set the fighter ID for this Vs. Battle to 0xB8.

image

This battle is against a fighter configured with ID 0xB8. If the fighter's ExConfigs are named with ID B8, the IDs here can automatically be updated during character installation.

As long as you follow this simple rule and check a specific box when creating your build patch (see below), your character's IDs should be updated appropriately during installation.

Creating File Patches

Once your files are all in order, it's time to start preparing the patch. Before you start configuring the build patch, you want to create file patches for any files that you modified from an existing build or from the vanilla game. You don't need to do this for brand-new files your mod will add. For adding an SSE battle, this most likely means you're just creating a patch for one of the SSE level .pac files.

For this example, I've made a modification to 040001.pac from the vanilla game. So, I will go to Plugins > BrawlInstaller Plugins > Files > Compare Files. For the first prompt, I select the original 040001.pac from the vanilla game. For the second prompt, I select my modified 040001.pac. After doing so, a form appears, which allows you to pick and choose what changes you want to include in your patch.

image

For this example, I know my modifications were adding the jump bone to_x and the door Door [1], so I check the boxes for these two nodes. I know that when someone installs my mod, I want these two items to always be added, because I don't want to overwrite any other custom doors they might have, so I check the Force Add box for both of them.

Once your selections are made, click Save as... and save it to a location you'll remember.

Creating the Build Patch

Next, it's time to create the build patch. Creating a build patch involves taking all of the patches you've made and all the files you've added and noting down the paths within a build they should be applied to so that they can be installed correctly.

To create your build patch, select Plugins > BrawlInstaller Plugins > Files > Create Build Patch. A form will appear.

image

On this form, you will want to add entries for each patch and/or file you wish to include in your mod. We'll start with the patch. As mentioned in the previous step, I modified the file 040001.pac for my mod, and I created a patch from those modifications called 040001.filepatch. So I create a new entry in my build patch by clicking the + button. For the Patch File field I choose my 040001.filepatch, and for the File field I choose 040001.pac. By filling in both fields, I ensure that if the file can't be found, my modded file will still be installed.

Once I've done this, I need to make sure the installer can find these files. In my build, and the vanilla game, 040001.pac is located in \pf\stage\adventure, so in the Path field I enter \pf\stage\adventure\040001.pac. This indicates that the plugin should search for the file at that location, and if it is found, patch it - otherwise, it will install the file from the File field at that location instead.

For this entry, I decide to uncheck Overwrite file if it exists, because I don't really have any reason to overwrite since I included a patch, but it doesn't really matter either way because the patch will always take priority over the file.

The rest of my files are brand-new files, so I don't have any patches for them. So, for each of them, I simply add a new entry, fill in the Path and File fields, but leave the Patch File field blank. For these files, you can decide whether you want them to overwrite or not.

The only other file to worry about is any file that had fighter IDs. As mentioned in the section on setting fighter IDs, the plugin will automatically try to adjust IDs during installation. My added file 049001.pac contains a fight against my new character, so for that file I already had to set the IDs to match my fighter's configs. As such, for this file's entry, I check the box Update fighter IDs. This makes it so that, during installation, the plugin will check the file for any fighter, slot, CSS slot, or cosmetic IDs, and adjust them accordingly.

Once you've finished your build patch, click Save as... and save the patch to a location you'll remember.

Character Package

Once you've made your build patch, it's time to add it to the character package. Open your package in the Package Character plugin and look toward the bottom of the form for the Build Patch section.

image

Here you can select any number of build patches. The description box will set a description for the currently selected build patch. This description is displayed to the user when installing your character, so it's a good idea to try and describe what the patch does so they can make an informed decision.

The other thing to check is the door ID of your package.

image

The door ID determines the unlock condition for the character. If left blank, the character will be unlocked according to the user's build settings, but if you enter a door ID here, the character will only be unlocked once that door is used. For my character, the final door ID was 04900102, so I set this field to 0x04900102, meaning the character will only be unlocked once the Vs. battle is complete. For full details on door IDs, see Kapedani's guide linked at the top of this one.

Once you've made your changes, save the package to your desired location.

Conclusion

That's it! If you've followed all the steps here, users should be prompted to install your patch when installing the character, and in doing so should find your SSE changes where you expect them to.

And remember, this isn't the only thing you can do with build patches - you can include patches for virtually any file that can be read by BrawlCrate. Feel free to experiment with the different kinds of changes you might wish to include in a character package!