Creating your first config - Starexify/JsonConfig GitHub Wiki

How to add the JSON Config API in your project

  1. Download the latest release of the mod from the GitHub or GameBanana (Not yet avaible).
  2. Extract the zip and place the extracted zip in your Friday Night Funkin' mods directory. Make sure the folder is named JsonConfig !

Creating a config

Once JSON Config API is added to your mods folder, you can create a custom config by initializing one in your own module's new() or onCreate() function. Here's an example:

class Testing extends ScriptedModule {
    var config:JsonConfig;

    var configValues:Dynamic = {
        string: "Funkin",
        integer: 69
    };

    function new() {
        super("Testing");

        config = new JsonConfig("modID", configValues);
    }
}

| ⚠️ Important: Don not use "modID" as your actual config ID. Always use an unique id for your config !

After initializing, a config file will be created in the game's config folder, with contents like:

{
  "integer": 69,
  "string": "Funkin"
}

Declaring the Dependency

At last you have to also add JsonConfig as dependency in your mod's _polymod_meta.json file:

{
  ...
  "dependencies": {
      "JsonConfig": ">=0.0.1"
  }
}

| ⚠️ Important: Be sure to include a link to this mod in your mod's description so users know it's required for your mod to work properly!