This second release focuses on including new features that make it stand apart from Psych 0.6.3:
- Lua Scripting:
- Added the ability of creating custom states (or replacing existing ones) by using Lua scripts. These will be read from the folder
mods/your-mod/states/
. - Added the option to submit Lua functions as an additional parameter to
doTween%()
, so they're called when the transition ends. - Added a global
xt_version
with the version of Psych-XT, visible to any Lua script. - Added Lua functions
folderExists()
,fileExists()
,readFile()
andreadLines()
for locating and reading mod assets. - Added Lua functions
writeFile()
,makeFolder()
,removeFile()
andremoveFolder()
for manipulating files inside the active modpack. - Added Lua functions
getSongData()
andgetWeekData()
for reading song and week info, useful in Story Mode and Free Play menus. - Added Lua functions
startStoryMode()
andstartFreeplay()
for starting regular FNF games, needed for Story Mode and Free Play menus. - Added Lua functions
getSongScore()
,getSongRating()
,getWeekScore()
,resetSongScore()
andresetWeekScore()
to retrieve/reset high scores from, useful in Story Mode and Free Play menus. - Added Lua functions
getClientPreference()
,setClientPreference()
,saveClientPreferences()
andloadClientPreferences()
for reading, updating and saving user settings from within Lua states.
- Added the ability of creating custom states (or replacing existing ones) by using Lua scripts. These will be read from the folder
- Internal Changes:
- Locked dependency versions due to some bugs and compatibility issues reported in newer releases.
- Added
MusicBeatState
typeScriptedState
, for states like menu pages built entirely using a script. - Extracted some fields and methods from
PlayState
intoMusicBeatState
, in order to share them withScriptedState
. - Added class
StateLua
, representing the Lua script used in a scripted state. - Extracted most fields and callbacks from
FunkinLua
into a helper classLuaUtils
, for them to be shared withStateLua
. - Reorganized Lua callbacks in functions according to their topic.
- Exported
CustomSubstate
,DebugLuaText
,ModchartSprite
,ModchartText
andModchartTimer
as public classes, available fromscripting
package. - Added state-related resource loading functions (folder
mods/<modname>/states
) intoPaths
. MusicBeatState
now accepts text tags too as indication of what state to load next. This can be used in order to load scripted states in place of some of the existing ones, or to load custom states defined in the active mod.- Added
DynamicAccesor
andDynamicAccess
in order to simplify access to internal objects and arrays from Lua scripts. - Now the states that are able to change the active mod (story mode, free play, setings, etc.) will remember the mod folder they were called from, returning control to it when the user goes back to the previous menu without doing changes through them.
- Now modchart texts can be placed in the camera of your choice on creating, instead of being bound to
camOther
.
With these changes, the core concept of making custom states using Lua scripts is now functional. At the time of this update, one mod has been released that leverages the new capabilities of the modded engine: Universo Style.
Future updates will aim to reduce the limitations of these new scripted states, polish any rough edges, and add more features that may complement these tools well.