Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# These are supported funding model platforms

open_collective: haxe
custom: ['https://haxe.org/foundation/support-plans.html', 'https://haxe.org/foundation/donate.html']
custom:
[
"https://haxe.org/foundation/support-plans.html",
"https://haxe.org/foundation/donate.html",
]
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/addition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ body:
- type: textarea
attributes:
label: Screenshots/Videos
placeholder: Demonstrate your additions here...
placeholder: Demonstrate your additions here...
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ body:
- type: textarea
attributes:
label: Screenshots/Videos
placeholder: Demonstrate your enhancements here...
placeholder: Demonstrate your enhancements here...
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ body:
- type: textarea
attributes:
label: Screenshots/Videos
placeholder: Demonstrate your fixes here...
placeholder: Demonstrate your fixes here...
76 changes: 38 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ name: Build and Test

on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
# we need full git history for article dates
fetch-depth: 0
- name: Setup Haxe
uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.3.5
- name: Install Node.js and npm
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install
# at some point all npm needs to be in package.json
run: |
npm install
npm install -g less@2.7
npm install -g less-plugin-clean-css@1.5
haxelib install CodeCookBook-neko.hxml --always --quiet
haxelib install highlighting.hxml --always --quiet
haxelib list

- name: Run build script
run: haxe build.hxml

- name: Upload build artifacts (optional)
uses: actions/upload-artifact@v4
with:
name: build-output
path: |
output/
output/
if-no-files-found: ignore

- name: Setup Haxe
uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.3.5

- name: Install Node.js and npm
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"

- name: Install
# at some point all npm needs to be in package.json
run: |
npm install
npm install -g less@2.7
npm install -g less-plugin-clean-css@1.5
haxelib install CodeCookBook-neko.hxml --always --quiet
haxelib install highlighting.hxml --always --quiet
haxelib list

- name: Run build script
run: haxe build.hxml

- name: Upload build artifacts (optional)
uses: actions/upload-artifact@v4
with:
name: build-output
path: |
output/
output/
if-no-files-found: ignore
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.min.*
.haxelib/
grammars/
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
9 changes: 5 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{"files.associations": {
"*.mtt": "html"
}
}
{
"files.associations": {
"*.mtt": "html"
}
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Funkin' Code CookBook

## [**READ THE DOCUMENTATION HERE**](https://thekade.net/funkin-cookbook/)

> The link above is a **TEMPORARY** link, and **WILL BE CHANGED** in the future!

Forked from [Haxe Code CookBook](https://github.com/HaxeFoundation/code-cookbook), this is a one stop shop for all Funkin' Modding Tutorials!
Expand All @@ -15,11 +17,14 @@ You need [Haxe 3.4.2+](https://haxe.org/download/list/) installed.
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).

Install the libraries using haxelib, run the following command in the root of the project:

```
haxelib install all
```
The CSS files are compressed using [less](http://lesscss.org/#using-less).

The CSS files are compressed using [less](http://lesscss.org/#using-less).
Install from npm:

```
npm install
```
Expand Down
2 changes: 1 addition & 1 deletion assets/content/cookbook/Advanced/01.HScript.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ As you can see, you can basically use HScript like regular haxe, making it ideal

[^philly]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/stages/phillyStreets.hxc>

> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
17 changes: 8 additions & 9 deletions assets/content/cookbook/Advanced/02.ScriptedClasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ class BallisticSong extends Song {
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.

- `funkin.play.song.Song` for providing unique behavior to custom songs, including playing cutscenes and other stuff. See [Scripted Songs](03.ScriptedSongs.md).
- See also [Video Cutscenes](09.VideoCutscenes.md), [Ingame Cutscenes](21-scripted-classes/21-04-ingame-cutscenes.md), and [Dialogue Cutscenes](08.DialogueCutscenes.md)
- See also [Video Cutscenes](09.VideoCutscenes.md), [Ingame Cutscenes](21-scripted-classes/21-04-ingame-cutscenes.md), and [Dialogue Cutscenes](08.DialogueCutscenes.md)
- `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).
- Note that you need to choose the correct subclass of this class for the animation type of your character!
- `funkin.play.character.SparrowCharacter` is used for characters that have Sparrow spritesheet animations.
- `funkin.play.character.MultiSparrowCharacter` is used for characters that have several Sparrow spritesheet animations to combine into one character.
- `funkin.play.character.PackerCharacter` is used for characters that have Packer spritesheet animations.
- `funkin.play.character.AnimateAtlasCharacter` is used for characters that have Adobe Animate texture atlases.
- `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.

- Note that you need to choose the correct subclass of this class for the animation type of your character!

- `funkin.play.character.SparrowCharacter` is used for characters that have Sparrow spritesheet animations.
- `funkin.play.character.MultiSparrowCharacter` is used for characters that have several Sparrow spritesheet animations to combine into one character.
- `funkin.play.character.PackerCharacter` is used for characters that have Packer spritesheet animations.
- `funkin.play.character.AnimateAtlasCharacter` is used for characters that have Adobe Animate texture atlases.
- `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.
- `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).
- `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).
- `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).
Expand Down Expand Up @@ -62,4 +61,4 @@ There are also scripted classes are also set up to be scriptable, but will only
- `flixel.FlxState` for basic groups of sprites which represent a given game state. Use this only if you can't use MusicBeatState.
- `flixel.FlxSubState` for groups of sprites representing a substate of an existing state

> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
12 changes: 10 additions & 2 deletions assets/content/cookbook/Advanced/03.ScriptedSongs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tags]: / "advanced,hscript,song"

# Scripted Songs

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.
Expand Down Expand Up @@ -27,6 +28,7 @@ You can then add override functions to perform custom behavior.
## Variation-Specific Song Scripts

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]

```haxe
import funkin.play.song.Song;
import funkin.save.Save;
Expand All @@ -48,6 +50,7 @@ class DarnellErectSong extends Song
## Custom 'NEW'-Label criteria

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.

```haxe
// ...

Expand All @@ -65,6 +68,7 @@ public override function isSongNew(currentDifficulty:String, currentVariation:St
## Custom Alternate Instrumental behavior

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.

```haxe
// ...

Expand All @@ -89,9 +93,10 @@ public override function listAltInstrumentalIds(difficultyId:String, variationId
## Hiding the Song from the Freeplay Menu

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]

```haxe
// ...

// Line 51
public function listDifficulties(variationId:String, variationIds:Array<String>, showLocked:Bool):Array<String>
{
Expand All @@ -108,8 +113,11 @@ public function listDifficulties(variationId:String, variationIds:Array<String>,
```

[^darnell]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/songs/darnell-erect.hxc>

[^cocoa]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/songs/cocoa-pico.hxc>

[^stress]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/songs/stress.hxc>

[^2hot]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/songs/2hot.hxc>

> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
6 changes: 5 additions & 1 deletion assets/content/cookbook/Advanced/04.ScriptedCharacters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tags]: / "advanced,hscript,character"

# Scripted Characters

This chapter will walk you through the process of adding a script to a Character, and giving examples of the kind of custom behavior which can be implemented with this functionality.
Expand Down Expand Up @@ -143,8 +144,11 @@ override function getDeathQuote():Null<String>
```

[^bf]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/characters/bf.hxc>

[^nene]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/characters/nene.hxc>

[^pico]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/characters/pico-playable.hxc>

[^bf-gf]: <https://github.com/FunkinCrew/funkin.assets/blob/main/preload/scripts/characters/bf-holding-gf.hxc>

> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tags]: / "advanced,hscript,character"

# Scripted Playable Characters

This chapter will walk you through the process of adding a script to a Playable Character, and giving examples of the kind of custom behavior which can be implemented with this functionality.
Expand Down Expand Up @@ -37,4 +38,4 @@ The most important thing to override here is the `isUnlocked` function, which le
}
```

> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
> Author: [EliteMasterEric](https://github.com/EliteMasterEric)
Loading