Shadow Engine - PlayState Functions
Shadow Engine Logo
Shadow 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, ?forMidSong:Bool = false, ?shouldLoop:Bool = false, ?playOnLoad:Bool = true):Void

Plays a Video Cutscene.

Examples:

setCameraScroll

setCameraScroll(x:Float, y:Float):Void

Set the Game Camera's current scroll position.

Examples:


setCameraFollowPoint

setCameraFollowPoint(x:Float, y:Float):Void

Set the Game Camera's follow point position.

Examples:


addCameraScroll

addCameraScroll(?x:Float = 0, ?y:Float = 0):Void

Adds X/Y to the Game Camera's current scroll position.
All values are optional and defaults to zero.

Examples:


addCameraFollowPoint

addCameraFollowPoint(?x:Float = 0, ?y:Float = 0):Void

Adds X/Y to the Game Camera's follow point position.
All values are optional and defaults to zero.

Examples:


getCameraScrollX

Usage: getCameraScrollX()

Returns Game Camera's current scroll X, float value.


getCameraScrollY

Usage: getCameraScrollY()

Returns Game Camera's current scroll Y, float value.


getCameraFollowX

Usage: getCameraFollowX()

Returns Game Camera's follow point X, float value.


getCameraFollowY

Usage: getCameraFollowY()

Returns Game Camera's follow point Y, float value.


cameraSetTarget

cameraSetTarget(character:String):Void

Changes the Follow Point to target a character.

Examples: