Repository navigation
Lua Script API: Variables
Meme1079 edited this page Mar 2, 2023
·
48 revisions
Note: These function can be change by using
= trueor= falsefor now, you will have to usesetProperty()function for now.
-
Function_Continue- Continues the game; Returns0. -
Function_Stop- Stops the game; Returns1. -
Function_StopLua- Stops the Lua scripts being runned; Returns2. -
luaDebugMode- Enables Debug mode. -
luaDeprecatedWarnings- Checks if the function or variable is deprecated or not. This only works in Debug mode. -
inChartEditor- Checks if the Lua script is running inside the Chart Editor's chart playtest.
-
curStage- The current stage of the song. -
curBpm- The current BPM of the song. -
bpm- The starting BPM of the song. -
scrollSpeed- The starting scroll speed of the song. -
crochet- The interval between Beat hits. -
stepCrochet- The interval between Step hits. -
songLength- The song duration in milliseconds. -
songName- The current song name of the song. -
isStoryMode- Checks if the song is in story mode. -
difficulty- Returns the difficulty ID number. -
difficultyName- Returns the difficulty name to be chosen. -
weekRaw- Returns the raw current week number. (I am 99% doubt you will ever use this ever in your life) -
week- Returns the properly formatted current week file name. -
currentModDirectory- Checks the current mod directory.
All Shortcut to:
-
curStage-getPropertyFromClass('PlayState', 'SONG.stage') -
curBpm-getPropertyFromClass('Conductor', 'bpm') -
bpm-getProperty('SONG.bpm') -
scrollSpeed-getProperty('SONG.speed') -
crochet-getPropertyFromClass('Conductor', 'crochet') -
stepCrochet-getPropertyFromClass('Conductor', 'stepCrochet') -
songLength-getProperty('songLength') -
songName-getProperty('SONG.song') -
isStoryMode-getProperty('isStoryMode') -
difficulty-getPropertyFromClass('PlayState', 'storyDifficulty') -
difficultyName-getPropertyFromClass('CoolUtil', 'difficulties['..difficulty..']') -
weekRaw-getPropertyFromClass('PlayState', 'storyWeek') -
week-getPropertyFromClass('WeekData', 'weeksList['..getProperty('storyWeek')..']') -
currentModDirectory-getPropertyFromClass('Paths', 'currentModDirectory')
-
startedCountdown- Indicates whether the countdown has already begun. -
seenCutscene- Checks if the cutscene is seen. -
curStep- The current step number. -
curBeat- The current beat number. -
curSection- The current section number. -
curDecBeat- The current decimal beat number. -
curDecStep- The current decimal step number. -
score- The current song score. -
hits- The current note hits. -
misses- The current song misses. -
ghostMisses- The current song ghost misses. -
rating- The current rating percentage; Goes from0to1. -
ratingName- The current rating name. -
ratingFC- The current rating combo. -
inGameOver- Tells if the player is inside the game-over screen. -
mustHitSection- Tells if the current section is aMust Hit Sectionfrom the Chart Editor. -
altAnim- Tells if the current section is aAlt Animation Sectionfrom the Chart Editor. -
gfSection- Tells if the current section is aGF Sectionfrom theChart Editor. -
healthGainMult- The current health gain when hitting a note. -
healthLossMult- The current health loss when missing a note. -
playbackRate- The current playback rate on the song. -
instakillOnMiss- If you missed a note you die. -
botPlay- Checks if botplay is enabled. -
practice- Checks if practice mode is enabled. -
version- Checks the current version of Psych Engine.
All Shortcut to:
-
startedCountdown-getProperty('startedCountdown') -
seenCutscene-getPropertyFromClass('PlayState', 'seenCutscene')) -
curStep-getProperty('curStep') -
curBeat-getProperty('curBeat') -
curSection-getProperty('curSection') -
curDecStep-getProperty('curDecStep') -
curDecBeat-getProperty('curDecBeat') -
score-getProperty('songScore') -
hits-getProperty('songHits') -
misses-getProperty('songMisses') -
ghostMisses-getProperty('ghostMisses') -
rating-getProperty('ratingPercent') -
ratingName-getProperty('ratingString') -
ratingFC-getProperty('ratingFC') -
healthGainMult-getProperty('healthGainMult') -
healthLossMult-getProperty('healthLossMult') -
playbackRate-getProperty('playbackRate') -
instakillOnMiss-getProperty('instakillOnMiss') -
botPlay-getProperty('cpuControlled') -
practice-getProperty('practiceMode') -
version-getPropertyFromClass('MainMenuState', 'psychEngineVersion')
-
downscroll- Checks if downscoll is enabled. -
middlescroll- Checks if middlescrrol is enabled. -
opponentStrums- Checks the opponents strums visibility. -
framerate- Checks the current framerate on the game. -
ghostTapping- Checks if ghost tapping is enabled. -
hideHud- Checks if the accuracy bar, icons, and health bar are hidden. -
hideTime- Checks if the time bar is hidden. -
timeBarType- Checks the time bar displayed. -
cameraZoomOnBeat- Checks the camera zoom on beat. -
flashingLights- Checks if the song has flashing lights. (Recommended to disable it, if you have epilepsy!) -
lowQuality- Checks if the song is low quality. (Recommended to enable it, if you have a potato computer) -
noteOffset- Checks the note offset in milliseconds, Goes from0to500. -
noResetButton- Checks if the reset button is activated. -
healthBarAlpha- Checks the alpha/opacity of the health bar. -
scoreZoom- Checks if the score is being zoom when hitting a note. -
shadersEnabled- Checks if the shaders is enabled. (Recommended to disable it, if you have motion sickness!) -
scriptName- Checks the script name that is running in game. -
buildTarget- Checks the build target of Psych Engine.
All Shortcut to:
-
downscroll-getPropertyFromClass('ClientPrefs', 'downscroll') -
middlescroll-getPropertyFromClass('ClientPrefs', 'middlescroll') -
opponentStrums-getPropertyFromClass('ClientPrefs', 'opponentStrums') -
framerate-getPropertyFromClass('ClientPrefs', 'framerate') -
ghostTapping-getPropertyFromClass('ClientPrefs', 'ghostTapping') -
hideHud-getPropertyFromClass('ClientPrefs', 'hideHud') -
hideTime-getPropertyFromClass('ClientPrefs', 'hideTime') -
timeBarType-getPropertyFromClass('ClientPrefs', 'timeBarType') -
cameraZoomOnBeat-getPropertyFromClass('ClientPrefs', 'cameraZooms') -
flashingLights-getPropertyFromClass('ClientPrefs', 'flashing') -
noteOffset-getPropertyFromClass('ClientPrefs', 'noteOffset') -
noResetButton-getPropertyFromClass('ClientPrefs', 'noReset') -
healthBarAlpha-getPropertyFromClass('ClientPrefs', 'healthBarAlpha') -
scoreZoom-getPropertyFromClass('ClientPrefs', 'scoreZoom') -
noteOffset-getPropertyFromClass('ClientPrefs', 'noteOffset') -
shadersEnabled-getPropertyFromClass('ClientPrefs', 'shaders')
-
cameraX- The current x position of camera, Shortcut togetProperty('camFollowPos.s'). -
cameraY- The current y position of camera, Shortcut togetProperty('camFollowPos.y'). -
screenWidth- The current width of the window, Shortcut togetPropertyFromClass('FlxG', width). -
screenHeight- The current height of the window, Shortcut togetPropertyFromClass('FlxG', heigth). -
boyfriendName- The name of the boyfriend character, Shortcut togetProperty('SONG.player1'). -
dadName- The name of the dad character, Shortcut togetProperty('SONG.player2'). -
gfName- The name of the girlfriend character, Shortcut togetProperty('SONG.gfVersion').
-
defaultPlayerStrumX0- Players default left arrow X. -
defaultPlayerStrumX1- Players default down arrow X. -
defaultPlayerStrumX2- Players default up arrow X. -
defaultPlayerStrumX3- Players default right arrow X. -
defaultPlayerStrumY0- Players default left arrow Y. -
defaultPlayerStrumY1- Players default down arrow Y. -
defaultPlayerStrumY2- Players default up arrow Y. -
defaultPlayerStrumY3- Players default right arrow Y. -
defaultOpponentStrumX0- Opponents default left arrow X. -
defaultOpponentStrumX1- Opponents default down arrow X. -
defaultOpponentStrumX2- Opponents default up arrow X. -
defaultOpponentStrumX3- Opponents default right arrow X. -
defaultOpponentStrumY0- Opponents default left arrow Y. -
defaultOpponentStrumY1- Opponents default down arrow Y. -
defaultOpponentStrumY2- Opponents default up arrow Y. -
defaultOpponentStrumY3- Opponents default right arrow Y.
-
defaultBoyfriendX- Players default X position, defined by the stagesjsonfile. -
defaultBoyfriendY- Players default Y position, defined by the stagesjsonfile. -
defaultOpponentX- Opponents default X position, defined by the stagesjsonfile. -
defaultOpponentY- Opponents default Y position, defined by the stagesjsonfile. -
defaultGirlfriendX- Girlfriends default X position, defined by the stagesjsonfile. -
defaultGirlfriendY- Girlfriends default Y position, defined by the stagesjsonfile.
Is the page in some way inaccurate? an error, a typo, or outdated data? To report it, use the "Issue Tab". Or do you wish to include a new function or add new information? use the "Pull Request Tab". Help is always appreciated!
- Event Callbacks
- Custom Sprite
- Custom Text
- Object Functions
- General Functions
- Scripting & File Functions
- Game Input Control Functions
- Language Translation
- HScript Functions
- Custom Substates
- Custom Shaders
- Deprecated & Removed Functions
- Sound & Music Functions
- Tweens & Timers Functions
- Reflection Functions
- Variables