Skip to content

Creating an Advanced Content Pack

Floogen edited this page Sep 11, 2021 · 17 revisions

An advanced content pack for Custom Companions has support for spawning companions through Json Asset created rings.

NOTE: This page only covers utilizing Json Assets to add rings that will spawn companions. If you haven't read the Creating a Basic Content Pack yet, please do so before continuing to this document.

Structure

An advanced Custom Companions content pack consists of the following structure:

[CC] Basic Template Pack
├── manifest.json
│
├── Companions
│   ├── ExampleCompanionUsingCustomAsset
│   │   ├── companion.json
│   │   └── companion.png
│   │
│   └── ExampleCompanionUsingGameAsset
│       └── companion.json
│
└── Objects
    └── ExampleRing
        ├── object.json
        └── object.png

You'll notice the only difference between the basic and advanced content pack is that the latter contains an Objects folder, which is required by Json Assets.

Creating Rings

It is recommended to read over Json Asset's documentation for creating an object. This section will contain a brief overview on how to add a ring (object) to a Custom Companions content pack.

Under the content pack's main folder, besides the Companion folder, create an Object folder.

.
├── Companions
│
└── Objects

Underneath the Object folder, create an object.json file. It should look something like this:

{
  "Name": "AuthorName.Rings.ExampleRing",
  "Companions": {
    "ExampleCompanionUsingCustomAsset": {
      "NumberToSummon": 1
    }
  },
  "Description": "Fill this in!",
  "Category": "Ring",
  "Recipe": null,
  "Price": 0,
  "CanPurchase": true,
  "PurchaseFrom": "HatMouse",
  "PurchasePrice": 100,
  "NameLocalization": {
    "en": "Example Ring"
  }
}

If you have experience with Json Assets, you'll notice the Companions property is something that isn't usually included in an object.json file. This is the property Custom Companions uses to link the ring to the content pack's companions.

The following properties are required on each object.json you add to a Custom Companion content pack:

Property Description
Name Should follow this format: "AuthorName.Rings.ExampleRing"
Companions See Companions
Category Must be "Ring"
Recipe Must be "null"

Any of the other properties available through Json Assets are entirely up to you. In the example above, we set the PurchaseFrom to "HatMouse", however you could change that to any valid value you'd like.

Linking Companions to Rings

To link the custom companions with the content pack to a Json Asset ring, you need to the Companions property to be set like so:

"Companions": {
  "COMPANION_NAME_HERE": { // This should be the value of your companion.json's "Name" property
    "NumberToSummon": 1
  }
}

Multiple companions to one ring

You can have many custom companions associated to a single ring. Each time the player equips it, the framework will pick one randomly to spawn.

An example of multiple companions associated to one ring:

"Companions": {
  "ExampleCompanionUsingCustomAsset": {
    "NumberToSummon": 1
  },
  "ExampleCompanionUsingGameAsset": {
    "NumberToSummon": 3
  }
}