BeastieballCosmetics Docs

Getting regular data

Some of the data you might need to be similar or exactly the same as game data, you can get most of this data on beastieball.info's beastiepedia, by opening the console you can view the current beastie's data with the "beastie" varaiable.

Shader color replacement

Colors in Beastie images are replaced by shaders, the shader uses the color's HSV hue to determine which colors to replace. Saturation and Value are still used, so you can make a lighter color by reducing Satuaration, and a darker color by reducing Value.

JSON keys

type

This should only ever be "beastie" right now.

id

This should be unique for all loaded swaps, I'd recommend adding your name as a prefix to any swaps you create to ensure that ids don't conflict.

Example:

"id": "jdavis-sprecko-hat",

condition

The conditions for this swap to activate.

specie

string (beastie specie id) or null. Matches if null or the beastie specie's id is the same. IDs can be gotten with "beastie.id" in beastieball.info console.

names

string array or null. Matches if null or the beastie's name is any of the strings.

Example:

"condition": {
    "specie": "shroom1",
    "names": ["Evil", "Red"]
},

sprite

Either a string or an object with the below keys. The string should be the name of the beastie's sprite, can be gotten with the "beastie.spr" key or "beastie.spr_alt" key for alternate sprites. When using an object and loading sprites, sprites should be 1000 x 1000

filename

Template filename formatted using C++ std::format. {} will be replaced with the number of sprite being added, e.g. "{}.png" becomes "0.png", "10.png" and "{:02}.png" becomes "00.png", "10.png". This path is from the BeastieballCosmetics directory, so add your subdir to it e.g. "spreckoHat/{}.png".

count

Count of images, images will be added starting at 0 and ending at this - 1, so a value of 36 would add 0 through 35.

origin

Array with 2 numbers. X origin, Y origin. Bottom middle of the beastie, where it meets the floor.

animations

Currently accepts a string with a beastie's sprite name, and copies their animation, or accepts custom animations in the same format as in the beastie_data file.

Example:

"sprite": {
  "filename": "spreckoHat/{}.png",
  "count": 36,
  "origin": [484, 989],
  "animations": "sprShroom1"
}

colors, shiny, colors2

Either a string (beastie id) or an object with the below keys. When using a string, it'll copy the beastie's color for that type.
Each of these variables contain a colorSet, which has different gradients for each color part of a beastie: A, B, C, D, E, F.
A colorSet is an array, which contains arrays (gradients) which contain gradient colors. Gradient colors have a "color" which is a GML color decimal (BGR instead of RGB) which can be made easily here. And an X value, which is the position along the gradient from 0 to 1.
colors is used for regular beasties, or raremorph and alternate beasties if those colorSets don't exist.
shiny is used for raremorph beasties, or regular and alternate beasties if those colorSets dont exist.
colors2 is used for beasties that have alternate palettes, or regular and raremorph beasties if those colorSets dont exist.
If none of those exist in the swap, the beastie will use their regular colors.
Colors past the length will be looped from the start of the gradient e.g. trying to get color E when there is only A, B and C will get color B.
Base beastie palettes can be gotten with the "beastie.colors", "beastie.shiny", and "beastie.colors2" keys. Although they'll have an extra object for gradients. {"array": [gradientcolors]}, which can either be removed or kept and will still work.

Example:

"colors": [
  [
    { "color": 255, "x": 0 },
    { "color": 16711680, "x": 1}
  ],
  [
    { "color": 255, "x": 0 },
    { "color": 65280, "x": 0.5 },
    { "color": 16711680, "x": 1}
  ],
  [
    { "color": 14090300, "x": 0 },
    { "color": 12756348, "x": 1 },
  ]
],

Example 2 (this will make the sprite appear without any modifications):

"colors": [
  [
    { "color": 255, "x": 0 },
  ],
  [
    { "color": 65280, "x": 0.5 },
  ],
],