Skip to content

Commit

Permalink
Merge pull request #13 from anysad/custom-notestyles-countdowns-and-p…
Browse files Browse the repository at this point in the history
…opups

Custom Note Styles, Countdowns and Popups
  • Loading branch information
EliteMasterEric committed Sep 14, 2024
2 parents f5b3713 + 8f10546 commit 30e6854
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/08-custom-notestyles/08-00-custom-notestyles.md
Original file line number Diff line number Diff line change
@@ -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.
118 changes: 118 additions & 0 deletions src/08-custom-notestyles/08-01-creating-a-notestyle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Creating a Note Style

## Note Style Assets

In order to create your own note style, you will need up to 4 assets:
- `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 note style requires creating a new JSON file in the `data/notestyles` folder.

Below is the "funkin" (aka the default) note style 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`: 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.
- `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 note style asset data objects that depends on the asset you are going to edit.

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 `<direction>Static`, `<direction>Press`, `<direction>Confirm`, `<direction>ConfirmHold` replacing `<direction>` 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.
- 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 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.

[^notestylesource]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/data/notestyles/funkin.json>
8 changes: 8 additions & 0 deletions src/08-custom-notestyles/08-02-using-a-notestyle-in-a-song.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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/<notestyleid>`, replacing the `<notestyleid>` with the internal name of our notestyle
- The OGG files need to go into `shared/sounds/gameplay/countdown/<notestyleid>`, again replacing `<notestyleid>` 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
```
Original file line number Diff line number Diff line change
@@ -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/<notestyleid>`, replacing the `<notestyleid>` 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
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Using Custom Countdowns and Custom Popups
4 changes: 4 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

- [WIP: Custom Playable Characters](05-custom-playable-characters/05-00-custom-playable-characters.md)

- [Custom Note Styles](06-custom-notestyles/06-00-custom-notestyles.md)
- [Creating a Note Style](06-custom-notestyles/06-01-creating-a-notestyle.md)
- [Using a Note Style in a Song](06-custom-notestyles/06-02-using-a-notestyle-in-a-song.md)

# Mod API Systems

- [Migration](09-migration/09-00-migrating-mods-to-newer-versions.md)
Expand Down

0 comments on commit 30e6854

Please sign in to comment.