From d5802019f5a0a6088d5412bab8376b1c8da19f98 Mon Sep 17 00:00:00 2001 From: anysad Date: Sat, 3 Aug 2024 20:52:19 +0300 Subject: [PATCH 1/2] inital commit --- .../08-00-custom-notestyles.md | 5 + .../08-01-creating-a-notestyle.md | 117 ++++++++++++++++++ .../08-02-using-a-notestyle-in-a-song.md | 8 ++ ...custom-countdowns-and-custom-coutndowns.md | 7 ++ .../09-01-creating-custom-countdowns.md | 30 +++++ .../09-02-creating-custom-popups.md | 32 +++++ ...-using-custom-countdowns-and-custom-popups | 1 + src/SUMMARY.md | 9 ++ 8 files changed, 209 insertions(+) create mode 100644 src/08-custom-notestyles/08-00-custom-notestyles.md create mode 100644 src/08-custom-notestyles/08-01-creating-a-notestyle.md create mode 100644 src/08-custom-notestyles/08-02-using-a-notestyle-in-a-song.md create mode 100644 src/09-custom-countdowns-and-custom-popups/09-00-custom-countdowns-and-custom-coutndowns.md create mode 100644 src/09-custom-countdowns-and-custom-popups/09-01-creating-custom-countdowns.md create mode 100644 src/09-custom-countdowns-and-custom-popups/09-02-creating-custom-popups.md create mode 100644 src/09-custom-countdowns-and-custom-popups/09-03-using-custom-countdowns-and-custom-popups diff --git a/src/08-custom-notestyles/08-00-custom-notestyles.md b/src/08-custom-notestyles/08-00-custom-notestyles.md new file mode 100644 index 0000000..6a2bd43 --- /dev/null +++ b/src/08-custom-notestyles/08-00-custom-notestyles.md @@ -0,0 +1,5 @@ +# Creating a Friday Night Funkin' Mod - Custom Note Styles + +This chapter will walk you through the process of creating a functioning, fully compatible Friday Night Funkin' mod, using the game's official systems for loading custom content and scripts. Once your mod is complete, you will be able to place it in the `mods` folder in your game install and use its content in-game without overriding the base game content and still maintain compatibility with other mods. + +This chapter goes over adding new note styles to the game, and using them in a level. diff --git a/src/08-custom-notestyles/08-01-creating-a-notestyle.md b/src/08-custom-notestyles/08-01-creating-a-notestyle.md new file mode 100644 index 0000000..c5c3101 --- /dev/null +++ b/src/08-custom-notestyles/08-01-creating-a-notestyle.md @@ -0,0 +1,117 @@ +# Creating a Note Style + +## Note Style Assets + +In order to create your own note style, you will need up to 4 assets: +1. `notes` +2. `noteStrumline` +3. *OPTIONAL* `noteSplashes` *(CURRENTLY DOESN'T WORK)* +4. *OPTIONAL* `holdCover` *(CURRENTLY DOESN'T WORK)* + +## Note Style Data + +A custom stage requires creating a new JSON file in the `data/notestyles` folder + +Below is the "funkin" (aka the default used everywhere) json file `assets/data/notestyles/funkin.json`[^notestylesource] + +```json +{ + "version": "1.0.0", + "name": "Funkin'", + "author": "PhantomArcade", + "fallback": null, + "assets": { + "note": { + "assetPath": "shared:notes", + "scale": 1.0, + "data": { + "left": { "prefix": "noteLeft" }, + "down": { "prefix": "noteDown" }, + "up": { "prefix": "noteUp" }, + "right": { "prefix": "noteRight" } + } + }, + "noteStrumline": { + "assetPath": "shared:noteStrumline", + "scale": 1.55, + "offsets": [0, 0], + "data": { + "leftStatic": { "prefix": "staticLeft0" }, + "leftPress": { "prefix": "pressLeft0" }, + "leftConfirm": { "prefix": "confirmLeft0" }, + "leftConfirmHold": { "prefix": "confirmLeft0" }, + "downStatic": { "prefix": "staticDown0" }, + "downPress": { "prefix": "pressDown0" }, + "downConfirm": { "prefix": "confirmDown0" }, + "downConfirmHold": { "prefix": "confirmDown0" }, + "upStatic": { "prefix": "staticUp0" }, + "upPress": { "prefix": "pressUp0" }, + "upConfirm": { "prefix": "confirmUp0" }, + "upConfirmHold": { "prefix": "confirmUp0" }, + "rightStatic": { "prefix": "staticRight0" }, + "rightPress": { "prefix": "pressRight0" }, + "rightConfirm": { "prefix": "confirmRight0" }, + "rightConfirmHold": { "prefix": "confirmRight0" } + } + }, + "holdNote": { + "assetPath": "NOTE_hold_assets", + "data": {} + }, + "noteSplash": { + "assetPath": "", + "data": { + "enabled": true + } + }, + "holdNoteCover": { + "assetPath": "", + "data": { + "enabled": true + } + } + } +} +``` + +There is quite a lot to unravel, let's break it all down. +- `version`: The version number for the Note Style data file format. Leave this at `1.0.0`. +- `name`: The readable name for the note style, used in places like the Chart Editor. +- `author`: +- `fallback`: +- `assets`: A list of assets data for the note style. + - See [list of asset data](#note-style-assets) that can be used. + +Asset data is structured like so: +- `assetPath`: The main asset path to use for this asset. +- `scale`: Specify the size of the asset relative to the original size. For example, `2.0` makes the sprite twice as big. Defaults to `1.0` if unspecified. +- `offsets`: Some animations may need their positions to be corrected relative to the idle animation. + - Use an array of two decimal values, the first for horizontal position and the second for vertical position. +- `isPixel`: Specify whether to display this asset as being pixel (disabling texture smoothing). Optional, defaults to `false`. +- `data`: The structure of animation data objects that depends on the asset you are going to edit. + +Animation data is structured like so: +- `note`: + - `` +- `noteStrumline`: +- `holdNote`: +- `noteSplash` + - `enabled`: Specify whether to display this asset. Optional, defaults to `true`. +- `holdNoteCover` + - `enabled`: Specify whether to display this asset. Optional, defaults to `true`. + +Animation data is structured like so: +- `prefix`: The animation name as specified by your spritesheet. + - For Sparrow or Packer, check inside the data file to see what each set of frames is named, and use that as the prefix, excluding the frame numbers at the end. + - For Animate Atlases, use either the frame label or the symbol name of the animation you want to play. +- `offsets`: Some animations may need their positions to be corrected relative to the idle animation. + - Use an array of two decimal values, the first for horizontal position and the second for vertical position. +- `looped`: Whether to loop this animation in-game. If false, the animation will pause when it ends, until the game commands the character to do something else. +- `flipX`: Whether to flip the sprites of this animation horizontally in-game. +- `flipY`: Whether to flip the sprites of this animation vertically in-game. +- `frameRate`: A frame rate value, defaulting to `24`. +- `frameIndices`: Optionally specify an array of frame numbers (starting at frame 0!) to use from a given prefix for this animation. + - For example, specifying `[0, 1, 2, 3]` will make this animation only use the first 4 frames of the given prefix. +- `assetPath`: For the `multisparrow` asset type specifically. Define a secondary Sparrow spritesheet which will be loaded, and which contains the frames for this animation. + +[^notestylesource]: \ No newline at end of file diff --git a/src/08-custom-notestyles/08-02-using-a-notestyle-in-a-song.md b/src/08-custom-notestyles/08-02-using-a-notestyle-in-a-song.md new file mode 100644 index 0000000..05be832 --- /dev/null +++ b/src/08-custom-notestyles/08-02-using-a-notestyle-in-a-song.md @@ -0,0 +1,8 @@ +# Using a Note Style in a Song + +There are currently two ways to use your note style in a song once it's implemented. + +1. *[FIXED IN 0.5.0]* Create a new chart. Open the Chart Editor, start a chart, and then select the `Notestyle` box from the `Metadata` toolbox before charting. +2. Edit an existing chart in your mod. Open the `metadata.json` file of the song you want to modify and check in `playData` for the `noteStyle` key. + +Once the chart which references your note style is in your mod folder, simply start the game with your mod installed. \ No newline at end of file diff --git a/src/09-custom-countdowns-and-custom-popups/09-00-custom-countdowns-and-custom-coutndowns.md b/src/09-custom-countdowns-and-custom-popups/09-00-custom-countdowns-and-custom-coutndowns.md new file mode 100644 index 0000000..9a80802 --- /dev/null +++ b/src/09-custom-countdowns-and-custom-popups/09-00-custom-countdowns-and-custom-coutndowns.md @@ -0,0 +1,7 @@ +# Creating a Friday Night Funkin' Mod - Custom Countdowns and Custom Popups + +## [UPCOMING IN 0.5.0] + +This chapter will walk you through the process of creating a functioning, fully compatible Friday Night Funkin' mod, using the game's official systems for loading custom content and scripts. Once your mod is complete, you will be able to place it in the `mods` folder in your game install and use its content in-game without overriding the base game content and still maintain compatibility with other mods. + +This chapter goes over adding new countdowns and popups to the game. diff --git a/src/09-custom-countdowns-and-custom-popups/09-01-creating-custom-countdowns.md b/src/09-custom-countdowns-and-custom-popups/09-01-creating-custom-countdowns.md new file mode 100644 index 0000000..9c3ead8 --- /dev/null +++ b/src/09-custom-countdowns-and-custom-popups/09-01-creating-custom-countdowns.md @@ -0,0 +1,30 @@ +# Creating Custom Countdowns + +All custom countdowns are based on the [current note style](../08-custom-notestyles/08-00-custom-notestyles.md) that is being used in-game. With that being said, you have to [add your assets](../01-fundamentals/01-03-asset-replacement-and-additions.md#asset-replacement-and-additons) with the note style name you are going to use. + +You can add both graphic as well sound assets you are going to use for your countdown: +- The PNG files need to go into `images/countdown/`, replacing the `` with the internal name of our notestyle +- The OGG files need to go into `shared/sounds/gameplay/countdown/`, again replacing `` with the internal name of our notestyle. + +We'll end up with something like this. + +``` +-mods + |-myMod + |-images + |-countdown + |-myNotestyle + |-ready.png + |-set.png + |-go.png + |-shared + |-sounds + |-gameplay + |-countdown + |-myNotestyle + |-introTHREE.ogg + |-introTWO.ogg + |-introONE.ogg + |-introGO.ogg + |-_polymod_metadata.json +``` \ No newline at end of file diff --git a/src/09-custom-countdowns-and-custom-popups/09-02-creating-custom-popups.md b/src/09-custom-countdowns-and-custom-popups/09-02-creating-custom-popups.md new file mode 100644 index 0000000..1b72a19 --- /dev/null +++ b/src/09-custom-countdowns-and-custom-popups/09-02-creating-custom-popups.md @@ -0,0 +1,32 @@ +# Creating Custom Popups + +All custom popups are based on the [current note style](../08-custom-notestyles/08-00-custom-notestyles.md) that is being used in-game. With that being said, you have to [add your assets](../01-fundamentals/01-03-asset-replacement-and-additions.md) with the note style name you are going to use. + +You can ONLY add graphic assets you are going to use for your countdown: +- The PNG files need to go into `images/ui/`, replacing the `` with the internal name of our notestyle + +We'll end up with something like this. + +``` +-mods + |-myMod + |-images + |-ui + |-myNotestyle + |-num0.png + |-num1.png + |-num2.png + |-num3.png + |-num4.png + |-num5.png + |-num6.png + |-num7.png + |-num8.png + |-num9.png + |-combo.png + |-sick.png + |-good.png + |-bad.png + |-shit.png + |-_polymod_metadata.json +``` \ No newline at end of file diff --git a/src/09-custom-countdowns-and-custom-popups/09-03-using-custom-countdowns-and-custom-popups b/src/09-custom-countdowns-and-custom-popups/09-03-using-custom-countdowns-and-custom-popups new file mode 100644 index 0000000..1eabf4e --- /dev/null +++ b/src/09-custom-countdowns-and-custom-popups/09-03-using-custom-countdowns-and-custom-popups @@ -0,0 +1 @@ +# Using Custom Countdowns and Custom Popups diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 5ecf3fa..25e8eca 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -25,6 +25,15 @@ - [Creating a Stage](04-custom-stages/04-01-creating-a-stage.md) - [Using a Stage in a Song](04-custom-stages/04-02-using-a-stage-in-a-song.md) +- [Custom Note Styles](08-custom-notestyles/08-00-custom-notestyles.md) + - [Creating a Note Style](08-custom-notestyles/08-01-creating-a-notestyle.md) + - [Using a Note Style in a Song](08-custom-notestyles/08-02-using-a-notestyle-in-a-song.md) + +- [Custom Countdowns and Custom Popups](09-custom-countdowns-and-custom-popups/09-00-custom-countdowns-and-custom-coutndowns.md) + - [Creating Custom Countdowns](09-custom-countdowns-and-custom-popups/09-01-creating-custom-countdowns.md) + - [Creating Custom Popups](09-custom-countdowns-and-custom-popups/09-02-creating-custom-popups.md) + - [Using Custom Countdowns and Custom Popups](09-custom-countdowns-and-custom-popups/09-03-using-custom-countdowns-and-custom-popups) + - [Appending And Merging Files](10-appending-and-merging-files/10-00-appending-and-merging-files.md) - [Appending Files](10-appending-and-merging-files/10-01-appending-files.md) - [Merging Files](10-appending-and-merging-files/10-02-merging-files.md) From ae37966886b0ba6e7f90768a431ef1f34fca624d Mon Sep 17 00:00:00 2001 From: anysad Date: Sun, 4 Aug 2024 16:52:10 +0300 Subject: [PATCH 2/2] complete note style documentation --- .../08-01-creating-a-notestyle.md | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/08-custom-notestyles/08-01-creating-a-notestyle.md b/src/08-custom-notestyles/08-01-creating-a-notestyle.md index c5c3101..845934e 100644 --- a/src/08-custom-notestyles/08-01-creating-a-notestyle.md +++ b/src/08-custom-notestyles/08-01-creating-a-notestyle.md @@ -3,16 +3,18 @@ ## Note Style Assets In order to create your own note style, you will need up to 4 assets: -1. `notes` -2. `noteStrumline` -3. *OPTIONAL* `noteSplashes` *(CURRENTLY DOESN'T WORK)* -4. *OPTIONAL* `holdCover` *(CURRENTLY DOESN'T WORK)* +- `notes`: The general notes that are displayed in the chart, as well as in-game the player needs to hit. +- `noteStrumline`: The notes on the strumline, along with their corresponding animations, such as it being `static`, the strumline note being `pressed`, `confirming` the note hit. +- `noteSplashes`: The special effect when the player gets `Sick!` rating. + - Currently is buggy, since it doesn't use the asset you provided. +- `holdCover`: The special effect when the player is holding a note. + - Currently is buggy, since it doesn't use the asset you provided. ## Note Style Data -A custom stage requires creating a new JSON file in the `data/notestyles` folder +A custom note style requires creating a new JSON file in the `data/notestyles` folder. -Below is the "funkin" (aka the default used everywhere) json file `assets/data/notestyles/funkin.json`[^notestylesource] +Below is the "funkin" (aka the default) note style json file `assets/data/notestyles/funkin.json`[^notestylesource] ```json { @@ -77,10 +79,10 @@ Below is the "funkin" (aka the default used everywhere) json file `assets/data/n There is quite a lot to unravel, let's break it all down. - `version`: The version number for the Note Style data file format. Leave this at `1.0.0`. - `name`: The readable name for the note style, used in places like the Chart Editor. -- `author`: -- `fallback`: -- `assets`: A list of assets data for the note style. - - See [list of asset data](#note-style-assets) that can be used. +- `author`: The author of the note style, aka the artist who created the assets. +- `fallback`: The note style to use as a fallback/parent, providing a default option when the note style you are using is not available. Optional, defaults to `null`. +- `assets`: A list of asset data for each of the assets for the note style. + - See [list of assets](#note-style-assets) that you can provide the data for. Asset data is structured like so: - `assetPath`: The main asset path to use for this asset. @@ -88,17 +90,17 @@ Asset data is structured like so: - `offsets`: Some animations may need their positions to be corrected relative to the idle animation. - Use an array of two decimal values, the first for horizontal position and the second for vertical position. - `isPixel`: Specify whether to display this asset as being pixel (disabling texture smoothing). Optional, defaults to `false`. -- `data`: The structure of animation data objects that depends on the asset you are going to edit. +- `data`: The structure of note style asset data objects that depends on the asset you are going to edit. -Animation data is structured like so: -- `note`: - - `` -- `noteStrumline`: -- `holdNote`: -- `noteSplash` - - `enabled`: Specify whether to display this asset. Optional, defaults to `true`. -- `holdNoteCover` - - `enabled`: Specify whether to display this asset. Optional, defaults to `true`. +Note Style Asset data is structured like so: +- For `note`: List of animation data for the `left`, `down`, `up` and `right` arrows. +- For `noteStrumline`: List of animation data for each direction and it's variations, such as `Static`, `Press`, `Confirm`, `ConfirmHold` replacing `` with it's each and every corresponding direction. + - As you may see from the [example](#note-style-data)[^notestylesource] that was given, animation data for the `confirm` and `confirmHold` match up, however you can make it have unique animations. +- For `holdNote`: Currently has no list of animation data that can be set. +- For `noteSplash`: There is currently no list of animation data available that can be set. It is likely to be added in the future. + - `enabled`: Specify whether to display the asset. Optional, defaults to `true`. +- For `holdNoteCover`: There is currently no list of animation data available that can be set. It is likely to be added in the future. + - `enabled`: Specify whether to display the asset. Optional, defaults to `true`. Animation data is structured like so: - `prefix`: The animation name as specified by your spritesheet. @@ -106,12 +108,11 @@ Animation data is structured like so: - For Animate Atlases, use either the frame label or the symbol name of the animation you want to play. - `offsets`: Some animations may need their positions to be corrected relative to the idle animation. - Use an array of two decimal values, the first for horizontal position and the second for vertical position. -- `looped`: Whether to loop this animation in-game. If false, the animation will pause when it ends, until the game commands the character to do something else. +- `looped`: Whether to loop this animation in-game. If false, the animation will pause when it ends, until the game commands the asset to do something else. - `flipX`: Whether to flip the sprites of this animation horizontally in-game. - `flipY`: Whether to flip the sprites of this animation vertically in-game. - `frameRate`: A frame rate value, defaulting to `24`. - `frameIndices`: Optionally specify an array of frame numbers (starting at frame 0!) to use from a given prefix for this animation. - For example, specifying `[0, 1, 2, 3]` will make this animation only use the first 4 frames of the given prefix. -- `assetPath`: For the `multisparrow` asset type specifically. Define a secondary Sparrow spritesheet which will be loaded, and which contains the frames for this animation. [^notestylesource]: \ No newline at end of file