Skip to content

Commit 937bee2

Browse files
Work in progress on some more rewrites to the scripted classes section.
1 parent 1490d1b commit 937bee2

23 files changed

+132
-66
lines changed

src/05-custom-playable-characters/05-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Required Assets
2+
3+
In order to make a fleshed out custom character that can be used from Character Select in Friday Night Funkin', you need a large number of textures, animations, and audio tracks:
4+
5+
- A [custom character](03-custom-characters/03-00-custom-characters.md)
6+
- This requires a set of singing animations for the character.
7+
- At least one custom song that uses that character; this can be either [a new song](02-custom-songs-and-custom-levels/02-02-adding-the-custom-song.md) or a [variation added to an existing song](02-custom-songs-and-custom-levels/02-05-adding-variations-to-existing-songs.md).
8+
- This requires an instrumental and split vocal tracks.
9+
- A pixel icon asset to use for that character's icon in the Character Select grid.
10+
- This supports either a static image or a Sparrow spritesheet (which includes the animation to play when the character is selected).
11+
- A namecard asset to use for that character's name above them in the Character Select menu.
12+
- The pixellation effect is done in code so this just needs to be a single static image.
13+
- Animations for the character to use in the Character Select menu.
14+
- This is currently hard-coded to use an Adobe Animate texture atlas and cannot use a Sparrow spritesheet.
15+
- The character needs animations for unlock, idle, slide in, slide out, select, and deselect.
16+
- Assets to use for the character's Girlfriend character to the left of them in the Character Select menu.
17+
- This is currently hard-coded to use an Adobe Animate texture atlas and cannot use a Sparrow spritesheet.
18+
- The character needs animations for unlock, idle, slide in, slide out, select, and deselect.
19+
- NOTE: This is hardcoded to use only GF or Nene right now I swear I'll fix this soon.
20+
- Assets for the character to use on the Freeplay menu.
21+
- This is currently hardcoded to use an Adobe Animate texture atlas.
22+
- The character needs animations for leaping in, idle, confirm, and moving to character select. It also optionally has an idle and cartoon animation.
23+
- Assets for the character's Freeplay skin and the backing card.
24+
- This requires a variety of assets but can use Boyfriend's as a fallback.
25+
- Assets for the character's animations in the Results screen.
26+
- Each rank has its own animation and music, but animations can be reused between ranks and results themes can fall back to the default.
27+
- Rank animations are Loss, Good, Great, Excellent, Perfect, and Perfect Gold (the base game uses the same animation for Perfect and Perfect Gold)
28+
- Each also can take its own music, but you can reuse Boyfriend's as a good placeholder.

src/10-appending-and-merging-files/10-01-appending-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ And Polymod will mutate it to get this result:
5959
}
6060
```
6161

62-
If you want something more particular, see [Merging into JSON Files](./10-02-merging-files.md#merging-into-json-files) from [5.2 Merging Files](10-02-merging-files.md) for a more powerful and flexible approach.
62+
If you want something more particular, see [Merging into JSON Files](./10-02-merging-files.md#merging-into-json-files) for a more powerful and flexible approach.

src/20-using-hscript/20-02-scripted-classes.md

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Scripted Classes
2+
3+
Funkin's implementation of HScript uses a system of scripted classes. To create a scripted class, create an `.hxc` file in your `mods/mymod/scripts/` folder, and, using Haxe syntax, create a new class which extends the base class for the type of object you are scripting, like so:
4+
5+
```haxe
6+
// Remember to import each class you want to reference in your script!
7+
import funkin.play.song.Song;
8+
9+
// Choose a name for your scripted class that will be unique
10+
// Also specify the class you are extending, we choose Song here.
11+
// This script's behaviors will extend the default behavior of the song.
12+
class BallisticSong extends Song {
13+
public function new() {
14+
// You have to call the super constructor for the class you are extending, which may have different parameters.
15+
// Check the specific documentation for more info.
16+
super('ballistic');
17+
}
18+
}
19+
```
20+
21+
## List of Scriptable Classes
22+
23+
There is a predefined list of classes which the game has set up to be scriptable, and will automatically load and execute when relevant. More of these will be added in the future.
24+
25+
- `funkin.play.song.Song` for providing unique behavior to custom songs, including playing cutscenes and other stuff. See [Scripted Songs](21-scripted-classes/21-01-scripted-songs.md).
26+
- See also [Video Cutscenes](21-scripted-classes/21-03-video-cutscenes.md), [Ingame Cutscenes](21-scripted-classes/21-04-ingame-cutscenes.md), and [Dialogue Cutscenes](21-scripted-classes/21-05-dialogue-cutscenes.md)
27+
- `funkin.play.character.BaseCharacter` for providing unique behavior to custom characters (such as playing custom animations in certain circumstances). See [Scripted Characters](21-scripted-classes/21-05-scripted-characters.md).
28+
- Note that you need to choose the correct subclass of this class for the animation type of your character!
29+
- `funkin.play.character.SparrowCharacter` is used for characters that have Sparrow spritesheet animations.
30+
- `funkin.play.character.MultiSparrowCharacter` is used for characters that have several Sparrow spritesheet animations to combine into one character.
31+
- `funkin.play.character.PackerCharacter` is used for characters that have Packer spritesheet animations.
32+
- `funkin.play.character.AnimateAtlasCharacter` is used for characters that have Adobe Animate texture atlases.
33+
- `funkin.play.stage.Stage` for providing unique behavior to custom stages, such as creating custom moving props and defining when props animate or when sound effects play in sync with the stage. See [Scripted Stages](21-scripted-classes/24-06-scripted-stages.md).
34+
- `funkin.ui.story.Level` for providing unique behavior to levels in Story Mode. See [Scripted Story Levels](21-scripted-classes/25-07-scripted-story-levels.md).
35+
- `funkin.play.notes.notekind.NoteKind` for providing unique visuals and behavior to certain kinds of notes, which can then be placed in the Chart Editor. See [Custom Note Kinds](21-scripted-classes/26-00-custom-note-kinds.md).
36+
- `funkin.play.event.SongEvent` for creating custom Song Events, which you can place in the Chart Editor and which perform game actions when they are reached. See [Custom Song Events](21-scripted-classes/28-00-custom-note-kinds.md)
37+
- `funkin.ui.freeplay.charselect.PlayableCharacter` for providing unique behavior to custom playable characters. See [Scripted Playable Characters](21-scripted-classes/25-10-scripted-playable-characters.md)
38+
- `funkin.ui.freeplay.FreeplayStyle` for defining the sprites and colors used by the Freeplay menu when a given character is selected. See [WIP]
39+
- `funkin.play.notes.notestyle.NoteStyle` for modifying the behavior of custom note styles. See [WIP]
40+
- `funkin.play.cutscene.dialogue.Conversation` for providing unique behavior to custom dialogue conversations. See [Dialogue Cutscenes](21-scripted-classes/21-05-dialogue-cutscenes.md)
41+
- `funkin.play.cutscene.dialogue.DialogueBox` for providing unique behavior to custom dialogue boxes used in conversations. See [Dialogue Cutscenes](21-scripted-classes/21-05-dialogue-cutscenes.md)
42+
- `funkin.play.cutscene.dialogue.Speaker` for providing unique behavior to custom speakers used in conversations. See [Dialogue Cutscenes](21-scripted-classes/21-05-dialogue-cutscenes.md)
43+
- `funkin.ui.freeplay.Album` for defining custom behavior for Freeplay Albums. See [WIP]
44+
45+
There is also `funkin.modding.module.Module` for custom scripted Modules, which are scripts which receive events everywhere, rather than only in a specific context. See [Scripted Modules](30-scripted-modules/30-00-scripted-modules.md) for more information on how these work.
46+
47+
There are also scripted classes are also set up to be scriptable, but will only be useful if they're accessed from another script. Expect more of these to be added in the future.
48+
49+
- `funkin.graphics.FunkinSprite` for basic static or animated sprites.
50+
- `funkin.graphics.adobeanimate.FlxAtlasSprite` for generic sprites which use Adobe Animate texture atlases
51+
- `flixel.group.FlxSpriteGroup` for groups of sprites which are included inside a state and manipulated together
52+
- `funkin.ui.MusicBeatState` for groups of sprites which represents a given game state. Includes additional utilities for handling script events.
53+
- `funkin.ui.MusicBeatSubState` for groups of sprites representing a substate of an existing state
54+
- `flixel.addons.display.FlxRuntimeShader` for custom GLSL shaders
55+
- `funkin.play.stage.Bopper` for sprites which will play an idle animation to the beat of the music when they are part of a Stage.
56+
- `flixel.FlxSprite` for basic static or animated sprites. Use this only if you can't use FunkinSprite.
57+
- `flixel.FlxState` for basic groups of sprites which represent a given game state. Use this only if you can't use MusicBeatState.
58+
- `flixel.FlxSubState` for groups of sprites representing a substate of an existing state
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Creating a Friday Night Funkin' Mod - Scripted Songs
2+
3+
This guide 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.
4+
5+
This chapter will walk you through the process of adding a script to a Song, and giving examples of the kind of custom behavior which can be implemented with this functionality.
6+
7+
Start by creating a scripted class file with the `.hxc` extension (in the `mods/mymod/scripts/songs` if you want to keep things organized).
8+
9+
```haxe
10+
// Remember to import each class you want to reference in your script!
11+
import funkin.play.song.Song;
12+
13+
// Choose a name for your scripted class that will be unique, and make sure to specifically extend the Song class.
14+
// This class's functions will override the default behavior for the song.
15+
class BallisticSong extends Song {
16+
public function new() {
17+
// The constructor gets called once, when the game loads.
18+
// The constructor takes one parameter, which is the song ID for the song you are applying the script to.
19+
super('ballistic');
20+
}
21+
22+
// Add override functions here!
23+
}
24+
```
25+
26+
You can then add override functions to perform custom behavior. Here are some useful snippets:
27+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Creating a Friday Night Funkin' Mod - Cutscenes
1+
# Creating a Friday Night Funkin' Mod - Video Cutscenes
22

33
This guide 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.
44

5-
This chapter will specifically walk through using scripted Songs to implement the three different types of cutscenes into a mod; Video Cutscenes, Dialogue Cutscenes, and Ingame Cutscenes.
5+
This chapter will specifically walk through using scripted Songs to implement a Video Cutscene into a mod.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Creating a Friday Night Funkin' Mod - Ingame Cutscenes
2+
3+
This guide 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.
4+
5+
This chapter will specifically walk through using scripted Songs to implement an Ingame Cutscene into a mod.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Creating a Friday Night Funkin' Mod - Dialogue Cutscenes
2+
3+
This guide 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.
4+
5+
This chapter will specifically walk through using scripted Songs to implement Dialogue Cutscenes into a mod, like those seen in Week 6.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Creating a Friday Night Funkin' Mod - Scripted Songs
1+
# Creating a Friday Night Funkin' Mod - Scripted Note Kinds
22

33
This guide 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.
44

5-
This chapter will walk you through the process of adding a script to a Song, and giving examples of the kind of custom behavior which can be implemented with this functionality.
5+
This chapter will walk you through the process of adding a script to a Note Kind, and giving examples of the kind of custom behavior which can be implemented with this functionality.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Creating a Friday Night Funkin' Mod - Scripted Stages
1+
# Creating a Friday Night Funkin' Mod - Scripted Song Events
22

33
This guide 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.
44

5-
This chapter will walk you through the process of adding a script to a Story Mode Level, and giving examples of the kind of custom behavior which can be implemented with this functionality.
5+
This chapter will walk you through the process of adding a script to a Song Event, and giving examples of the kind of custom behavior which can be implemented with this functionality.

src/21-scripted-songs/21-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/22-cutscenes/22-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/23-scripted-characters/23-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/24-scripted-stages/24-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/25-scripted-levels/25-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/26-custom-note-kinds/26-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/27-scripted-playable-characters/27-01-TODO.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
- [Using a Stage in a Song](04-custom-stages/04-02-using-a-stage-in-a-song.md)
3131

3232
- [WIP: Custom Playable Characters](05-custom-playable-characters/05-00-custom-playable-characters.md)
33+
- [Required Assets](05-custom-playable-characters/05-01-required-assets.md)
34+
- Implementing a Playable Character
3335

3436
- [Custom Note Styles](06-custom-notestyles/06-00-custom-notestyles.md)
3537
- [Creating a Note Style](06-custom-notestyles/06-01-creating-a-notestyle.md)

0 commit comments

Comments
 (0)