-
Notifications
You must be signed in to change notification settings - Fork 7
Lua Script API: General Functions
Plays an character animation
-
character
- Can beboyfriend
,dad
orgf
-
anim
- Animation name to be played -
forced
- Can be eithertrue
orfalse
, if set totrue
, it will force the animation to reset if the current animation is the same as the animation to play
Makes character do the idle dance
-
character
- Can beboyfriend
,dad
orgf
Sets the general X position of a character from the type
, this will also move all precached characters from the same type into the position you want
-
type
- Can beboyfriend
,dad
orgf
-
value
- The x-coordinate of the character
Sets the general Y position of a character from the type
, this will also move all precached characters from the same type into the position you want
-
type
- Can beboyfriend
,dad
orgf
-
value
- The y-coordinate of the character
Gets the general X position of a character from the type
-
type
- Can beboyfriend
,dad
orgf
Gets the general Y position of a character from the type
-
type
- Can beboyfriend
,dad
orgf
Get if the key name just got pressed on the current frame.
Keys: left
, down
, up
, right
, accept
, back
, pause
, reset
, space
Get if the key name is being held on the current frame.
Get if the key name was released on the current frame.
Get if the key name just got pressed on the current frame.
-
name
- Any key you want but must be capitalize
Example: keyboardJustPressed('SHIFT')
Get if the key name is being held on the current frame.
Get if the key name was released on the current frame.
Get if the mouse button name just got pressed on the current frame. leave 'name' blank for left mouse
Buttons: left
, right
, middle
Get if the mouse button name is being held on the current frame.
Get if the mouse button name was released on the current frame.
Checks if a sprite exists
-
tag
- The Sprite tag
Checks if a text exists
-
tag
- The Text tag
Checks if a sound exists
-
tag
- The Sound tag
Note: You must add .lua
for it to work
Check if the lua file is running and will return true
if it's running currently
-
luaFile
- The file that you want to detect that is running currently
Example: isRunning('mods/pathTotheFile/luafile.lua')
Checks multiple lua files that are running
Note: You need to add the file format name for it to work
Gets the text from that file
-
path
- The path of the text file that you are getting -
ignoreModFolders
- An optional parmeter that ignores the mod folder with a boolean
Example: getTextFromFile('pathTotheFile/ExampleFile.txt')
Gets the files from the directories
-
folder
- The path to the folder
Adds a lua script
-
path
- Path to LUA relative to the base folder
Removes a lua script
-
path
- Path to LUA relative to the base folder
Adds a library variable into the interpreter
-
libName
- The name of the library name -
libPackage
- The name of the library package
Example: addHaxeLibrary('FlxTween', 'flixel.tweens')
It runs string as a hscript, you must use [[]]
Example: runHaxeCode([[haxe code]])
Note: stringSplit()
and stringTrim()
works in 0.7.0 Version!
Note: If you trying to detect the last word of the string it will not work, same with stringEndsWith()
Detects if the string starts with
-
str
- The string you want -
start
- The start of the string
Detects if the string end with, works the same with stringStartsWith()
Splits a string into mutiple string
-
str
- The string you want -
start
- The speration of the string
Removes any unnecessary large spaces that the string has
-
str
- The string you want
Triggers an event without you having to chart them.
-
name
- Event name on Chart Editor -
arg1
- Value 1 on Chart Editor -
arg2
- Value 2 on Chart Editor
Changes the health colors on the health bar (Must be a Hexadecimal Color)
-
leftHex
- The opponent health bar color -
rightHex
- The player health bar color
Changes the Time bar colors (Must be a Hexadecimal Color)
-
leftHex
- The color thats filling up the time bar -
rightHex
- The background of the time bar
Get the color decimal ID from an Hexadecimal value (color).
Example: To get orange, you should use getColorFromHex('FF7800')
or getColorFromHex('0xFFFF7800')
Returns the current song position. Shortcut to getPropertyClass('Conductor', 'songPosition')
Gets the position of the cursor x position
-
camera
-camGame
,camHUD
orcamOther
Gets the position of the cursor y position
-
camera
-camGame
,camHUD
orcamOther
Exits the song
-
skipTransition
- The transition if the song exited
Restarts the song
Loads another song
-
name
- The name of the song you wan't to load -
difficulty
- The difficulty ID of song
It randomizes the Int better than math.random(min, max)
-
min
- Lowest number -
max
- Highest number
It randomizes the Float, works tha same as getRandomInt()
It randomizes the Bool
-
chance
- It randomizes the chance of it beingtrue
Makes the camera shake
-
camera
-camGame
,camHUD
orcamOther
-
intensity
- How far away should it shake, recommended value is0.05
-
duration
- How much time duration for it to shake
Makes the camera focus on a specific target
-
target
- Target can be either boyfriend or dad
Makes the camera flash
-
camera
-camGame
,camHUD
orcamOther
-
color
- color of flash (Must be a Hexadecimal Color) -
duration
- How much time duration for it to shake -
forced
- restarts flash or not
Makes the camera fade
-
camera
-camGame
,camHUD
orcamOther
-
color
- color of fade (Must be a Hexadecimal Color) -
duration
- Time duration for it to fade -
forced
- restarts fade or not
- Prints a debug message on the top-left corner of the screen
- All values are optional
- You can have up to 5 values to be printed.
Example: debugPrint("Current boyfriend character: ", getProperty("boyfriend.curCharacter"));
This will print the following message: Current boyfriend character: bf
Stops your script in the next 100 miliseconds. And must be used in a Stage script
because it won't be used anymore
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