-
Notifications
You must be signed in to change notification settings - Fork 7
Lua Script API: General Functions
Makes character do the idle dance.
-
character
- The name of the character to be used, can beboyfriend
,dad
orgf
.
Sets the current x position value of a character to a new value. This will also move all precached characters from the same type into the position you want.
-
type
- The character name to be used, can beboyfriend
,dad
orgf
. -
value
- The new x value of the character position.
Sets the current y position value of a character to a new value. This will also move all precached characters from the same type into the position you want.
-
type
- The character name to be used, can beboyfriend
,dad
orgf
. -
value
- The new y value of the character position.
Gets the current x position value of a character.
-
type
- The character name to be used, can beboyfriend
,dad
orgf
.
Gets the current y position value of a character.
-
type
- The character name to be used, can beboyfriend
,dad
orgf
.
Adds the value
parameter to the current song score total and recalculates the rating.
Adds the value
parameter to the current song miss total and recalculates the rating.
Adds the value
parameter to the current song hit total and recalculates the rating.
Adds the value
parameter to the current song health total and recalculates the rating.
Sets the value
parameter of the current song score total with a new value and recalculates the rating.
Sets the value
parameter of the current song miss total with a new value and recalculates the rating.
Sets the value
parameter of the current song hit total with a new value and recalculates the rating.
Sets the value
parameter of the current song health total with a new value and recalculates the rating.
Sets the current rating percent to a new value, in case you want to do your own rating calculation.
-
value
- The new accuracy rating percent, Goes from0
to1
.
Sets the current rating name to a new value, in case you want to do your own rating calculation.
-
value
- The new rating string name.
Sets the current rating combo name to a new value.
-
value
- The new rating combo name.
Gets the current songs score total current value.
Gets the current songs miss total current value.
Gets the current songs hit total current value.
Gets the current songs health total current value.
Checks if the current lua sprite object exists in the currently playing song.
-
tag
- The tag of the lua sprite object.
Checks if the current lua text object exists in the currently playing song.
-
tag
- The tag of the lua text object.
Checks if the current lua sound object exists in the currently playing song.
-
tag
- The tag of the lua sound object.
Checks the starting section of the String variable.
-
str
- The string variable to be used. -
start
- The starting section.
Checks the ending section of the String variable.
-
str
- The string variable to be used. -
end
- The ending section.
Note: After splitting a String it will act like a Table; example shown below for reference.
Will split the String variable into multiple Strings.
-
str
- The string to be split. -
start
- The separation of the string.
Example: stringSplit('Split, This, LOL!', ', ')[1]
This will print 'Split'.
Will remove any unnecessary large spaces from the String variable.
-
str
- The string to be trimmed.
This will randomize a Int number. (Better than math.random()
ngl)
-
min
- The lowest value. -
max
- The highest value.
This will randomize a Float number.
-
min
- The lowest value. -
max
- The highest value.
This will randomize the chance of it being true
.
-
chance
- The possibility of it beingtrue
.
Gets the text contents inside of the txt
file.
-
path
- The path file to thetxt
file.
Gets the file folders inside of a folder
-
folder
- The path to the file folder.
Checks if the file existed or not.
-
filename
- The path of the file to be checked if it exists. -
absolute
- An optional parameter, It will be ignore by the mod folder directory, causing it to be outside the mod folder.
Changes the current file contents and then saves it.
-
path
- The path of the file to be changed. -
content
- The file contents to be changed or modified, use double brackets[[]]
. -
absolute
- An optional parameter, It will be ignore by the mod folder directory, causing it to be outside the mod folder.
Deletes the current file.
-
path
- The path of the file to be deleted.
Note: This function is required when using
setDataFromSave()
andgetDataFromSave()
functions.
Loads the current save date from the file but if there is no save data found it will be created. Variables values are saved in this function.
-
name
- The name of the save data to be used. -
folder
- An optional parameter, The folder to be loaded or be created.
Deletes the save data.
-
name
- The name of the save data to be used.
Sets the current variable from the save data from the file.
-
name
- The name of the save data to be used. -
field
- The current variable to be used. -
value
- The new value to be set.
Gets the current variable from the save data from the file.
-
name
- The name of the save data to be used. -
field
- The current variable to be used.
Checks if any lua file are currently running in game.
-
luaFile
- The path of the lua file to be used.
Example: isRunning('mods/pathTotheFile/luafile.lua')
Checks if any multiple lua file are currently running in game.
Adds a lua script in the game.
-
path
- The path of the lua file that you are getting. -
ignoreAlreadyRunning
- An optional parameter, It will run again while ignoring the lua file that is currently running.
Removes a lua script in the game.
-
path
- The path of the lua file that you are getting.
Adds a haxe library variable into the interpreter.
-
libName
- The haxe library to be used. -
libPackage
- An optional parameter, the haxe library package to be used.
Example: addHaxeLibrary('FlxTween', 'flixel.tweens')
Runs haxe script inside of the lua file.
-
codeToRun
- The code to be run, use double brackets[[]]
.
Opens your custom substate.
-
name
- The name of the custom substate to be used. -
pauseGame
- An optional parameter, will pause your game after the custom substate has been opened.
Closes any custom substate.
Warning: This section of the wiki has broken functions meaning they wont work as intended.
Sets the current Global variable with a new value from another lua script. If you're getting a Local variable it will not work as you intened.
-
luaFile
- The path of the lua file that you are getting. -
global
- The variable to be set. -
val
- The new value to be set.
Gets the current Global variable current value from another lua script. If you're getting a Local variable it will not work as you intened.
-
luaFile
- The path of the lua file that you are getting. -
global
- The variable to be used.
Makes the camera focus on the target.
-
target
- The character type to target, can be eitherboyfriend
ordad
.
Makes the camera shake.
-
camera
- The camera state to be set in, Can be eithercamGame
,camHUD
orcamOther
. -
intensity
- How much intesity will the camera shake, recommended value is0.05
. -
duration
- How long will the camera shake last.
Makes the camera flash.
-
camera
- The camera state to be set in, Can be eithercamGame
,camHUD
orcamOther
. -
color
- The hexadecimal color of the flash. -
duration
- How long will the camera flash last. -
forced
- If set totrue
, then the flash will be reset.
Makes the camera fade.
-
camera
- The camera state to be set in, Can be eithercamGame
,camHUD
orcamOther
. -
color
- The hexadecimal color of the fade. -
duration
- How long will the camera fade last. -
forced
- If set totrue
, then the fade will be reset.
This will display a debug message in the top-left corner of the screen. All of the parameters are optional execept text1
parameter. The purpose of the function is to check the current value of the object or variable.
Example: debugPrint("Current boyfriend character: ", getProperty('boyfriend.curCharacter')
This will get the current bf character with the getProperty()
function and will print Current boyfriend character: 'bf'
.
Warning: You must use this inside of a
Stage script
, since it will not be used anywhere.
Stops your script in the next 100 milliseconds.
Triggers an event without having to insert the event into the chart editor.
-
name
- The name of the event in the Chart editor. -
arg1
- The value on Value 1. -
arg2
- The value on Value 2.
Changes the health bar colors.
-
leftHex
- The opponent hexadecimal color of the health bar. -
rightHex
- The player hexadecimal color of the health bar.
Changes the time bar colors.
-
leftHex
- The hexadecimal color of the time bar. -
rightHex
- The background hexadecimal color of the time bar.
Gets the specific color from the Hexadecimal color. Expecially when setting/getting a specific color, really useful to be honest.
-
color
- The hexadecimal color to be used.
Example: If you want to get the color orange use getColorFromHex('FF7800')
or getColorFromHex('0xFFFF7800')
.
Returns the current song position, Shortcut to getPropertyClass('Conductor', 'songPosition')
.
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