Repository navigation
Lua Script API: Variables
Meme1079 edited this page Sep 11, 2022
·
48 revisions
Note:
Those are the only variables that can be changed by using = true or = false for now, you will have to use setProperty if you want to change the rest of them
-
Function_Stop- Stops the game (Must have return) -
Function_Continue- Continue the game (Must have return) -
luaDebugMode- Enables debug mode, useluaDebugMode = trueto enable it. Default value: false -
luaDeprecatedWarnings- Tells you if a function/variable is deprecated (shouldn't be used anymore), only works when Debug mode is on, useluaDeprecatedWarnings = falseto disable it. Default value:true -
inChartEditor- Tells you if your script is running on Chart Editor's chart playtest. -
version- The version of Psych Engine
-
curBpm- Current BPM of the Song, shortcut togetPropertyFromClass('Conductor', 'bpm') -
bpm- Starting BPM of the Song, shortcut togetProperty('SONG.bpm') -
scrollSpeed- Starting Scroll speed of the Song, shortcut togetProperty('SONG.speed') -
crochet- Interval between Beat hits -
stepCrochet- Interval between Step hits -
songLength- Song duration in milliseconds -
songName- Shortcut togetProperty('SONG.song') -
isStoryMode- Shortcut togetProperty('isStoryMode') -
difficulty- Returns the difficulty ID (Easy = 0, Normal = 1, Hard = 2), Shortcut togetProperty('storyDifficulty') -
difficultyName- Returns the difficulty Name -
weekRaw- Returns the raw current week number. I doubt you will ever use this, but hey, just in case you do, it's here. -
week- Returns the properly formatted current week file name.
-
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)
-
startedCountdown- Tells you if the countdown already started -
skipCountdown- Skips the countdown -
seenCutscene- Is set totrueafteronCreate()function, Shortcut togetProperty('seenCutscene') -
curStep- Current step number (Must be inonStepHit()) -
curDecStep- Current decimal step number (Must be inonStepHit()) -
curBeat- Current beat number (Must be inonBeatHit()) -
curDecBeat- Current decimal beat number (Must be inonBeatHit()) -
curSection- Current section number (Must be inonSectionHit()) -
score- Current score, Shortcut togetProperty('songScore') -
misses- Current total number of notes missed, Shortcut togetProperty('songMisses') -
ghostMisses- Current number of Key press misses, Shortcut togetProperty('ghostMisses') -
hits- Current number of notes hit. Shortcut togetProperty('songHits') -
rating- Current rating percentage, goes from0to1. Shortcut togetProperty('ratingPercent') -
ratingName- Current rating's name. Shortcut togetProperty('ratingString') -
ratingFC- Current rating's combo. Shortcut togetProperty('ratingFC') -
mustHitSection- Tells if the current section is aMust Hit Section(from Chart Editor) -
altAnim- Tells if the current section is aAlt Animation Section(from Chart Editor) -
gfSection- Tells if the current section is aGF Section(from Chart Editor) -
inGameOver- When the Player is Dead -
botPlay- Tells if Botplay is enabled. Shortcut togetProperty('cpuControlled') -
canMiss- Turns off ghost tapping
-
defaultPlayerStrumX0- Player's default left arrow X -
defaultPlayerStrumY0- Player's default left arrow Y -
defaultPlayerStrumX1- Player's default down arrow X -
defaultPlayerStrumY1- Player's default down arrow Y -
defaultPlayerStrumX2- Player's default up arrow X -
defaultPlayerStrumY2- Player's default up arrow Y -
defaultPlayerStrumX3- Player's default right arrow X -
defaultPlayerStrumY3- Player's default right arrow Y -
defaultOpponentStrumX0- Opponent's default left arrow X -
defaultOpponentStrumY0- Opponent's default left arrow Y -
defaultOpponentStrumX1- Opponent's default down arrow X -
defaultOpponentStrumY1- Opponent's default down arrow Y -
defaultOpponentStrumX2- Opponent's default up arrow X -
defaultOpponentStrumY2- Opponent's default up arrow Y -
defaultOpponentStrumX3- Opponent's default right arrow X -
defaultOpponentStrumY3- Opponent's default right arrow Y
-
defaultBoyfriendX- Player's Default X position, defined by the Stage's JSON file. -
defaultBoyfriendY- Player's Default Y position, defined by the Stage's JSON file. -
defaultOpponentX- Opponent's Default X position, defined by the Stage's JSON file. -
defaultOpponentY- Opponent's Default Y position, defined by the Stage's JSON file. -
defaultGirlfriendX- Girlfriend's Default X position, defined by the Stage's JSON file. -
defaultGirlfriendY- Girlfriend's Default Y position, defined by the Stage's JSON file.
Note: All the shortcuts on Preferences Variables are getPropertyFromClass('ClientPrefs', 'Preferences Variable')
Example: getPropertyFromClass('ClientPrefs', 'downscroll')
-
downscroll- Sets the Player notes to down -
middlescroll- Sets the Player notes to the centerfield -
opponentStrums- TheopponentStrumsvisibility -
framerate- The current framerate limit -
ghostTapping- Ghost tapping is enabled -
hideHud- Hides the health, score, icons -
hideTime- Hides the time bar -
cameraZoomOnBeat- Every Section it does a Zoom -
flashingLights- Use for people you have epilepsy (Recommended to disable it, if you have one!) -
noteOffset- Represents the note delay in milliseconds (Goes from0to500) -
lowQuality- Enable's low quality which reduced sprites -
noResetButton- Disable the reset button -
healthBarAlpha- The Opacity of the health bar -
scoreZoom- When you hit a note it does a zoom onscoreTxt -
shadersEnabled- Enables the shader!
Note: if you're using these use it in setPropertyFromGroup() or getPropertyFromGroup()
Example: setPropertyFromGroup('unspawnNotes', i, 'noAnimation', true)
-
noAnimation- If you hit a note, will not play an animation (Boolean) -
noMissAnimation- If you miss a note, will not play an animation (Boolean) -
hitCausesMiss- If you hit a note, will cause to miss (Boolean) -
texture- The texture of the note skin (String) -
noteSplashTexture- The texture of the note splash (String) -
noteSplashDisabled- Disables the note splashes (Boolean) -
hitsoundDisabled- Disables the hitsounds (Boolean) -
ratingDisabled- Disables the ratings (Boolean) -
noteSplashHue- HUE of the note splash (Float) -
noteSplashSat- Saturation of the note splash (Float) -
noteSplashBrt- Brightness of the note splash (Float) -
hitHealth- If you hit a note, it will add a health and you can customize it! (Float) -
missHealth- If you miss a note, it will add a health and you can customize it! (Float) -
noteType- A custom note type (String) -
ignoreNote- If botplay is on then it will not hit the note (Boolean)
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