Psych Engine - PlayState Functions
Psych Engine Logo
Psych Engine - Lua Script API

PlayState Functions

General functions related to the Game State, Song and Cutscenes.


startCountdown

Usage: startCountdown()

Starts the countdown, should be used after finishing your Pre-Song Cutscene.


endSong

Usage: endSong()

Ends the song, can be cancelled through the Lua/HScript callback "onEndSong" to make cutscenes.


getSongPosition

Usage: getSongPosition()

Returns the current song position, in milliseconds.


restartSong

restartSong(?skipTransition:Bool = false):Void

Restarts the Song, pretty self explanatory.


exitSong

exitSong(?skipTransition:Bool = false):Void

Quits the Song and goes back to Freeplay/Story Mode based on where you started.


loadSong

loadSong(?name:String = null, ?difficultyNum:Int = -1):Void

Loads the chart for a song.


triggerEvent

triggerEvent(name:String, ?value1:String = '', ?value2:String = ''):Bool

Calls an event and uses two arguments for it, exactly like the Chart Editor does.
Should always return "true".

Examples:


setHealthBarColors

setHealthBarColors(left:String, right:String):Void

Changes Health Bar colors.

Examples:


setTimeBarColors

setTimeBarColors(left:String, right:String):Void

Changes Time Bar colors.

Examples:


startDialogue

startDialogue(dialogueFile:String, ?music:String):Void

Loads a Dialogue .JSON inside the Chart folder, handles translation loading automatically.

Examples:


startVideo

startVideo(videoFile:String, ?canSkip:Bool = true):Void

Plays a Video Cutscene.

Examples: