class ScriptedSong
package funkin.play.song
extends Song
implements HScriptedClass
Available on all platforms
A script that can be tied to a Song. Create a scripted class that extends Song to use this.
Static methods
staticinit(clsName:String, id:String, ?params:SongParams):ScriptedSong
Initializes a scripted class instance using the given scripted class name and constructor arguments.
staticlistScriptClasses():Array<String>
Returns a list of all the scripted classes which extend this class.
staticscriptStaticCall(clsName:String, funcName:String):Dynamic
Call a custom static function on a scripted class, by the given name, with the given arguments.
staticscriptStaticGet(clsName:String, fieldName:String):Dynamic
Retrieves a custom static variable on a scripted class, by the given name.
staticscriptStaticSet(clsName:String, fieldName:String, ?fieldValue:Dynamic):Dynamic
Sets the value of a custom static variable on a scripted class, by the given name.
Constructor
Methods
cacheCharts(force:Bool = false):Void
Polymod HScriptedClass override of cacheCharts.
Parse and cache the chart for all difficulties of this song.
Parameters:
force | Whether to forcibly clear the list of charts first. |
|---|
clearCharts():Void
Polymod HScriptedClass override of clearCharts.
Purge the cached chart data for each difficulty/variation of this song.
getAlbumId(diffId:String, variation:String):String
Polymod HScriptedClass override of getAlbumId.
Input a difficulty ID and a variation ID, and get the album ID.
Parameters:
diffId | |
|---|---|
variation |
Returns:
String
getBaseInstrumentalId(difficultyId:String, variationId:String):String
Polymod HScriptedClass override of getBaseInstrumentalId.
getDifficulty(?diffId:String, ?variation:String, ?variations:Array<String>):Null<SongDifficulty>
Polymod HScriptedClass override of getDifficulty.
Retrieve the metadata for a specific difficulty, including the chart if it is loaded.
Parameters:
diffId | The difficulty ID, such as |
|---|---|
variation | The variation ID to fetch the difficulty for. Or you can use |
variations | A list of variations to fetch the difficulty for. Looks for the first variation that exists. |
Returns:
The difficulty data.
getFirstValidVariation(?diffId:String, ?currentCharacter:PlayableCharacter, ?possibleVariations:Array<String>):Null<String>
Polymod HScriptedClass override of getFirstValidVariation.
Returns the first valid variation that matches both the difficulty id, and the current character / possible input variations
Parameters:
diffId | |
|---|---|
currentCharacter | |
possibleVariations |
Returns:
Null
getRawMetadata():Array<SongMetadata>
Polymod HScriptedClass override of getRawMetadata.
Retrieve a list of the raw metadata for the song.
Returns:
The metadata JSON objects for the song's variations.
getStickerPackId(diffId:String, variation:String):Null<String>
Polymod HScriptedClass override of getStickerPackId.
getVariationsByCharacter(?char:PlayableCharacter):Array<String>
Polymod HScriptedClass override of getVariationsByCharacter.
Given that this character is selected in the Freeplay menu, which variations should be available?
Parameters:
char | The playable character to query. |
|---|
Returns:
An array of available variations.
getVariationsByCharacterId(?charId:String):Array<String>
Polymod HScriptedClass override of getVariationsByCharacterId.
Nearly the same thing as getVariationsByCharacter, but takes a character ID instead.
Parameters:
charId |
|---|
Returns:
Array
See also:
getVariationsByCharacter
hasDifficulty(diffId:String, ?variationId:String, ?variationIds:Array<String>):Bool
Polymod HScriptedClass override of hasDifficulty.
isDifficultyVisible(diffId:String, variationId:String):Bool
Polymod HScriptedClass override of isDifficultyVisible.
isSongNew(currentDifficulty:String, currentVariation:String):Bool
Polymod HScriptedClass override of isSongNew.
listAlbums(variation:String):Map<String, String>
Polymod HScriptedClass override of listAlbums.
List the album IDs for each variation of the song.
Returns:
A map of variation IDs to album IDs.
listAltInstrumentalIds(difficultyId:String, variationId:String):Array<String>
Polymod HScriptedClass override of listAltInstrumentalIds.
Return the list of available alternate instrumentals. Scripts can override this, fun.
Parameters:
variationId | |
|---|---|
null | difficultyId |
listDifficulties(?variationId:String, ?variationIds:Array<String>, showLocked:Bool = false, showHidden:Bool = false):Array<String>
Polymod HScriptedClass override of listDifficulties.
List all the difficulties in this song.
Parameters:
variationId | Optionally filter by a single variation. |
|---|---|
variationIds | Optionally filter by multiple variations. |
showLocked | Include charts which are not unlocked |
showHidden | Include charts which are not accessible to the player. |
Returns:
The list of difficulties.
listSuffixedDifficulties(variationIds:Array<String>, ?showLocked:Bool, ?showHidden:Bool):Array<String>
This function is deprecated, Funkin no longer uses suffixed difficulties.
Polymod HScriptedClass override of listSuffixedDifficulties.
TODO: This line of code makes me sad, but you can't really fix it without a breaking migration.
Returns:
easy, erect, normal-pico, etc.
onCountdownStart(event:CountdownScriptEvent):Void
Polymod HScriptedClass override of onCountdownStart.
onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void
Polymod HScriptedClass override of onNoteGhostMiss.
scriptCall(funcName:String, ?funcArgs:Array<Dynamic>):Dynamic
Calls a function of the scripted class with the given name and arguments.
scriptSet(varName:String, ?varValue:Dynamic):Dynamic
Directly modifies the value of a local variable of a scripted class.