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.

@:value({ fieldValue : null })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

new(id:String, ?params:Null<SongParams>)

Methods

@:value({ force : false })@:value({ force : false })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.

destroy():Void

Polymod HScriptedClass override of destroy.

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.

@:value({ variations : null, variation : null, diffId : null })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 easy or hard.

variation

The variation ID to fetch the difficulty for. Or you can use variations.

variations

A list of variations to fetch the difficulty for. Looks for the first variation that exists.

Returns:

The difficulty data.

@:value({ possibleVariations : null, currentCharacter : null, diffId : null })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.

@:value({ char : null })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.

@:value({ charId : null })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

@:value({ variationIds : null, variationId : null })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

@:value({ showHidden : false, showLocked : false, variationIds : null, variationId : null })@:value({ showHidden : false, showLocked : false })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.

@:value({ showHidden : null, showLocked : null })listSuffixedDifficulties(variationIds:Array<String>, ?showLocked:Bool, ?showHidden:Bool):Array<String>

Deprecated:

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.

onBeatHit(event:SongTimeScriptEvent):Void

Polymod HScriptedClass override of onBeatHit.

onCountdownEnd(event:CountdownScriptEvent):Void

Polymod HScriptedClass override of onCountdownEnd.

onCountdownStart(event:CountdownScriptEvent):Void

Polymod HScriptedClass override of onCountdownStart.

onCountdownStep(event:CountdownScriptEvent):Void

Polymod HScriptedClass override of onCountdownStep.

onCreate(event:ScriptEvent):Void

Polymod HScriptedClass override of onCreate.

onDestroy(event:ScriptEvent):Void

Polymod HScriptedClass override of onDestroy.

onGameOver(event:ScriptEvent):Void

Polymod HScriptedClass override of onGameOver.

onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void

Polymod HScriptedClass override of onNoteGhostMiss.

onNoteHit(event:HitNoteScriptEvent):Void

Polymod HScriptedClass override of onNoteHit.

onNoteHoldDrop(event:HoldNoteScriptEvent):Void

Polymod HScriptedClass override of onNoteHoldDrop.

onNoteIncoming(event:NoteScriptEvent):Void

Polymod HScriptedClass override of onNoteIncoming.

onNoteMiss(event:NoteScriptEvent):Void

Polymod HScriptedClass override of onNoteMiss.

onPause(event:PauseScriptEvent):Void

Polymod HScriptedClass override of onPause.

onResume(event:ScriptEvent):Void

Polymod HScriptedClass override of onResume.

onScriptEvent(event:ScriptEvent):Void

Polymod HScriptedClass override of onScriptEvent.

onSongEnd(event:ScriptEvent):Void

Polymod HScriptedClass override of onSongEnd.

onSongEvent(event:SongEventScriptEvent):Void

Polymod HScriptedClass override of onSongEvent.

onSongLoaded(event:SongLoadScriptEvent):Void

Polymod HScriptedClass override of onSongLoaded.

onSongRetry(event:SongRetryEvent):Void

Polymod HScriptedClass override of onSongRetry.

onSongStart(event:ScriptEvent):Void

Polymod HScriptedClass override of onSongStart.

onStepHit(event:SongTimeScriptEvent):Void

Polymod HScriptedClass override of onStepHit.

onUpdate(event:UpdateScriptEvent):Void

Polymod HScriptedClass override of onUpdate.

@:value({ funcArgs : null })scriptCall(funcName:String, ?funcArgs:Array<Dynamic>):Dynamic

Calls a function of the scripted class with the given name and arguments.

scriptGet(varName:String):Dynamic

Retrieves the value of a local variable of a scripted class.

@:value({ varValue : null })scriptSet(varName:String, ?varValue:Dynamic):Dynamic

Directly modifies the value of a local variable of a scripted class.

Inherited Variables

Defined by Song

final_data:Null<SongMetadata>

read onlycharter:String

The artist of the song.

finalid:String

read onlysongArtist:String

The artist of the song.

read onlysongName:String

The readable name of the song.

@:value(true)validScore:Bool = true

Set to false if the song was edited in the charter and should not be saved as a high score.

@:value(null)variation:Null<String> = null

read onlyvariations:Array<String>

The list of variations a song has.

Inherited Methods