SCP 914 Custom Conversions

Updated 6 months ago

SCP 914 can have custom recipes added to it via JSON, serving as either a way to add mod support or simply extend the vanilla item recipes.
Supported conversions currently include:

  • Items -> Items
  • Items -> Enemies
  • Enemies -> Items
  • Enemies -> Enemies

Player conversions are specifically coded and cannot be modified.

Formatting

The basic structure of a custom recipe file is as follows:

[
{"ItemName":"", "RoughResults":[""], "CoarseResults":[""], "OneToOneResults":[""], "FineResults":[""], "VeryFineResults":[""]},
]

General info

When adding an item as an input or output conversion, the name needs to specifically be Item.itemName for items (this is usually the name you see when scanning the scrap) or EnemyType.enemyName for enemies (there's not really a good source for these, you'll have to ask or check the code yourself).
Enemy conversions are denoted using a ! before the name, e.g. "!masked", for inputs or outputs. Only enemies registered with LethalLevelLoader work with this as it depends on its enemy list to find all enemy types (this includes all vanilla enemies by default).
If multiple files exist with the same input, the results will be concatenated, e.g. if 2 files add a singular output conversion for a specific item, the results will be combined as if they were included together in a single array.
Enemy output conversions only robustly support indoor enemies that can spawn through vents; outdoor enemies or unique modded enemies that have unusual spawn conditions may work but will likely act strangely and functionality isn't guaranteed.

ItemName

The name of the item or enemy for the input. If found in the input, it will be destroyed and an output will be generated.

Results

5 Arrays of item or enemy names. This can include a mixture of enemies or items.
The strings "*" and "@" are special cases; "*" means the item/enemy will be completely destroyed and produce no output, while "@" is equivalent to copying the input item name, causing it to be replicated in the output.
If the output contains both enemy and item results, first a coin will be flipped to determine whether to convert to an item or an enemy, then all possible results of enemies/items will be picked at random from the possible outputs.
If there are only item or enemy output possibilities, it will pick at random from the possible outputs.
The same name can be included multiple times to weight the odds of a specific output; e.g. "OneToOneResults":["abc", "abc", "def"] will result in the item "abc" being output 2/3rds of the time, and "def" being output 1/3rd of the time.

Output special cases

  • Items in the output with a scrap value will have their scrap value randomly rolled within its normal scrap value range, even if the input and output item are the same
  • Items in the output with a charge will be uncharged if the setting was on Rough or Coarse
  • Enemies that get output on Rough that match the input will be output dead, if possible

Validation and testing

To quickly check that your JSON file is valid without launching the game, you can first run your JSON through a validator, such as this one.
After validating the JSON, ensure your json is placed in a folder specifically named badhamknibbs-scp914-recipes. Then, this folder must be placed in a sub-folder of your BepInEx plugins folder.
For example, the directory could be ..\Lethal Company\BepInEx\plugins\SCPCB\badhamknibbs-scp914-recipes.
When booting up the game, the log will tell you all the JSON files that were successfully found and loaded shortly after the SCPCB plugin starts loading. If your JSON was not loaded and does not appear in the log at all, you likely put it in the wrong location. If the JSON was found but had an error in it causing it to fail loading, an error will be emitted into the console telling you which file failed and what the exact error is and what line/character the error was recognised, allowing you to fix the issue.
The actual conversions aren't checked for until the SCP Dungeon loads and an SCP 914 room spawns in; the log will emit any errors, warnings or general info about the 914 conversions at this stage (roughly at the same time the seed shows up). If any output conversion fails to resolve the name it will default to copying the item/enemy (as if it were "@").
If you plan on uploading your custom recipes (either standalone or as part of a mod to add conversion support for it), your mod zip should have the full BepInEx directory structure at the root, and the badhamknibbs-scp914-recipes folder should be placed in the plugins folder of that directory (e.g. this mods' folder structure leading to the default JSON is SCPFoundationDungeon\BepInEx\plugins\badhamknibbs-scp914-recipes, where SCPFoundationDungeon contains the mod manifest file). Mod managers automatically place mod files in the plugins directory into its own subfolder.