Repository navigation
Lua Script API: Variables
Meme1079 edited this page Apr 21, 2023
·
48 revisions
Note: These are the only variables can be change by using
= trueor= falsefor now. You will have to usesetProperty()function if you want to change the rest of them.
-
Function_Continue- Continues the game; Returns0. -
Function_StopLua- Stops the game; Returns1. -
Function_Stop- Stops the Lua script; Returns2. -
luaDebugMode- Enables debug mode; default value:false. -
luaDeprecatedWarnings- Checks if the function or variable is deprecated or not; Only works in debug mode. -
inChartEditor- Checks if the Lua script is running inside the Chart Editor's chart playtest.
-
curStage- Checks the current stage name from the JSON file name. -
curBpm- Returns the starting BPM value of the song. -
bpm- Checks the current BPM value of the song. -
crochet- Checks the interval betweencurBeatvariable. -
stepCrochet- Checks the interval betweencurStepvariable. -
songLength- Checks the current song length displayed in milliseconds. -
songName- Checks the current song name. -
scrollSpeed- Checks the scroll speed of the song. -
isStoryMode- Checks if the song is in story mode or not. -
difficulty- Returns the difficulty ID number. -
difficultyName- Returns the difficulty name. -
weekRaw- Returns the raw current week number. -
week- Returns the current week name from the JSON file name. -
currentModDirectory- Returns the current mod directory.
All Shortcuted to:
-
curStage-getPropertyFromClass('PlayState', 'SONG.stage') -
curBpm-getPropertyFromClass('Conductor', 'bpm') -
bpm-getProperty('SONG.bpm') -
crochet-getPropertyFromClass('Conductor', 'crochet') -
stepCrochet-getPropertyFromClass('Conductor', 'stepCrochet') -
songLength-getProperty('songLength') -
songName-getProperty('songLength') -
scrollSpeed-getProperty('SONG.speed') -
isStoryMode-getProperty('isStoryMode') -
difficulty-getPropertyFromClass('PlayState', 'storyDifficulty') -
difficultyName-getPropertyFromClass('CoolUtil', 'difficulties['..difficulty..']') -
weekRaw-getPropertyFromClass('PlayState', 'storyWeek') -
week-getPropertyFromClass('WeekData', 'weeksList['..weekRaw..']') -
currentModDirectory-getPropertyFromClass('Paths', 'currentModDirectory')
-
curStep- The current step per number. -
curBeat- The current beat per number. -
curSection- The current section per number. -
curDecStep- The current decimal step per number. -
curDecBeat- The current decimal beat per 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 song score rating percent; Goes from0to1. -
ratingName- The current song score rating name. -
ratingFC- The current song score rating combo. -
healthGainMult- The current health gain when hitting a note. -
healthLossMult- The current health loss when missing a note. -
instakillOnMiss- If you miss you get insta-killed. -
playbackRate- The current play-back rate of the song. -
startedCountdown- Checks if the countdown has already begun. -
seenCutscene- Checks if the cutscene is seen. -
botPlay- Checks if botplay is enable or not. -
practice- Checks if practice is enable or not. -
version- Checks the current version of Psych Engine. -
inGameOver- Checks if the player is in game-over screen or not. -
mustHitSection- Checks if the section is inMust Hit Sectionfrom the Chart Editor. -
altAnim- Checks if the section is inAlt Animation Sectionfrom the Chart Editor. -
gfSection- Checks if the section is inGF Sectionfrom theChart Editor. -
scriptName- Returns the location of the Lua script. -
buildTarget- Returns the build target of Psych Engine; Example:windows,mac, etc.
All Shortcuted to:
-
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') -
instakillOnMiss-getProperty('instakillOnMiss') -
playbackRate-getProperty('playbackRate') -
startedCountdown-getPropertyFromClass('PlayState', 'seenCutscene')) -
seenCutscene-getProperty('startedCountdown') -
botPlay-getProperty('cpuControlled') -
practice-getProperty('practiceMode') -
version-getPropertyFromClass('MainMenuState', 'psychEngineVersion')
-
downscroll- Checks if downscoll is enabled or not. -
middlescroll- Checks if middlescrrol is enabled or not. -
opponentStrums- Checks the opponent strums visibility. -
framerate- Checks the current framerate on the game. -
ghostTapping- Checks if ghost tapping is enabled or not. -
hideHud- Checks if the score bar/health bar elements are hidden or not -
hideTime- Checks if the time bar elements are hidden or not. -
timeBarType- Checks the time bar display type. -
cameraZoomOnBeat- Checks if the camera does a zoom on beat hit. -
scoreZoom- Checks if the score is being zoom when hitting a note. -
flashingLights- Enables flashing lights on a song(s). (Disable it, if you have epilepsy!) -
shadersEnabled- Enable shaders or not. (Disable it, if you have motion sickness!) -
lowQuality- Enables low quality on a song(s). (Disable it, if you have a potato computer) -
noResetButton- Enables the reset button. -
noteOffset- Checks the note offset displayed in milliseconds, Goes from0to500. -
healthBarAlpha- Checks the current alpha/opacity of the health bar.
All Shortcuted 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') -
scoreZoom-getPropertyFromClass('ClientPrefs', 'scoreZoom') -
flashingLights-getPropertyFromClass('ClientPrefs', 'flashing') -
shadersEnabled-getPropertyFromClass('ClientPrefs', 'shaders') -
lowQuality-getPropertyFromClass('ClientPrefs', 'lowQuality') -
noResetButton-getPropertyFromClass('ClientPrefs', 'noReset') -
noteOffset-getPropertyFromClass('ClientPrefs', 'noteOffset') -
healthBarAlpha-getPropertyFromClass('ClientPrefs', 'healthBarAlpha')
-
cameraX- Returns the current x position of camera. -
cameraY- Returns the current y position of camera. -
screenWidth- Returns the current width of the window screen; default value:720. -
screenHeight- Returns the current width of the window screen; default value:1280. -
boyfriendName- Checks the current boyfriend character. -
dadName- Checks the current dad character. -
gfName- Checks the current girlfriend character.
All Shortcuted to:
-
cameraX-getProperty('camFollowPos.x') -
cameraY-getProperty('camFollowPos.y') -
screenWidth-getPropertyFromClass('FlxG', 'width') -
screenHeight-getPropertyFromClass('FlxG', 'heigth') -
boyfriendName-getProperty('SONG.player1') -
dadName-getProperty('SONG.player2') -
gfName-getProperty('SONG.gfVersion')
-
defaultPlayerStrumX0- The player's left arrow default x position value. -
defaultPlayerStrumX1- The player's down arrow default x position value. -
defaultPlayerStrumX2- The player's up arrow default x position value. -
defaultPlayerStrumX3- The player's right arrow default x position value. -
defaultPlayerStrumY0- The player's left arrow default y position value. -
defaultPlayerStrumY1- The player's down arrow default y position value. -
defaultPlayerStrumY2- The player's up arrow default y position value. -
defaultPlayerStrumY3- The player's right arrow default y position value.
-
defaultOpponentStrumX0- The opponent's left arrow default x position value. -
defaultOpponentStrumX1- The opponent's down arrow default x position value. -
defaultOpponentStrumX2- The opponent's up arrow default x position value. -
defaultOpponentStrumX3- The opponent's right arrow default x position value. -
defaultOpponentStrumY0- The opponent's left arrow default y position value. -
defaultOpponentStrumY1- The opponent's down arrow default y position value. -
defaultOpponentStrumY2- The opponent's up arrow default y position value. -
defaultOpponentStrumY3- The opponent's right arrow default y position value.
All Shortcuted to:
-
defaultPlayerStrumX0-getPropertyFromGroup('playerStrums.members', 0, 'x') -
defaultPlayerStrumX1-getPropertyFromGroup('playerStrums.members', 1, 'x') -
defaultPlayerStrumX2-getPropertyFromGroup('playerStrums.members', 2, 'x') -
defaultPlayerStrumX3-getPropertyFromGroup('playerStrums.members', 3, 'x') -
defaultPlayerStrumY0-getPropertyFromGroup('playerStrums.members', 0, 'y') -
defaultPlayerStrumY1-getPropertyFromGroup('playerStrums.members', 1, 'y') -
defaultPlayerStrumY2-getPropertyFromGroup('playerStrums.members', 2, 'y') -
defaultPlayerStrumY3-getPropertyFromGroup('playerStrums.members', 3, 'y')
-
defaultOpponentStrumX0-getPropertyFromGroup('opponentStrums.members', 0, 'x') -
defaultOpponentStrumX1-getPropertyFromGroup('opponentStrums.members', 1, 'x') -
defaultOpponentStrumX2-getPropertyFromGroup('opponentStrums.members', 2, 'x') -
defaultOpponentStrumX3-getPropertyFromGroup('opponentStrums.members', 3, 'x') -
defaultOpponentStrumY0-getPropertyFromGroup('opponentStrums.members', 0, 'y') -
defaultOpponentStrumY1-getPropertyFromGroup('opponentStrums.members', 1, 'y') -
defaultOpponentStrumY2-getPropertyFromGroup('opponentStrums.members', 2, 'y') -
defaultOpponentStrumY3-getPropertyFromGroup('opponentStrums.members', 3, 'y')
-
defaultBoyfriendX- The player's default x position, defined by the stages JSON file. -
defaultBoyfriendY- The player's default y position, defined by the stages JSON file. -
defaultOpponentX- The opponent's default x position, defined by the stages JSON file. -
defaultOpponentY- The opponent's default y position, defined by the stages JSON file. -
defaultGirlfriendX- The girlfriend's default x position, defined by the stages JSON file. -
defaultGirlfriendY- The girlfriend's default x position, defined by the stages JSON file.
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