New Lua Functions - Dsfan2/PsychEngineDS GitHub Wiki
Most of the Lua script functions in Psych Engine DS are from Base Psych Engine. Refer to the official Psych Engine Lua Guide for for information. https://github.com/ShadowMario/FNF-PsychEngine/wiki/Lua-Script-API This page will mostly cover the newly added lua functions and variables exclusive to Psych Engine DS
New Variables
- canDodge - If the dodging mechanic is enabled on a song.
- inResults - Song is finished while in Freeplay & Results Screen setting is enabled.
- playerChar - The number of the player character you're playing as.
- songBlurb - If the song blurb setting is enabled.
- freeplayCutscenes - If the option to play Story Mode cutscenes in Freeplay is enabled.
- resultsScreen - If the results screen setting is enabled.
- instaKillNotes - If the instakill hurt notes setting is enabled.
- dsFilter - If the DS Filter is enabled either by the setting or by the song chart.
- dsBorderType - The current DS Border skin name
- hudSkin - The name of the current Combo, Countdown, & Rating skin.
- barSkin - The name of the current Health Bar & Time Bar skin.
Lua Backdrop Functions
makeLuaBackdrop(tag:String, image:String)
Creates a repeating backdrop using the tag "tag". Use the "image" tag to specify what the image for the backdrop should be.
addLuaBackdrop(tag:String, front:Bool = false)
Adds a Lua Backdrop with the specified tag, either in front or behind the characters.
removeLuaBackdrop(tag:String, destroy:Bool = true)
Removes a Lua Backdrop with the specified tag.
- tag - The Lua Backdrop's tag
- destroy - Specifies if you don't want to use the backdrop anymore. Default value is true (Set to false if you want to re-add it later)
Lua Video Sprite Functions
makeLuaVideoSprite(tag:String, videoFile:String, start:Bool = true)
Creates a video sprite using the tag "tag". Use the "videoFile" tag to specify what the video is for the video sprite. The tag "start" is whether or not the video sprite will start when it loads in, it's set to true by default. NOTE: The video sprite will start playing immediately after it's created. In order to make it start playing from the begining, use "setVideoSpriteTime()". ANOTHER NOTE: Video Sprites MUST be in 1280x720 otherwise it won't fit as intended!
addLuaVideoSprite(tag:String, front:Bool = false)
Adds a Lua Video Sprite with the specified tag, either in front or behind the characters.
setVideoSpriteTime(tag:String, time:Int = 0)
Sets the time of the video sprite with the specified tag. The time tag determines what time (in seconds) the video starts at, it's set to 0 by default.
removeLuaVideoSprite(tag:String, destroy:Bool = true)
Removes a Lua Video Sprite with the specified tag.
- tag - The Lua Video Sprite's tag
- destroy - Specifies if you don't want to use the video anymore. Default value is true (Set to false if you want to re-add it later)
New Functions
setObjectVelocity(tag:String, velocityX:Int = 0, velocityY:Int = 0)
Set an object's velocity making it drag across the screen.
- tag - The object's tag.
- velocityX - The object's horizontal velocity.
- velocityY - The object's vertical velocity.
luaBackdropExists(tag:String)
Checks if a Lua Backdrop exists whith the specified tag.
luaVideoExists(tag:String)
Checks if a Lua Backdrop exists whith the specified tag.
startDSDialogue(dialogueFile:String, music:String = null)
Starts a dialogue loading a file inside data/your-song-name/.
dialogueFile - .JSON file to load song - Optional value for a Background music during the dialogue Example: If I want to load a dialogue file data/bopeebo/dialogue.json using the pause menu song (Breakfast), I should use: startDSDialogue('dialogue', 'breakfast')
NOTE: When the dialogue is ended, it calls startCountdown() unless a Lua Script intercepts with it.