> For the complete documentation index, see [llms.txt](https://shujynx.gitbook.io/p5-modding-guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shujynx.gitbook.io/p5-modding-guides/difficulty-easy/multiplecpks.md).

# Multiple CPK Loading

{% hint style="danger" %}
**This is only possible if you have correctly installed P5EX**
{% endhint %}

So you installed P5EX, but don't want to always have to rebuild the same mods? Well this guide is for you!

P5EX allows you to load modded files from multiple [CPKs](https://amicitia.miraheze.org/wiki/CPK). This means you won't have to rebuild the same mods all of the time! Here's how you do it.

**Again, this implies you already have P5EX installed.**

If you go inside your P5 install's USRDIR, you'll see a config.yml file that you added while installing P5EX. Open that file in your favourite text editor (Such as [Notepad++](https://notepad-plus-plus.org/downloads/) and [VS Code](https://code.visualstudio.com/), I personally use VS Code, but anything works).

You should see something like this:

![P5EX's config.yml](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MlG0D7yEGIaLp-vTkqg%2F-MlG2Df6SS1bsNBWii8l%2F-MlG43KUSoogR4_Mmc5u%2Fimage.png?alt=media\&token=b988c286-4146-4ed8-8839-1498c6c084d3)

{% hint style="warning" %}
**This file could be different in newer versions of P5EX, but the guide should still work**
{% endhint %}

You wanna look at these lines here:

![CPK Settings](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MlG0D7yEGIaLp-vTkqg%2F-MlG2Df6SS1bsNBWii8l%2F-MlG4Tqlta0w_Sh5BSLC%2Fimage.png?alt=media\&token=cd38dc62-f542-4e6c-845e-43a4842df2ad)

Specifically at lines 6 and 7.\
Line 6 specifies how many CPKs should P5EX look for.\
Line 7 instead specifies what names the CPKs have.\
You can see by default there are 3 CPKs, 2 of wich are included with P5EX. The other one is CommonMods wich is not present. Now look at your USRDIR.

You should see these files:

![P5 USRDIR folder after installing P5EX](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MlG0D7yEGIaLp-vTkqg%2F-MlG2Df6SS1bsNBWii8l%2F-MlG5N-VOC6RiChSGmEu%2Fimage.png?alt=media\&token=eb522728-dc7c-405d-ad27-9e117c655da0)

In this folder you can see different files, some from P5 and some from P5EX.\
You need to pay attention to CommonMods\_01.cpk, ExpandedBGM\_02.cpk and P5RBustups\_03.cpk\
As you can see they have the same name as the ones specified in the Config, but they also have a number besides them. That number specifies the order in wich the CPKs are loaded in.\
For example: Looking at the image here you can see the three files CommonMods\_01.cpk, ExpandedBGM\_02.cpk and P5RBustups\_03.cpk named in this order.\
This means the load order is gonna be something like this:<br>

![Example of the load order of the multiple CPKs](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MlG0D7yEGIaLp-vTkqg%2F-MlG2Df6SS1bsNBWii8l%2F-MlG7KnGWBFxYYybbvRe%2Fimage.png?alt=media\&token=ce75d309-3acb-4bbb-805f-4d6bf9feb7f8)

Always pay attention to the load order.\
As an example: if you have a mod that replaces the main Joker model in mod.cpk, if you have another mod that replaces that same file in a CPK with a lower priority it wont be loaded.

You can build another CPK using Aemulus.\
Boot it up and when you're in the P5 category click on the little cog:

![Click on this cog inside of Aemulus](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MlG0D7yEGIaLp-vTkqg%2F-MlG2Df6SS1bsNBWii8l%2F-MlG9TUOBNE0_hRzzsSH%2Fimage.png?alt=media\&token=f4ae8e78-751d-4921-82ee-18ed0cda0d0f)

You'll see this window pop-up.

![P5 Config Window](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MlG0D7yEGIaLp-vTkqg%2F-MlG2Df6SS1bsNBWii8l%2F-MlG9ayDS67A7IKyY2Qa%2Fimage.png?alt=media\&token=8cc47b9a-ea98-4e63-a8eb-55124b839e57)

You can see the text field named: CPK Name and that I currently have it named "mod".\
Aemulus will always build a file named like this: \[cpkname].cpk\
So if you want to install stuff in CommonMods\_01.cpk you need to make the CPK name into CommonMods\_01.

After Aemulus is done building the cpk, you can bootup the game and you'll see your mods working!

{% hint style="warning" %}
**Not every** **mod is 100% guaranteed to work inside of a CPK that isn't mod.cpk**
{% endhint %}

{% hint style="danger" %}
**If you ever want to build mods in another CPK make sure to change the name in Aemulus's config**
{% endhint %}

## Alternative way of building a CPK

If you don't want to use Aemulus to build CPKs (for some reason),\
you can use [CRI File System Tools](https://www.welovepes.com/2020/10/crifilesystemtools.html). I'll explain how to do it.

After you've downloaded the program, open it. You should see a window that looks like this:

![CPK File Builder Window](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2FBK1INSKJsFsiY8KJ8G2A%2Fimage.png?alt=media\&token=62834828-e892-4b71-a304-6c66d30d59f7)

The CPK Builder GUI is actually very intuitive.

Remember the files HAVE to be in the same structure as P5's, so for example if you want to install a mod that has models you would have something that looks like this:

![Example of a mod](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2F9GxCdZgjbCRTP6865a8s%2Fimage.png?alt=media\&token=513b0feb-13b5-4ac8-b309-784b383a1069)

To add files just drag the folders to the "Root" mention in the CPK Builder,\
after that click ![](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2FUPL2r3IAtOvJJUQn7RRm%2Fimage.png?alt=media\&token=8f3d4057-5c79-4efd-a145-28a4cf707f56). You'll see this:

![Build Window](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2F0Xpyv27rn15qFNssEy7H%2Fimage.png?alt=media\&token=4c06576c-61e1-4993-9216-7896c6ea0e2c)

Start by clicking ![](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2F4fx6zbBMPFzVLYKhHw4J%2Fimage.png?alt=media\&token=0c4639e6-52bb-4dfd-8780-1efa65aed0e9), it will make a Windows Explorer window pop up and ask you to save a file.   Just go to your P5 Install's USRDIR and save the CPK with the name CommonMods\_01 (or whatever you want the CPK's name to be, just make sure its the same as the name you set in P5EX's Config YML). After doing that, change the settings to this:

![Correct Settings for Building](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2Fyfim5ETx6MOEcLuJHQmp%2Fimage.png?alt=media\&token=24c15a70-5a1d-4a1d-a7e0-3c1429ecdf9c)

After changing the settings and double checking that everything is right,                                                just click ![](https://4292567930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlG0D7yEGIaLp-vTkqg%2Fuploads%2FGuD9m200BHNMjglBSC9z%2Fimage.png?alt=media\&token=fc3e1496-1299-44e2-a242-2afc90cdf24a), wait for it to build and then boot up the game.

Check that everything works and if it doesn't, start from the beginning!

### This is about it for the guide, hope it helped you!
