Friday Night Funkin' Cookbook
Friday Night Funkin' CookbookIntermediateCreating Custom Freeplay Styles

Creating Custom Freeplay Styles

Reading time: 1 minute

This chapter goes over adding custom freeplay styles, while also ensuring that they appear in the Freeplay State and telling the game when to use them for playable characters.

Freeplay Style Data

A custom freeplay style requires creating a new JSON file in the data/ui/freeplay/styles folder.

Below is the "pico" freeplay style json file assets/data/ui/freeplay/styles/pico.json1

{
  "version": "1.0.0",
  "bgAsset": "freeplay/freeplayBGweek1-pico",
  "selectorAsset": "freeplay/freeplaySelector/freeplaySelector_pico",
  "numbersAsset": "digital_numbers_pico",
  "capsuleAsset": "freeplay/freeplayCapsule/capsule/freeplayCapsule_pico",
  "capsuleTextColors": ["#CC6600", "#CC9900"],
  "startDelay": 1.45
}

Lets break it all down:

  • version: The version number for the Freeplay Style data file format. Leave this at 1.0.0.

    • This will increase if the data file format changes, and tell the game whether additional processing needs to be done for backwards compatibility.
  • bgAsset: The asset path for the background to use for the Freeplay Style.

  • selectorAsset: The asset path for the difficulty selector sprites.
  • numbersAsset: The asset path for the score numbers.
  • capsuleAsset: The asset path for the song capsules.
  • capsuleTextColors: A list of two hex codes representing the colors for the capsule song name text outlines.

    • The first color is for when the capsule is deselected, whereas the second one is for when the capsule is selected. As of now, the first color is unused.
  • startDelay: The amount in seconds for the time needed to pass before switching to PlayState.

Using a Custom Freeplay Style

To use a freeplay style, you must first have a Playable Character. You can set the value of the field freeplayStyle in your custom playable character to use your custom freeplay style or modify the value of other playable characters by using JSONPatch to modify the freeplayStyle value of that character.


  1. https://github.com/FunkinCrew/funkin.assets/blob/main/preload/data/ui/freeplay/styles/pico.json


Contributors:
Pāvels Rimašs
Cameron Taylor
Kolo
Last modified:
Created:
Category:  Intermediate
Tags: