You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Funkin' Code CookBook
2
+
2
3
## [**READ THE DOCUMENTATION HERE**](https://thekade.net/funkin-cookbook/)
4
+
3
5
> The link above is a **TEMPORARY** link, and **WILL BE CHANGED** in the future!
4
6
5
7
Forked from [Haxe Code CookBook](https://github.com/HaxeFoundation/code-cookbook), this is a one stop shop for all Funkin' Modding Tutorials!
@@ -15,11 +17,14 @@ You need [Haxe 3.4.2+](https://haxe.org/download/list/) installed.
15
17
The static site generator source depends on [hxtemplo](https://lib.haxe.org/p/hxtemplo) and [haxe-markdown (funkin crew fork!)](https://github.com/FunkinCrew/haxe-markdown).
16
18
17
19
Install the libraries using haxelib, run the following command in the root of the project:
20
+
18
21
```
19
22
haxelib install all
20
23
```
21
-
The CSS files are compressed using [less](http://lesscss.org/#using-less).
24
+
25
+
The CSS files are compressed using [less](http://lesscss.org/#using-less).
Copy file name to clipboardExpand all lines: assets/content/cookbook/Advanced/02.ScriptedClasses.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,16 +25,15 @@ class BallisticSong extends Song {
25
25
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.
26
26
27
27
-`funkin.play.song.Song` for providing unique behavior to custom songs, including playing cutscenes and other stuff. See [Scripted Songs](03.ScriptedSongs.md).
28
-
- See also [Video Cutscenes](09.VideoCutscenes.md), [Ingame Cutscenes](21-scripted-classes/21-04-ingame-cutscenes.md), and [Dialogue Cutscenes](08.DialogueCutscenes.md)
28
+
- See also [Video Cutscenes](09.VideoCutscenes.md), [Ingame Cutscenes](21-scripted-classes/21-04-ingame-cutscenes.md), and [Dialogue Cutscenes](08.DialogueCutscenes.md)
29
29
-`funkin.play.character.BaseCharacter` for providing unique behavior to custom characters (such as playing custom animations in certain circumstances). See [Scripted Characters](04.ScriptedCharacters.md).
30
+
- Note that you need to choose the correct subclass of this class for the animation type of your character!
31
+
-`funkin.play.character.SparrowCharacter` is used for characters that have Sparrow spritesheet animations.
32
+
-`funkin.play.character.MultiSparrowCharacter` is used for characters that have several Sparrow spritesheet animations to combine into one character.
33
+
-`funkin.play.character.PackerCharacter` is used for characters that have Packer spritesheet animations.
34
+
-`funkin.play.character.AnimateAtlasCharacter` is used for characters that have Adobe Animate texture atlases.
35
+
-`funkin.play.character.BaseCharacter` has empty stubs for all the rendering and animation handlers, and is only useful for people who want to reimplement their character's animation system by hand.
30
36
31
-
- Note that you need to choose the correct subclass of this class for the animation type of your character!
32
-
33
-
- `funkin.play.character.SparrowCharacter` is used for characters that have Sparrow spritesheet animations.
34
-
- `funkin.play.character.MultiSparrowCharacter` is used for characters that have several Sparrow spritesheet animations to combine into one character.
35
-
- `funkin.play.character.PackerCharacter` is used for characters that have Packer spritesheet animations.
36
-
- `funkin.play.character.AnimateAtlasCharacter` is used for characters that have Adobe Animate texture atlases.
37
-
- `funkin.play.character.BaseCharacter` has empty stubs for all the rendering and animation handlers, and is only useful for people who want to reimplement their character's animation system by hand.
38
37
-`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).
39
38
-`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).
40
39
-`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).
@@ -62,4 +61,4 @@ There are also scripted classes are also set up to be scriptable, but will only
62
61
-`flixel.FlxState` for basic groups of sprites which represent a given game state. Use this only if you can't use MusicBeatState.
63
62
-`flixel.FlxSubState` for groups of sprites representing a substate of an existing state
Copy file name to clipboardExpand all lines: assets/content/cookbook/Advanced/03.ScriptedSongs.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
[tags]: /"advanced,hscript,song"
2
+
2
3
# Scripted Songs
3
4
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.
@@ -27,6 +28,7 @@ You can then add override functions to perform custom behavior.
27
28
## Variation-Specific Song Scripts
28
29
29
30
As of 0.7.4, if in the constructor you were to add an anonymous structure with the field `variation` as a parameter next to the song id, the song script will only be active for that variation. This prevents many conflicts with base game scripts and other mods that may add a variation, as the game would only call the functions from the variation-specific script. If a song doesn't have a variation-specific script, it will fallback to the default one, if it exists. An example of a variation-specific script can be found for Darnell Erect[^darnell]
31
+
30
32
```haxe
31
33
import funkin.play.song.Song;
32
34
import funkin.save.Save;
@@ -48,6 +50,7 @@ class DarnellErectSong extends Song
48
50
## Custom 'NEW'-Label criteria
49
51
50
52
Usually, in the Freeplay menu, a song would not have the glowing 'NEW' label. However if you override the function `isSongNew`, you can have the label appear if a specific criteria is met. An example of this is found in the script for Cocoa (Pico Mix)[^cocoa] which returns true if the variation is Pico and the player hasn't beaten Cocoa Pico Mix.
53
+
51
54
```haxe
52
55
// ...
53
56
@@ -65,6 +68,7 @@ public override function isSongNew(currentDifficulty:String, currentVariation:St
65
68
## Custom Alternate Instrumental behavior
66
69
67
70
Instead of reading from the song's metadata file for possible alternate instrumentals, you can use scripts to lock some of them out of being used until a criteria is met. An example of this is found in the script for Stress[^stress] which locks the pico instrumental behind completing the pico remix, as well as not provide the default instrumental if the song is selected on the pico variation.
71
+
68
72
```haxe
69
73
// ...
70
74
@@ -89,9 +93,10 @@ public override function listAltInstrumentalIds(difficultyId:String, variationId
89
93
## Hiding the Song from the Freeplay Menu
90
94
91
95
The most important thing to override here is the function `listDifficulties`. If you return an empty array, the song will be omitted from the Freeplay menu. An example to this is in the song 2hot[^2hot]
96
+
92
97
```haxe
93
98
// ...
94
-
99
+
95
100
// Line 51
96
101
public function listDifficulties(variationId:String, variationIds:Array<String>, showLocked:Bool):Array<String>
97
102
{
@@ -108,8 +113,11 @@ public function listDifficulties(variationId:String, variationIds:Array<String>,
0 commit comments