Many global functions are available when scripting with Lua for StepMania.
Some, like , are core functions of Lua 5.1's basic Library.
Others, like , are defined in the StepMania engine's C++ but made available to Lua.
And others, like , are defined in the _fallback theme's Lua files.
When scripting with StepMania, keep in mind that if you do not scope your functions (and variables) using the local keyword, they will be global.
[03 Gameplay.lua] Returns false if the player should be disallowed from entering the options menu from ScreenSelectMusic (i.e. during an ExtraStage or when the is Oni). Returns true otherwise. [02 Colors.lua] Returns a color with HSV values matching c and alpha set to percent, where percent is in the range 0..1. Use this to make a current value approach a goal value at the given speed. Speed must not be negative. The value will not overshoot the goal.
Note: When you see the error "approach: speed 1 is negative." it means that the speed value passed was negative. The 1 is there because approach and multiapproach use the same internal function and can be ignored when using approach.
[03 CustomSpeedMods.lua] Returns an of speed mod choices generated from the comma-delimited list in SpeedMods.txt in the root of the current Profile directory (player if available, machine otherwise). [02 StageMods.lua] Returns true if player modifiers should be forced. This is effectively the negation of . [02 StageMods.lua] Returns true if song modifiers should be forced (i.e. during an ExtraStage, or when the is Oni, Battle, or Rave). Issues an error when v is false (or nil). Returns all arguments otherwise. sAssertMessage is an optional error message (the default is "assertion failed!").
assert is a core function of Lua's basic library; see the Lua manual for more details.
[02 Utilities.lua] Returns two results.
If P1 is joined, the first return value will be arg1, and nil otherwise.
If P2 is joined, the second return value will be arg2, and nil otherwise.
[04 SetBGFitHelpers.lua] Returns an ActorFrame containing examples of how a given background image (with set aspect ratio) will appear in a particular .
The _fallback theme uses this to visually represent choices for ScreenSetBGFit, intended to help players choose a BackgroundFitMode preference.
[04 SetBGFitHelpers.lua] Returns an ActorFrame with an InputCallback attached.
The _fallback theme uses this to manage input on ScreenSetBGFit, intended to help players choose a preference.
Returns the last named component of path. For example, passing in "/path/to/file.txt" will return "file.txt", while "/path/to/some/directory/" will return "directory". Converts a binary formatted string to hexadecimal format. This can be useful in conjunction with 's MD5 and SHA functions. [02 Colors.lua] Returns the color that results from multiplying c's R, G, and B values by fBoost. [02 Colors.lua] Modifies the brightness of the specified color. [02 Utilities.lua] Returns true if the Center1Player preference is enabled during single style. Returns true when the style is double or routine, regardless of the Center1Player preference.
Returns false otherwise.
[03 Gameplay.lua] Returns true if checkpoint judgments and tap judgments are considered separate, or false otherwise. CLAMP is an all-female Japanese mangaka group that formed in the mid 1980s. Erm, I mean... Clamps fValue between fLow and fHigh. [Deprecated] Always returns false. A generic interface to Lua's garbage collector. Performs different functions based on the value of opt.
collectgarbage is a core function of Lua's basic library; see the Lua manual for more details.
Returns a color from a string. color can be in hex ("#FFFFFFFF") or 0..1 values ("1.0,1.0,1.0,1.0"), in RGBA order. [02 Colors.lua] Returns a darker tone of the color. (Specifically c[1]/2, c[2]/2, c[3]/2, c[4]) [02 Colors.lua] Returns a lighter tone of the color. (Specifically c[1]+(c[1]/2), c[2]+(c[2]/2), c[3]+(c[3]/2), c[4]) [02 Colors.lua] Returns a midtone of the color. (Specifically c[1]/1.5, c[2]/1.5, c[3]/1.5, c[4]) [02 Colors.lua] Accepts a color and returns the hex representation. For example, passing in {1, 0, 0.4, 1} will return "FF0066FF". [02 Colors.lua] Accepts a color and returns a table with the HSV values, indexed by Hue, Sat, Value, and Alpha. [03 Gameplay.lua] Determines what TapNoteScore allows for continuing the combo. [03 Gameplay.lua] Determines what TapNoteScore allows for maintaining the combo. [03 Gameplay.lua] Determines if combo should be per row (Jump = 1) or per column (Jump = 2). [02 Other.lua] Defines the transform function used to position player combo during gameplay. params will contain two boolean values indexed by bReverse and bCentered.
Not intended to be called directly by themes.
This will take the number and insert a comma every three digits, as normal in English for writing large numbers.
number can be a string, an integer, or a float.
comma is an optional argument that is used instead of a comma.
"commify(1234, 'cat')" will result in "1cat234".
dot is an optional argument that is used instead of a dot to find the end of the part that should be commified.
"commify('1234cat5678', ',', 'cat')" will result in "1,234cat5678", but "commify('1234cat5678')" will result in "12,34c,at5,678".
The comma and dot arguments are provided to ease compliance with locales or languages that do not use comma and dot in numbers the way English does.
[Deprecated] Always returns false. Returns d localized for the current language using strings defined under [CourseDifficulty]. Returns ct localized for the current language using strings defined under [CourseType]. [02 Utilities.lua] Utillity function used to format log output for presenting on-screen. indent is the number of pixels to indent lines. width is the width in pixels that lines should be constrained to. Recursively searches dir for xml files of actors and converts them to equivalent lua files. See Docs/Themerdocs/XmlToLua.txt. Creates a RageBezier2D for you to use. Make sure you destroy the RageBezier2D when you're done with it, or you will have a memory leak. Creates a CubicSplineN for you to use. Make sure you destroy the CubicSplineN when you're done with it, or you will have a memory leak. [02 Colors.lua] [02 Colors.lua] [02 Colors.lua] Returns cd localized for the current language using strings defined under [CustomDifficulty]. Returns the current day of the month in the range 1-31. Returns the current day of the year in the range 0-365. [02 Serialize] Recursively deep-copy a table. dofile is normally a core function of Lua's basic library. StepMania overrides this in [01 base.lua] to use loadfile, which itself has been overridden. [03 Gameplay.lua] [03 Gameplay.lua] [02 Utilities.lua] Old name for approach. This function creates files in the theme's Languages folder listing all the strings that have no translation and all the strings that are unused.
Strings that do not have an entry in the master language are considered unused.
master_lang_name is the name of the ini file that contains the language with all strings used by the theme.
Example: find_missing_strings_in_theme_translations( "my_best_theme", "en.ini" )
[02 Utilities.lua] Return the index of a true value in list. [02 Utilities.lua] Find a key in tab with the given value. f takes a key and a value. Returns the number passed to the function followed by its suffix ("th", "nd", and so on). [02 Other.lua] Concatenates num with " songs played" and returns the resulting string. Returns fPercentDancePoints formatted as a percentage. [03 Gameplay.lua] Returns a list of valid styles for the current gametype. [03 Gameplay.lua] [02 Other.lua] Returns the value of the CoursesToShowRanking preference if it is not an empty string.
Otherwise, returns a comma-delimited set of paths to the .crs files included with StepMania as a string. This string is hardcoded and does not accurately reflect whether those crs files exist in the filesystem.
Returns the corresponding CustomDifficulty string for a StepsType/Difficulty (/optional CourseType) combination. [04 Scoring.lua] "Get the radar values directly. The individual steps aren't used much." [02 Other.lua] Returns a string with the Edit Mode SubScreens. [03 EnvUtils2.lua] Returns the value of name from the Env table. [03 Gameplay.lua] Returns the number at which the Extra color should be used. Returns a corresponding for the given percentage. Returns the current Life difficulty in the range of 1-7 Returns the length of the music file found at path in seconds.
If the file has already been loaded into an ActorSound, use to get its RageSound, and then use to avoid loading the file twice.
Returns a table of the names of the sound drivers available. If the SoundDriver preference is set to something that is not in this list, StepMania will not start up. Changes to the SoundDriver preference do not take effect until the next time StepMania starts up. [02 Utilities.lua] "This returns a profile, preferably a player one. If there isn't one, [it falls] back on the machine profile." [03 ThemePrefs.lua] Returns true if player pn is using the ProTiming UserPref. [02 Utilities.lua] Returns a path to a random song background. [02 Actor.lua] [02 Actor.lua] Returns the screen display aspect ratio (i.e. the DisplayAspectRatio preference). [Deprecated] Always returns "". [02 Utilities.lua] Returns a path to the current songs background. [03 Gameplay.lua] [03 CustomSpeedMods.lua] Returns the theme's aspect ratio.
Specifically, this is the result of dividing ScreenWidth by ScreenHeight as each is defined under the theme's [Common] metric.
[03 ThemePrefs.lua] Alias for . Returns the current Timing difficulty in the range of 1-9. Returns the current time since the program was started. Includes time that was spent loading songs. [01 alias.lua] [01 alias.lua] [04 Scoring.lua] "Retrieve the amount of taps/holds/rolls involved." Used in some scoring formulas. [03 UserPreferences2.lua] Themer-facing function for getting a user preference. [03 UserPreferences2.lua] Themer-facing function for getting a user preference as a boolean. [03 UserPreferences2.lua] Themer-facing function for getting a user preference as a color. [03 UserPreferences2.lua] Themer-facing function for getting a user preference as a number. [02 Colors.lua] Returns the color's alpha if it has any, otherwise returns 1. [03 Gameplay.lua] Returns the value to start showing the combo at. [03 Gameplay.lua] Returns true if you need to step on hold heads to activate them. [03 Gameplay.lua] Returns 0 when the current is pump. Returns the TimingWindowSecondsHold preference value in other games. Returns the current hour. [02 Colors.lua] Converts a color from HSV values to something StepMania can understand.
hue is from 0-360
saturation and value are 0..1
[02 Colors.lua] Converts a color from HSV values with alpha to something StepMania can understand.
hue is from 0-360
saturation, value, and alpha are 0..1
[02 Colors.lua] Converts a table of HSV values to a color.
The hsv table should use indexes Hue, Sat, Value, Alpha.
[02 Colors.lua] Accepts a table of HSV values and returns the hex representation. The hsv table should use indexes Hue, Sat, Value, Alpha. [02 Colors.lua] Changes the hue of the input color. [03 ThemePrefs.lua] Initializes various user preferences. Returns three values: an iterator function, the table t, and 0, so that the construction for i,v in ipairs(t) do body end will iterate over the pairs (1,t[1]), (2,t[2]), ···, up to the first integer key absent from the table.
ipairs is a core function of Lua's basic library; see the Lua manual for more details.
[02 Utilities.lua] Returns true if the coin mode is not set to CoinMode_Home. Returns true if the current is Nonstop, Oni, or Endless.
This is effectively the same as .
[02 Utilities.lua] Returns true if IsArcade() and the coin mode is CoinMode_Free. [03 Gameplay.lua] Returns true if the current game is sGame. [02 Utilities.lua] Returns true if the coin mode is set to CoinMode_Home. [Deprecated] Always returns false. [Deprecated] Always returns false. [Deprecated] Always returns false. [04 Scoring.lua] Returns true if W1 is allowed (and tns == 'TapNoteScore_W2') [02 Branches.lua] Returns true if Routine mode is being played. [04 WidescreenHelpers.lua] Returns true if the aspect ratio is 16:10 (1.6) or higher. [01 base.lua] "Like ipairs(), but returns only values." [02 Utilities.lua] Joins a table, splitting each item with delimiter, returning a string of the results. Decodes JSON encoded data and returns the result. Returns data as JSON. Empty tables are represented as arrays in the output.
minify is optional and defaults to false. If true, all unnecessary whitespace is omitted from the output.
[02 Colors.lua] Returns jl localized for the current language using strings defined under [JudgmentLine]. [02 Colors.lua] Returns a number linearly interpolated between start and end by percent. Same as , but for colors. All channels will reach the end of the interpolation at the same time. Returns an Actor definition for the actor at sPath. If sPath points to a Lua file, any additional arguments will be passed to that script. [02 ActorDef.lua] Loads an actor template. This is the actual core of LoadActor. [02 ActorDef.lua] Loads an actor with params. loadfile is normally a core function of Lua's basic library. StepMania overrides this in [01 base.lua] to use lua.ReadFile. [02 ActorDef.lua] Load the fallback BGA for the element that is currently being loaded. [02 ActorDef.lua] Loads a font. [02 Sprite.lua] Returns a Sprite with the current song's background. Iterates over all functions exposed to Lua in class, creating CamelCase aliases for each function. Not intended to be used by themers. Returns the length of the multi-byte character string sString. Returns the current Minute. [03 Gameplay.lua] Returns the value to start showing the miss combo at. Returns the current month of the year in the range 0-11. Returns m localized for the current language using strings defined under [Month]. Returns m as a non-localized string. Similar to approach, but operates on tables of values instead of single values. This will modify the contents of currents in place, as well as returning currents.
currents, goals, and speeds must all be the same size and contain only numbers.
multiplier is optional. The speeds in the speeds table will be multiplied by multiplier. This makes it more convenient to use multiapproach in a per-frame update: pass in the frame delta and the speeds will be scaled to the time that passed.
Note: When you see the error "approach: speed 1 is negative." it means that a speed value passed was negative. The 1 tells you which entry in the table was invalid.
Allows a program to traverse all fields of a table. Its first argument is a table and its second argument is an index in this table. next returns the next index of the table and its associated value.
next is a core function of Lua's basic library; see the Lua manual for more details.
Converts a string such as 'oni' or 'expert' or 'trick' to the appropriate difficulty. [03 ThemePrefs.lua] Returns a Lua option row for ProTiming. Returns three values: the function, the table t, and nil, so that the construction for k,v in pairs(t) do body end will iterate over all key–value pairs of table t.
pairs is a core function of Lua's basic library; see the Lua manual for more details.
[02 Colors.lua] [02 Colors.lua] Returns pma localized for the current language using strings defined under [PeakComboAward]. Returns pm localized for the current language using strings defined under [PlayMode]. Returns pn localized for the current language using strings defined under [PlayerNumber]. [02 Utilities.lua] Converts a PlayerNumber into a short string (e.g. "P1", "P2"). [02 Actor.lua] Returns either p1val or p2val depending on pn. Returns a formatted percent with the specified numerator and denominator. [00 init.lua] Alias for . [03 ThemePrefs.lua] Prints a table's contents to log.txt using . Returns the product family. (e.g. "StepMania") Returns the product ID. (e.g. "ITGmania") Returns the product version. (e.g. "5.0.11" or "5.1.0" or "5.2-git-96f9771") Returns cat localized for the current language using strings defined under [RadarCategory]. Checks whether v1 is equal to v2, without invoking any metamethod.
rawequal is a core function of Lua's basic library; see the Lua manual for more details.
Gets the real value of t[index], without invoking any metamethod.
rawget is a core function of Lua's basic library; see the Lua manual for more details.
Sets the real value of t[index] to value, without invoking any metamethod. The modified t is then returned.
rawset is a core function of Lua's basic library; see the Lua manual for more details.
[02 ActorDef.lua] Used internally by LoadActor to resolve a path. If optional is true, then a nil path is returned instead of emitting an error if no file is found. [04 FileUtils.lua] Reads the file at path and returns its contents. [03 UserPreferences2.lua] (internal) Reads the specified user preference from its config file. [02 Utilities.lua] Recursively prints all the children of the actor frame to the log file. This can be useful for finding out what actors are on a screen or just seeing what the structure of the actor tree looks like.
indent is an optional argument that will be prepended to every line.
[02 Utilities.lua] Recursively prints all values in the table to the log file in the form "(key_type) key: (value_type) value" so that you know the type of the key and the value. Useful if you're not sure exactly what is in a table passed as a parameter.
indent is an optional argument that will be prepended to every line.
[Deprecated] Always returns false. [02 Utilities.lua] Round a number. [03 Gameplay.lua] Returns the routine noteskin for player . [03 Gameplay.lua] Returns the routine noteskin for player 2. [02 Colors.lua] Modifies the saturation of the specified color Saves a screenshot. If pn is nil, saves to the machine's Screenshots dir, otherwise saves to the profile's Screenshots dir. Saves as jpg if compress is true, or png if compress is false. The screenshot is signed if sign is true. prefix and suffix are optional strings to add to the beginning and end of the filename.
Returns success and full path of the resulting screenshot.
Scales x, originally within low1 and high1, to fall between low2 and high2. [03 Gameplay.lua] Returns the primary ScoreKeeper class to use. [02 Colors.lua] [02 Other.lua] alias for . [02 Other.lua] alias for . Returns the current second. Converts fSecs to Hours:Minutes:Seconds format using two digits for each section. Converts fSecs to Minutes:Seconds format using one digit for Minutes and two digits for Seconds. Converts fSecs to Minutes:Seconds format using two digits for both sections. Converts fSecs to Minutes:Seconds.Milliseconds format using one digit for Minutes, two digits for Seconds, and two digits for Milliseconds. Converts fSecs to Minutes:Seconds.Milliseconds format using two digits for each section. Converts fSecs to Minutes:Seconds.Milliseconds format using two digits for Minutes, two digits for Seconds, and three digits for Milliseconds. "If index is a number, returns all arguments after argument number index. Otherwise, index must be the string "#", and [it] returns the total number of extra arguments it received." [02 Branches.lua] Determines the correct music/course selection screen to use and returns it. [03 Gameplay.lua] (soon to be deprecated) Returns a list of codes to use on ScreenSelectProfile. [02 Serialize.lua] Serialize the table t. [03 EnvUtils2.lua] Sets the value of name to value in the Env table. [03 UserPreferences2.lua] Themer-facing function for setting a user preference. [03 Gameplay.lua] [02 ActorDef.lua] Returns true if a decoration should be shown on the current screen or not. Returns so localized for the current language using strings defined under [SortOrder]. [03 CustomSpeedMods.lua] Returns a Lua option row with the custom speed mods defined in SpeedMods.txt. [02 Utilities.lua] Splits a string at every occurence of delimiter, returning a table of the results. Returns sa localized for the current language using strings defined under [StageAward]. [02 Colors.lua] Returns i localized for the current language using strings defined under [Stage]. [02 Colors.lua] [02 ActorDef.lua] [02 ActorDef.lua] [02 ActorDef.lua] [01 Alias.lua] Given the short form of a string, returns the full version of the string.
Returns nil if the string passed in does not match any valid BlendModes.

local b = StringToBlend("AlphaMask")
Trace(b)  -- "BlendMode_AlphaMask"
[02 Utilities.lua] Returns a shuffled version of t. [02 Utilities.lua] Returns a slice of the specified table of size num. [02 Utilities.lua] Look up each value in a table, returning a table with the resulting strings. Returns tns localized for the current language using strings defined under [TapNoteScore]. [02 TextBanner.lua] Defines how the is laid out. [04 Other.lua] [02 Utilities.lua] Converts a string or number to a bool. Tries to convert e to a number. Returns nil if it can't convert the input to a number. (base is optional.)
tonumber is a core function of Lua's basic library; see the Lua manual for more details.
Converts e to a string.
tostring is a core function of Lua's basic library; see the Lua manual for more details.
[02 Enum.lua] Returns a string representing an enum starting from '_'. For example, passing PlayerNumber_P1 to this function will return "P1". [00 init.lua] Alias for . Returns the type of the object as a string. There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table.
See the Lua manual for more details.
Returns i localized for the current language using strings defined under [UnlockRewardType]. Returns the elements from table list. This function is equivalent to return list[i], list[i+1], ···, list[j].
i and j are optional; by default, i is 1 and j is the length of the list.
unpack is a core function of Lua's basic library; see the Lua manual for more details.
Returns a string with characters escaped for URLs. (e.g. a space becomes '%20') This tells StepMania to update the screen position for any changes to these preferences: CenterImageAddWidth, CenterImageAddHeight, CenterImageTranslateX, CenterImageTranslateY.
This way, a theme can implement a custom interactive screen for adjusting those preferences.
[01 base.lua] Alias for lua.GetThreadVariable. Returns the current version's build date, formatted as YYYYMMDD. Returns the current version's build time, formatted as HH:MM:SS. [00 init.lua] Alias for . Returns the current weekday in the range of 0-6, where Sunday is 0. [04 WidescreenHelpers.lua] Depending on the screen width, scales between ar43 (4:3; 640px) and ar169 (16:9; 854px). [02 Utilities.lua] [02 Utilities.lua] [02 Utilities.lua] [02 Utilities.lua] [02 ActorDef.lua] Wraps the children in an ActorFrame. [04 FileUtils.lua] Writes buf to the file at path. [03 GamePreferences.lua] [03 UserPreferences2.lua] (internal) Writes user preference prefName to its config file with value being tostring'd. Returns the current year.
The StepMania engine makes some of its namespaces available to Lua. These can be thought of as collections of utility functions.
Example using SongUtil to get playable from a song given the current :

local song = GAMESTATE:GetCurrentSong()
local playable_steps = SongUtil.GetPlayableSteps(song)
Returns the for the file at sPath. Returns true if sClassName is a registered Class. Loads all commands and sets X and Y for the specified Actor. Used internally by LoadActor to resolve a path. If optional is true, then a nil path is returned instead of emitting an error if no file is found. Updates ArrowEffects, which sets current values for Tornado, Invert, and Beat. Returns the Y Offset of a note in column iCol at beat fNoteBeat for the provided PlayerState. Y Offset is affected by Speed mods and Accel mods, and impacts most other arrow effects. Returns the Y position of a note in column iCol with a Y offset of fYOffset for the provided PlayerState.
fYReverseOffsetPixels is the separation between targets with and without reverse. This argument is optional and will pull defaults from the metrics for [Player]
Returns the Y offset of a note in column iCol with a Y position of fYPos for the provided PlayerState.
fYReverseOffsetPixels is the separation between targets with and without reverse. This argument is optional and will pull defaults from the metrics for [Player]
Returns the X position of a note in column iCol with a Y offset of fYOffset for the provided PlayerState. Returns the Z position of a note in column iCol with a Y offset of fYOffset for the provided PlayerState. Returns the X rotation of a note with a Y offset of fYOffset for the provided PlayerState. Returns the Y rotation of a note with a Y offset of fYOffset for the provided PlayerState. Returns the Z rotation of a note at beat fNoteBeat for the provided PlayerState.
bIsHoldHead is an optional argument which defaults to false. If true, this function will return 0 if the [PlayerOptions] modifier DizzyHolds is off.
Returns the Z rotation of the receptors for the provided PlayerState. Returns the Alpha of a note in column iCol with a Y offset of fYOffset for the provided PlayerState.
fPercentFadeToFail is optional and defaults to -1.
fYReverseOffsetPixels is the separation between targets with and without reverse. This argument is optional and will pull defaults from the metrics for [Player]
fDrawDistanceBeforeTargetsPixels is optional and will pull defaults from the [Player] metric DrawDistanceBeforeTargetsPixels
fFadeInPercentOfDrawFar is optional and will pull defaults from the [NoteField] metric FadeBeforeTargetsPercent
Returns the Glow of a note in column iCol with a Y offset of fYOffset for the provided PlayerState. The arguments are the same as for GetAlpha. Returns the brightness of a note at beat fNoteBeat for the provided PlayerState. Returns true if any arrow effects for the provided PlayerState require the z buffer. Returns the zoom of a note for the provided PlayerState. Returns the FrameWidthScale of a hold part with a Y offset of fYOffset for the provided PlayerState.
fOverlappedTime is optional and will default to 0.
Enumerated types are lookup tables associating a string to each numerical value for each Enum. For example, PlayerNumber[1] would be the string 'PlayerNumber_P1'.
The functions in this Enum namespace are valid member functions of every Enum where the first argument is omitted and the name of the Enum is used in place of Enum.
For example:

Enum.GetName(PlayerNumber)
Enum.Reverse(PlayerNumber)
can be condensed like

PlayerNumber:GetName()
PlayerNumber:Reverse()
Both x and y need to be elements of the enumerated type e. Returns a value less than/greater than/equal to 0 corresponding to the numerical value of x being less than/greater than/equal to the numerical value of y as determined by Enum.Reverse( e ). Returns the type of e. For example, Enum.GetName( ) will return the string 'PlayerNumber'. Returns a reverse lookup table for the enumerated type e. For example:

local pn1 = PlayerNumber:Reverse()['PlayerNumber_P1']
local pn2 = PlayerNumber:Reverse()['PlayerNumber_P2']
-- pn1 is 0
-- pn2 is 1
Note that the values returned from Reverse() will correspond to the 0-based indexing from C++ and not 1-based indexing conventional to Lua.
Returns true if the type of v is sType. Flushes log files to disk. Tries to read the file at sPath. If successful, it returns the file's contents. If unsuccessful, it returns two values: nil and "error". Reports the error through the error reporting system.
error is optional and defaults to "Script error occurred.".
error_type is optional and defaults to "LUA_ERROR". Errors of type "LUA_ERROR" will be shown in-game if the ShowThemeErrors preference is enabled. A dialog will not appear for an error_type the user has chosen to ignore.
Calls func(...) with LuaThreadVariables set according to the keys and values of t, and returns the return values of func().
For example, if t is {x=12}, calling Var "x" from func will return 12.
Writes sString to log.txt. Aliased by . Writes sString to info.txt and log.txt as a warning. Aliased by .
Returns a random number. Without arguments, the number is in the range 0..1. With a single argument (n), the number is in the range of 1..n. With two arguments (lower, upper), the number is in the range of l..u. Sets the seed of the random number generator to seed. Creates a RageFile handle with which one can use the commands in .
Example:

local file = RageFileUtil.CreateRageFile()
Gets the credits message for Player pn. Returns a table with the playable Steps for the present Song based on the present Game. Returns true if the song's steps (st) are playable. Returns true if the song's StepsType (st) are playable. Returns the number of songs in a Trail. Returns the Trail's total length in seconds.
Actor is the base class containing common methods that all specialized actor classes inherit. For example, GetX is a method belonging to Actor, but s, s, s, and so on can use GetX(). This adds a wrapper state around the Actor, which is like wrapping the Actor in an ActorFrame, except that you can use it on any actor, and add or remove wrapper states in response to things that happen while the screen is being used. (wrapping an Actor in an ActorFrame normally requires setting it up before the screen starts)
The ActorFrame that is returned is the wrapper state, for convenience.
An Actor can have any number of wrapper states. Use GetWrapperState to access wrapper states for the actor.
Returns the number of wrapper states the actor has. Returns the wrapper state at index i. Think of wrapper states with a higher index as being "further out". Actor is inside Wrapper 1, Wrapper 1 is inside Wrapper 2, Wrapper 2 is inside Wrapper 3, and so on. Removes the wrapper state at index i. Returns the Actor's parent, or nil if it doesn't have one. Returns the Actor's fake parent, or nil if it doesn't have one. Sets the Actor's fake parent to p, or clears it if p is nil. Returns the Actor's visibility. Returns the Actor's x position. Returns the Actor's y position. Returns the Actor's z position. Returns what the Actor's x position will be when it reaches its destination tween state. Returns what the Actor's y position will be when it reaches its destination tween state. Returns what the Actor's z position will be when it reaches its destination tween state. Returns the Actor's zoom. Returns the Actor's X zoom. Returns the Actor's Y zoom. Returns the Actor's Z zoom. Sets Texture Filtering for an Actor to b. Plays the commands that follow at an accelerated rate (fRate²), where fRate is in seconds.
accelerate is a basic tween command, along with , , , and .
Adds a command to the Actor. Adds rot degrees to the Actor's current X rotation. Adds rot degrees to the Actor's current Y rotation. Adds rot degrees to the Actor's current Z rotation. Adds xPos to the Actor's current x position. Adds yPos to the Actor's current y position. Adds zPos to the Actor's current z position. [02 Actor.lua] Sets the alignment of an Actor, where h and v are in the range 0..1. Sets whether or not the Actor should animate. Sets the Actor's aux value. (This can be a solution for coupling data with an Actor.) If true, cull the Actor's back faces. See also: . Sets the Actor's base alpha to fAlpha, where fAlpha is in the range 0..1. Sets the Actor's base X rotation to rot degrees. Sets the Actor's base Y rotation to rot degrees. Sets the Actor's base Z rotation to rot degrees. Sets the Actor's base zoom to zoom. Sets the Actor's base X zoom to zoom. Sets the Actor's base Y zoom to zoom. Sets the Actor's base Z zoom to zoom. Sets the Actor to use the specified . Makes the Actor bob up and down. Can use to define different bobbing behavior. Makes the Actor bounce, similar to bob but with one point acting as the ground. Can use to define different bouncing behavior (with effectmagnitude values relating to x, y, and z movement). [02 Actor.lua] [02 Actor.lua] [02 Actor.lua] Centers an Actor on the screen.
self:Center() is equivalent to self:x(SCREEN_CENTER_X):y(SCREEN_CENTER_Y)
[02 Actor.lua] Centers an Actor on the X axis.
self:CenterX() is equivalent to self:x(SCREEN_CENTER_X)
[02 Actor.lua] Centers an Actor on the y axis.
self:CenterY() is equivalent to self:y(SCREEN_CENTER_Y)
Determines if the z-buffer should be cleared or not. [02 Actor.lua] Combines multiple interpolators for complex tweens. tweens can either be a string like "linear,0.25,accelerate,0.75" or a table with tween information { {Type="linear", Percent=0.25, Bezier=nil}, {Type="accelerate", Percent=0.75, Bezier=nil} } Crops percent of the Actor from the bottom, where percent is in the range 0..1. Crops percent of the Actor from the left, where percent is in the range 0..1. Crops percent of the Actor from the right, where percent is in the range 0..1. Crops percent of the Actor from the top, where percent is in the range 0..1. Sets the Actor's to mode. Plays the commands that follow at an decelerated rate (1 - (1-fRate) * (1-fRate)), where fRate is in seconds.
decelerate is a basic tween command, along with , , , and .
Set the Actor's diffuse color to c. Sets the Actor's alpha level to fAlpha, where fAlpha is in the range 0..1. Makes the Actor switch between two colors immediately. See Docs/Themerdocs/effect_colors.txt for an example. Sets the Actor's bottom edge color to c. Set the Actor's diffuse color to c, ignoring any alpha value in c. Sets the Actor's left edge color to c. Sets the Actor's lower left corner color to c. Sets the Actor's lower right corner color to c. Makes the Actor switch between two colors, jumping back to the first after reaching the second. See Docs/Themerdocs/effect_colors.txt for an example. Sets the Actor's right edge color to c. Makes the Actor shift between two colors smoothly. See Docs/Themerdocs/effect_colors.txt for an example. Sets the Actor's top edge color to c. Sets the Actor's upper left corner color to c. Sets the Actor's upper right corner color to c. Tells the Actor to draw itself. Sets the Actor's draworder to iOrder, where larger values display first. [02 Actor.lua] (Added in sm-ssc) [02 Actor.lua] Set the Actor's effect clock to s. Sets the first effect color to c. Sets the second effect color to c. Set the Actor's effect magnitude in each direction to the given values. Set the Actor's effect offset to fTime. The offset is added to the time into the effect before calculating percent_through_effect. Set the Actor's effect period to fTime. Set the Actor's effect timing. The effect timing controls how long it takes an effect to cycle and how long it spends in each phase.

All effect timings must be greater than or equal to zero, at least one of them must be greater than zero.
Depending on the effect clock, the actor's time into effect is updated every frame. That time is then translated into a percent_through_effect using the parameters to this function.
ramp_to_half is the amount of time for percent_through_effect to reach 0.5.
hold_at_half is the amount of time percent_through_effect will stay at 0.5.
ramp_to_full is the amount of time percent_through_effect will take to go from 0.5 to 1.0.
hold_at_full is the amount of time percent_through_effect will stay at 1.0.
After reaching the end of hold_at_full, percent_through_effect stays at 0 until hold_at_zero is over.

The different effects use percent_through_effect in different ways. Some use it to calculate percent_between_colors with this sine wave: sin((percent_through_effect + 0.25f) * 2 * PI ) / 2 + 0.5f
Some effects check the internal bool blink_on. blink_on is true if percent_through_effect is greater than 0.5 and false if percent_through_effect is less than or equal to 0.5.

Check the effect functions for individual explanations: , , , , , , , , , , , .
Set the hold_at_full part of the effect timing while leaving the others unchanged. Fades percent of the Actor from the bottom where percent is in the range 0..1. Fades percent of the Actor from the left where percent is in the range 0..1. Fades percent of the Actor from the right where percent is in the range 0..1. Fades percent of the Actor from the top where percent is in the range 0..1. Finishes up an Actor's tween immediately. [02 Actor.lua] Stretches an Actor to fill the entire screen. Returns the Actor's aux value. Returns the Actor's base X zoom value. Returns the Actor's base Y zoom value. Returns the Actor's base Z zoom value. Returns true if the Actor has a command named sCmdName. Returns the Actor's current diffuse color. Returns the Actor's current diffusealpha. Returns the Actor's current effect delta. Returns the Actor's current effect magnitude as three floats. Returns the Actor's current glow color. Returns the Actor's horizontal alignment as a number in the range 0..1. Returns the Actor's name. Returns the number of states the Actor has. Returns the Actor's current height. Returns the Actor's current X, Y, and Z rotation in degrees as three separate floats. Returns the Actor's current X rotation in degrees. Returns the Actor's current Y rotation in degrees. Returns the Actor's current Z rotation in degrees. Returns the number of seconds into the currently running effect (e.g. diffuseshift, bob). Returns how much time is remaining for the current tween. Returns the Actor's vertical alignment as a number in the range 0..1. Returns the Actor's current width. Returns the zoomed height of an Actor. Returns the zoomed width of an Actor. Returns true if this actor is currently set to use the effect delta for tweening. Sets the Actor's glow color. Makes the Actor glow between two colors immediately. See Docs/Themerdocs/effect_colors.txt for an example. Makes the Actor glow between two colors smoothly, jumping back to the first at the end. See Docs/Themerdocs/effect_colors.txt for an example. Makes the Actor glow between two colors smoothly. See Docs/Themerdocs/effect_colors.txt for an example. Set the fractional horizontal alignment of the Actor according to fAlign which should be a float in the range 0..1. An alignment of 0 is left-aligned while an alignment of 1 is right-aligned.
Use for the common case.
Sets the heading of this Actor to fHeading. Hides the Actor for the specified amount of time. [Deprecated] Compatibility alias for the hidden command, which was removed in sm-ssc. Use instead. [02 Actor.lua] "Hide if b is true, but don't unhide if b is false." Set the of the Actor according to align.

local spr = LoadActor('awesome.png')
spr.InitCommand=function(self)
	self:horizalign('HorizAlign_Left')
end
Use for fractional alignment.
Hurries up an Actor's tweening by factor. Plays the commands that follow at a normal (linear) rate, where fRate is in seconds.
linear is a basic tween command, along with , , , and .
[02 Lyrics.lua] Plays the lyric command for the specified side ("Back" or "Front"). Sets the Actor's name to sName. Stops the Actor's movement. (Usually used for Sprites or Models.) Sets the pitch of this Actor to fPitch. Starts the Actor's movement. (Usually used for Sprites or Models.) Plays a command named sCommandName. params is passed to the command as an argument if it is a table. [02 Actor.lua] Sets the visibility of the Actor based on p being a human player. Makes the Actor grow and shrink. Can use to define different pulsing behavior. Queues a command named sCommandName to be played. Basically creates a command named !sMessageName (Note the ! at the beginning. The source code says this: "Hack: use "!" as a marker to broadcast a command, instead of playing a command, so we don't have to add yet another element to every tween state for this rarely-used command.") Makes the Actor change colors continually using colors of the rainbow. Each channel follows a cosine wave, red starts at 0, green starts at 2pi/3, and blue starts at 4pi/3. Sets the roll of this Actor to fRoll. Set the Actor's rotation on the X axis to fRotation degrees. Set the Actor's rotation on the Y axis to fRotation degrees. Set the Actor's rotation on the Z axis to fRotation degrees. Recursively runs the commands in cmds on the Actor's children, as well as the Actor itself.
Since RunCommandsRecursively belongs to StepMania's base Actor class, it is available to all specialized actors. Calling it from an ActorFrame or ActorFrameTexture can be helpful, as those specialized actors can contain children actors.
See and for related needs.
Example:

Def.ActorFrame{
	Name="AF",

	Def.Sprite{ Name="sun", Texture="sun.png" },

	Def.ActorFrame{
		Name="AF2",
		InitCommand=function(self)
			-- bounce() will be applied to AF2, airhorn, and catchphrase
			self:RunCommandsRecursively( function(actor) actor:bounce() end )
		end,

		Def.Sprite{ Name="airhorn", Texture="airhorn.png" },
		Def.BitmapText{ Name="catchphrase", Font="Common Normal", Text="Yo!" }
	}
}
[02 Actor.lua] An alternative version of . [02 Actor.lua] Scales the Actor to cover a rectangle defined by the four float arguments. Scales the Actor to fit inside a rectangle defined by the four float arguments. Sets the height of the Actor. Sets the size of the Actor. [01 alias.lua] Alias for setsize. Sets a multi-framed Actor's state to iNewState. Sets the width of the Actor. Use this to make the actor use the effect clock to tween instead of using the global frame delta. Sets the shadow's color to c. Sets the Actor's shadow length to fLength. Sets the Actor's horizontal shadow length to fLength. Sets the Actor's vertical shadow length to fLength. Skews the Actor on the x axis by fAmount. Skews the Actor on the y axis by fAmount. Waits fSeconds before executing the next command. [02 Actor.lua] Tells the Actor to spin. Can use to define different spinning behavior. spring is a basic tween command, along with , , , and . Stops any effect the Actor has. Stops any tweening. Stretches the Actor to a rectangle of a specific size. Translates the texture of the actor by x and y. Determines if the Actor should use texture wrapping or not. Generic method for tweening an actor.
time is in seconds. type is a
If the type is TweenType_Bezier, then the params table must have 4 or 8 numbers. 4 numbers creates a 1 dimensional bezier curve, 8 numbers creates a 2 dimensional bezier curve.
If the type is not TweenType_Bezier, the params table is ignored.
It's usually more convenient to use , , , or rather than using Actor:tween() directly.
Set the fractional vertical alignment of the Actor according to fAlign which should be a float in the range 0..1. An alignment of 0 is top-aligned while an alignment of 1 is bottom-aligned.
Use for the common case.
Set the of the Actor according to align.

local spr = LoadActor('awesome.png')
spr.InitCommand=function(self)
	self:vertalign('VertAlign_Bottom')
end
Use for fractional alignment.
Makes the Actor vibrate violently. Can use to define different vibration behavior. Sets an Actor's visibility to b. Makes the Actor wag. Use to define different wag behavior. Set the x position of the Actor to xPos. Set the y position of the Actor to yPos. Set the z position of the Actor to zPos. Sets the z bias to fBias. Enables/disables z-buffer depending on bUse. Zooms the Actor to zoom scale. Zooms the Actor on both the X and Y axis using zoomX and zoomY. Zooms the Actor to zoom height. See also: . Zooms the Actor to zoom width. See also: . Zooms the Actor to zoom scale on the X axis. Zooms the Actor to zoom scale on the Y axis. Zooms the Actor to zoom scale on the Z axis. Sets the z testing mode to write on pass if true, turns it off if false Sets the z testing mode to testMode. Sets z writing to true or false based on bWrite. [02 Actor.lua] Plays the commands that follow using a bezier curve to determine the rate. The curve must have 4 or 8 elements. This is a convenience wrapper around calling Actor:tween with TweenType_Bezier. [02 Actor.lua] Stretches an Actor to cover the screen. (equivalent to stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT) [02 Actor.lua] A customized version of pulse that is more appealing for on-beat effects. [02 Actor.lua] Sets and Actor as a mask destination. [02 Actor.lua] Sets an Actor as a mask source. (Also clears zbuffer; other mask sources need to not clear the zbuffer) [02 Actor.lua] Make graphics their true size at any resolution. [02 Actor.lua] Scale things back up after they have already been scaled down. [02 Actor.lua] A customized version of pulse that is more appealing for on-beat effects. Sets the x and y location of the Actor in one command.
ActorFrames are containers that allow multiple children actors to be grouped and scripted together.
In theming, the StepMania engine expects a screen layer (underlay, overlay, decorations, in, out, cancel) file to return one actor, and it is common to return one ActorFrame that contains many actors of various specialization.
A common convention is to add children at the next index (current size of the table plus 1).
Basic example:

-- in the context of a .lua file as a screen layer
-- this ActorFrame can be thought of as a Lua table
local af = Def.ActorFrame{}

-- add a Sprite at the next index
af[#af+1] = Def.Sprite{
	Texture="smilingsun.png"
}

-- add a BitmapText at the next index
af[#af+1] = Def.BitmapText{
	Font="Common normal",
	Text="Yo!"
}

-- have the file return the ActorFrame
-- for the StepMania engine to interpret
return af
When actor commands like and are used to position and scale an ActorFrame, its children will position relative to the parent ActorFrame and scale proportionally.
For example, if you want to animate 50 actors moving 100px to the right in unison, it is easier to move the parent ActorFrame than each actor individually.
Basic example:

local af = Def.ActorFrame{}

-- move the ActorFrame +100px
-- over a 2 second duration
-- its children will move with it
af.OnCommand=function(self)
	self:linear(2):addx(100)
end

-- add various children actors
-- to the parent ActorFrame
af[#af+1] = Def.Sprite{
	Texture="taro.png"
}

af[#af+1] = Def.Sprite{
	Texture="laer.png"
}

-- etc.

return af
Likewise, if you stop drawing an ActorFrame by applying visible(false) to it, its children will stop drawing with it.
ActorFrames can contain ActorFrames, and doing so is good design for sufficiently complex screens.
Adds a child to the ActorFrame from the specified path. Sets the field of view for the ActorFrame. Returns the child with a name of sName.
If there are multiple children with that name, returns an array of those children.
The table also acts as a pass through layer, function calls pass through to the last child of that name.
Returns a table of all the children in the ActorFrame.
The table is indexed by the names of the children.
If there are multiple children with the same name, the entry for that name is an array of those children.
The table also acts as a pass through layer, function calls pass through to the last child of that name.
Gets the ActorFrame's Draw function. Returns the number of children in the ActorFrame. Gets the update function's rate. Plays the sCommandName command on the ActorFrame's children. Plays the sCommandName command on the ActorFrame's leaves. Sets if the Actorframe should propagate commands to its children. [02 Actor.lua] Propagates a command to the ActorFrame's children. Removes all the children from the ActorFrame. Removes the specified child from the ActorFrame. Runs the commands in cmds on the ActorFrame's immediate children.
See and for related needs.
Example:

Def.ActorFrame{
	Name="AF",
	InitCommand=function(self)
		-- bounce() will be applied to sun and AF2
		self:RunCommandsOnChildren( function(child) child:bounce() end )
	end,

	Def.Sprite{ Name="sun", Texture="sun.png" },

	Def.ActorFrame{
		Name="AF2",
		Def.Sprite{ Name="airhorn", Texture="airhorn.png" },
		Def.BitmapText{ Name="catchphrase", Font="Common Normal", Text="Yo!" }
	}
}
Runs the commands in cmds on the ActorFrame's leaves. Leaves are nodes in the ActorFrame tree that have no further child nodes.
See and for related needs.
Example:

Def.ActorFrame{
	Name="AF",
	InitCommand=function(self)
		-- bounce() will be applied to sun, airhorn, and catchphrase
		self:runcommandsonleaves( function(leaf) leaf:bounce() end )
	end,

	Def.Sprite{ Name="sun", Texture="sun.png" },

	Def.ActorFrame{
		Name="AF2",
		Def.Sprite{ Name="airhorn", Texture="airhorn.png" },
		Def.BitmapText{ Name="catchphrase", Font="Common Normal", Text="Yo!" }
	}
}
Sets the ActorFrame's ambient light color to c. Sets the ActorFrame's diffuse light color to c. Sets if the ActorFrame should draw by Z position. Sets the ActorFrame's Draw function to the specified Lua function. Sets the field of view for the ActorFrame. Currently unimplemented since it does not handle errors correctly. Arguments must be passed in as a table. Sets the ActorFrame's specular light color to c. Sets the ActorFrame's update function to the specified Lua function. Sets the update function's rate to fRate. Tells the ActorFrame to sort by draw order. Sets the vanishing point for the ActorFrame.
Creates the ActorFrameTexture. Enables/disables the Alpha Buffer. Enables/disables the Depth Buffer. Enables/disables Enables/disables the Preserve Texture option. Returns the texture. Sets the Texture's name to sName. Adds a texture to the ActorMultiTexture. Returns the number of texture units. Clears all the textures from the ActorMultiTexture. Sets the on the ActorMultiTexture. Sets the size of the ActorMultiTexture from the specified texture. Sets the coordinates of the ActorMultiTexture. Sets a on the specified index. The list of quad states is used to determine which animation state is used for each quad. The offset is added to the AMV's current state, and the resulting state is used. Adds an animation state to the ActorMultiVertex. The state_data table must be like this:
{{left, top, right, bottom}, delay}
left, top, right, and bottom are pixel coordinates, starting at 0. If delay is 0 or negative, the state will last forever.
Forces the AMV to update the texture coordinates on all its quads, even if the current state has not changed. Returns whether the AMV uses the animation state. Sets whether the AMV uses the animation state.
This works best when using DrawMode_Quads.
AMV's can have animated textures like sprites. Each state tells the AMV what part of the texture to use, and how long the state lasts.
Use AddState to add a state onto the end, or SetStateProperties to set all the states at once, or SetState to set a single state.
Each quad has its own offset that is added to the current state. Use AddQuadState to add to the list of quad states, or SetQuadState to set an existing quad state.
Returns the number of states the AMV has. Returns the number of quad states in the destination tween state for the AMV. Returns the id of the current state. Gets whether the AMV should call the decode function for its texture during updates. Sets whether the AMV should call the decode function for its texture during updates. Sets the current state. Returns the offset of the requested quad state. Sets the offset of the requested quad state. Returns a table containing the data for the requested state. Sets the requested state to the data in state_data. Similar to AddState, but SetStateData only works on states that have already been added. Each element of the table must be a state_data table, and is used to construct one state. The table as a whole is the entire list of all states for the AMV. Removes the requested state from the state list. Removes the requested quad state from the quad state list. Sets the delay for every state to delay. Sets how far into its animation the AMV is. Sets vertex number index with the properties provided. The tables of properties are each optional and can be provided in any order. Sets multiple vertices at once. The elements of vertices should themselves be tables, of the form provided to SetVertex. If vertices is the first argument it will start from vertex 1. If an integer is provided before vertices it will start from that vertex. It will add vertices as necessary. Example: self:SetVertices( { { { x1, y1, z1 } , { r1,g1,b1,a1 } , { tcx1,tcy1 } }; { { x2, y2, z2 } , { r2,g2,b2,a2 } , { tcx2,tcy2 } } } ) Sets all the drawn verts of the ActorMultiVertex by evaluating the splines.
("all the drawn verts" means all the verts between FirstToDraw and NumToDraw, the verts that are set to draw in the current tween state.)
The parts of the ActorMultiVertex are evenly spaced along the spline in terms of t value.
The exact behavior depends on the draw mode.
DrawMode_Quads uses all 4 splines, one for each corner.
DrawMode_QuadStrip and DrawMode_Strip use 2 splines, one for each edge of the strip.
DrawMode_Fan uses one spline, for the edge verts of the fan. The first vert is not touched because it is the center.
DrawMode_Triangles uses 3 splines, one for each corner.
DrawMode_SymmetricQuadStrip uses 3 splines, one on each edge and one in the center.
DrawMode_LineStrip uses 1 spline.
Returns the requested spline. Spline indices range from 1 to 4.
ActorMultiVertex splines are not inside the tween state, and will not change the verts until you call SetVertsFromSplines.
Sets the number of vertices. Returns the number of vertices Sets the draw state variables to the values in the table.
Mode must be a .
First is the index of the first vertex to draw.
Num is the number of vertices to draw. -1 for Num means draw all verts after First.
Any value not in the table defaults to the already set value.
Examples:

-- Sets all three parts of the draw state.
self:SetDrawState{Mode="DrawMode_Quads", First= 1, Num= -1}
-- Set only the draw mode.  First and Num remain unchanged from previous.
self:SetDrawState{Mode="DrawMode_Quads"}
-- Set the first and number to draw.  Draw mode remains unchanged.
self:SetDrawState{First= 3, Num= 4}
Get the DrawMode of the destination tween state. Get the FirstToDraw of the destination tween state. Get the NumToDraw of the destination tween state. Get the DrawMode of the current tween state. Get the FirstToDraw of the current tween state. Get the NumToDraw of the current tween state. Returns the ActorMultiVertex's texture. Sets the of the ActorMultiVertex. Sets the of the ActorMultiVertex. Sets the width of the line for DrawMode_LineStrip. Sets the texture to texture Sets the texture at from the file path path.
Returns the target of the ActorProxy. Sets the ActorProxy target to a. Returns the scroller's current item. Returns the item the scroller's going to. Returns how long it will take for the scroller to completely scroll through all its items. Returns the number of items in the ActorScroller. Returns the number of seconds the scroller pauses between items. Returns the number of seconds until the scroller reaches its destination. Compatibility alias for . Positions the scroller items. Scrolls through all the items in the scroller. Compatibility alias for . Scrolls through all the items in the scroller with padding at the beginning and end. Compatibility alias for . Sets the item the scroller should scroll to next and makes it the current item. Sets the item the scroller should scroll to next. Sets if the scroller should catch up fast. Compatibility alias for . Specifies if the scroller should loop or not. Sets the scroller's mask to a Quad that is fWidth by fHeight pixels. Sets the scroller to draw fNumItems items. Sets the number of subdivisions in the scroller. Compatibility alias for . Sets the scroller's pause countdown to fSecs. Sets the scroller's pause between items to fSeconds. Sets how many seconds the scroller should spend on each item.
A value of 0 means the scroller will not scroll.
Compatibility alias for . Sets the scroller's transform function to the specified Lua function. Sets the scroller's transform function from fItemHeight. Sets the scroller's transform function from fItemWidth.
This actor represents a playable sound. Though the C++ class is ActorSound, it is accessible to Lua via Def.Sound.
You must provide ActorSounds with a filepath to the asset using their File attribute.

Def.Sound{
	File="./path/to/soundeffect.ogg",
	OnCommand=function(self)
		-- play this sound effect at the parent screen's OnCommand
		self:play()
	end
}
ActorSounds have three additional boolean attributes:
SupportPan - Let the sound pan from side to side.
SupportRateChanging - Let the sound change rate and pitch.
IsAction - If true, the sound is an action sound, and will be muted if the MuteActions preference is turned on.
Basic example:

Def.Sound{
	File="./path/to/soundeffect.ogg",
	SupportPan=true,
	SupportRateChanging=true,
	IsAction=false,
}
Returns the that can be played by this Actor. Returns whether the sound is an action. Loads the sound at sPath. Pauses or unpauses the sound based on bPause. Plays the sound. [02 Sound.lua] Plays the sound on the given player's side. You must set SupportPan = true on load. Sets whether the sound is an action. Stops the sound.
This singleton is accessible to Lua via ANNOUNCER. Returns true if Announcer sAnnouncer exists. Returns a table of installed announcers. Returns the current announcer's name. Sets the announcer to sNewAnnouncer. This singleton is accessible to Lua via HOOKS. Returns true if the application presently has focus. Returns the name of the architecture in use. Returns true if the Banner is currently scrolling. Loads the background from an UnlockEntry. Loads the banner from an UnlockEntry. Loads the card image from the specified Character. Loads the banner from the cache based on sPath (typically or ). Loads a Banner from a specified Course. Loads a Banner from a specified Song. Loads a Banner from a specified Song Group. Loads a Banner from a specified SortOrder. Loads an icon from the specified Character. See . See . BitmapText actors are used to display text on-screen.
The font can be specified using the Font attribute. It takes a font name as a string, pathed relative to the current theme's ./Fonts/ directory.
StepMania expects fonts to be formatted as spritesheets with accompanying ini files. These can be generated from ttf files using Texture Font Generator.exe in the ./Program/ directory of packaged StepMania releases.
The text displayed can be initially set using the Text attribute, and changed later using settext().
Basic usage example:

Def.BitmapText{
	Font="Common normal",
	Text="Hello!",
	OnCommand=function(self)
		self:sleep(2):settext("Hey!")
	end
}

The font can alternatively be specified with the File attribute, which takes the path to the ini file as a string, relative to the root of StepMania.
Basic example:

-- use a custom font from a simfile
local song_dir = GAMESTATE:GetCurrentSong():GetSongDir()
local ini_path = "Fonts/courier/_courier 20px.ini"

Def.BitmapText{
	File=song_dir .. ini_path,
	Text="Hello, World!"
}
Add the attribute attr to the string at position iPos.
The attribute is a table that must contain Length which specifies how many (multi-byte) characters the attribute is to apply. If Length=-1, then the attribute applies until another attribute overrides it.
If the table contains Diffuse, then the color value is applied to the range of text.
If the table contains Diffuses, then it should be an array of 4 colors which specify the diffuse color for the top left, top right, bottom left, and bottom right.
If the table contains Glow, then the color value is applied as a glow to the range of text.
Example:
attr = { Length = 10; Diffuse = color("#AABBCC"); }
Clear all attributes associated with the BitmapText. [02 Actor.lua] Sets the diffuse and stroke color of text in one command. Returns the text that is currently set. Causes each character of text to be randomly distorted by distortion_percentage of its size when the text is set. The distortion only changes when the text changes. Turns off distortion. Returns whether the diffuse colors in the attributes are multiplied by the general diffuse colors of the BitmapText. If mult_attrs_with_diffuse is set to true, then the diffuse colors in the attributes are multiplied by the general diffuse colors of the BitmapText. If bJitter is true, move each character of the string around by a small random amount. If use_zoom is true, this BitmapText will use the zoom that has been applied to it when calculating to change its base zoom from maxheight or maxwidth. Set the maximum height of the unzoomed text to fHeight. If fHeight is 0, then there is no maximum height. Set the maximum width of the unzoomed text to fWidth. If fWidth is 0, then there is no maximum width. [02 Actor.lua] Remove any stroke color. [02 Actor.lua] Alias for setting to false. If true, set each character of the text in turn to the rainbow colors in the metrics BitmapText::RainbowColor#. Set the text to sText. This clears all attributes. [02 Actor.lua] Sets text using string.format(sFormat, ...). [02 Actor.lua] Alias for . Sets the stroke color to c. If the text is glowing, specify if just the stroke layer, just the inner layer, or both are affected by the glow. If true, make all text uppercase. Add iSpacing pixels of padding between lines of text. Wrap the unzoomed text at iWidth pixels. If you or by x and you want the text wrapped at width, then you should use wrapwidthpixels(width/x).
Returns the text that is currently set at the exact moment you call it. This is likely only going to be useful in an Update command. Sets the BPMDisplay from the specified Course. Sets the BPMDisplay from the GameState. Sets the BPMDisplay from the specified Song. Sets the BPMDisplay from the specified Steps. Returns the path to the character's card graphic. Returns this character's directory. Returns this character's ID. Returns the path of the dancing animation of this character. Returns the character's display name. Returns the path to the character's icon. Returns the path of the model of this character. Returns the path of the rest animation of this character. Returns the path to the character's ScreenSelectMode icon. Returns the path to the character's ScreenStage icon. Returns the path of the warm-up animation of this character. This singleton is accessible to Lua via CHARMAN. Returns a table of all characters installed. Return the corresponding to sID. Returns a random character. Returns the number of characters available. Loads the ComboGraph commands from the Metrics in group sMetricsGroup. Sets the values of the ComboGraph using the specified StageStats and PlayerStageStats. Loads the ControllerStateDisplay from the specified GameController. Loads the ControllerStateDisplay from the specified MultiPlayer. Returns true if all of the songs in the course have been defined (as opposed to random songs). Returns a table of all the Trails in the Course. Returns the path to the Course's background. Returns the path to the Course's banner. Returns the path to the crs file for this Course, for example "/Courses/Default/MostPlayed_01_04.crs". Returns a table of CourseEntry items. Gets the CourseEntry at iIndex from the Course. Returns the Course's . Returns the description for this Course. Returns the full display title of the Course. Returns the estimated number of stages for the Course. Returns the goal seconds for the Course. Returns the Course's group name. Returns the Course's . Returns the name of the person who scripted the Course. Returns the total length of the Course in seconds. Returns the full transliterated title of the Course. Returns true if the Course has a background. Returns true if the Course has a banner. Returns true if the Course has modifiers. Returns true if the Course has timed modifiers. Returns true if the Course is an edit. Returns true if the Course was automatically generated. Returns true if the Course is Endless. Returns true if the Course is Nonstop. Returns true if the Course is Oni. Returns true if the Course is playable in StepsType st. Returns true if the Course is a ranking course. Sets the CourseContentsList from the GameState. Returns the Song that this CourseEntry corresponds to. Returns the number of lives gained after completing the song. Returns the number of seconds gained after completing the song. Returns any stage (non-timed) modifiers. Returns the number of modifier changes in this CourseEntry. Returns a comma-delimited string representing various facts about the CourseEntry. Returns true if this CourseEntry is a fixed song. Returns true if this CourseEntry is secret. This singleton is accessible to Lua via CRYPTMAN. Generates a random UUID (version 4). Returns the MD5 hash for the file at sPath. Returns the MD5 hash for s. Returns the SHA-1 hash for the file at sPath. Returns the SHA-1 hash for s. Returns the SHA-256 hash for the file at sPath as a binary formatted string.
You can use to convert to hexadecimal format.
Returns the SHA-256 hash for s as a binary formatted string.
You can use to convert to hexadecimal format.
All functions in this class have camel case equivalents, use whichever naming style you prefer.
This spline implementation is a cubic spline.
A spline is a line calculated from a small set of points with mathematical smooting applied.
Splines can have any number of dimensions, but splines owned by actors (the ones inside NCSplineHandler and ActorMultiVertex) always have 3 dimensions.
Solves the spline, setting the coefficients. Evaluates the spline at the given t value, returning a table of the results for each dimension of the spline.
t can range from 0 to the value returned by get_max_t().
A normal spline will return its starting point for any t value less than 0 and its end point for any t value greater than the max.
A looped spline adjust the t value to be within the its range by adding or subtracting the max t as needed. (so if the max t is 4 and you evaluate at 5, it will return the same as if you evaluated at 1.)
Evaluates the derivative at t. Evaluates the second derivative at t. Evaluates the third derivative at t.
Second and third derivative functions exist because they're possible, not because they're expected to be useful. The fourth derivative would be 0 because the equation for evaluating the spline is "a + (b*t) + (c*t^2) + (d*t^3)".
Sets point i of the spline to the position specified by the table p. Sets the coefficients of the spline at point i.
Each table must contain a value for each dimension of the spline.
Solving the spline normally should cover all normal usage, this is for people that want a spline with an abnormal behavior, so if you set the coefficients directly, expect to end up with an unsmooth shape.
Returns a table containing the tables of coefficients for the point i. Sets the spatial extent of dimension d of the spline to e.
The spatial extent exists to handle numbers that exist in a finite looped space, instead of the flat infinite space.
To put it more concretely, spatial extent exists to allow a spline to control rotation with wrapping behavior at 0.0 and 2pi, instead of suddenly jerking from 2pi to 0.0.
Returns the spatial extent of dimension d of the spline. Returns the max t value the spline extends to. For a normal spline, this will be size()-1. For a looped spline, this will be size(). Sets the number of points in the spline. You must set the number of points before trying to set the position of any point. Returns the number of points in the spline. Sets the number of dimensions the spline has.
Splines that are owned by actors (the ones inside ActorMultiVertex and NCSplineHandler) cannot have their number of dimensions changed because the actors require them to have 3 dimensions.
Returns the number of dimensions the spline has. Returns true of the spline has zero points, or false if it has more than zero points. Sets whether the spline is looped. A looped spline is one where the end point is connected to the start point. Returns whether the spline is looped. Sets whether the spline is polygonal. If the spline is polygonal, then it will have straight lines between the points instead of curves. Returns whether the spline is polygonal. Sets whether the spline is dirty. A dirty spline is one that has been changed in some way that affects its shape. When solve() is called, the spline will only be solved if it is dirty. The dirty flag is automatically set by everything, so you should never have to call this function. Returns whether the spline is currently dirty. Destroys the spline, freeing the memory allocated for it. This can only be called on splines created with create_spline().
A newline-delimited list of available input devices.
The list shown will the same as that returned by INPUTMAN:GetDescriptions(), but with "MonkeyKeyboard" removed.
Sets the DifficultyIcon's state from the difficulty passed in. Sets the DifficultyIcon's Player to pn, then sets the DifficultyIcon's state from the difficulty of Steps pSteps Sets the DifficultyIcon's Player to pn, then sets the DifficultyIcon's state from the difficulty of Trail pTrail Sets the DifficultyIcon's Player to pn. Blanks the DifficultyIcon. Return the width of the display in this mode. Return the height of the display in this mode. Return the refresh rate of the display in this mode. An object describing a display: its supported and current video modes. Return the unique identifier of the display. Return the "human-readable" display name. Return the s supported by this device. Return the currently active for this display, or nil if there is no such mode. Return true if this DisplaySpec is describing the "logical display" like an X screen or the Win32 "Virtual screen", or false otherwise (if this describes a physical display). An array-like userdata object which describes the displays configured on the user's machine. This object supports the __len operator (#t), and integer indexing, but does not support iteration via pairs or ipairs. Each element of the array is a . Return the number of instances in the array. Return the instance at index i Returns the index of the last banner loaded. Loads the fallback course banner. Loads the fallback banner. Loads the card image from the specified Character. Loads a Banner from a specified Course. Loads a Banner from a specified Song. Loads a Banner from a specified Song Group. Loads a Banner from a specified SortOrder. Loads an icon from the specified Character. Loads the Random banner. Loads the Roulette banner. See . See . Sets the StepsDisplayList from the GameState. Returns true if notes are counted separately in this game. Returns the mapped judgment for tns. Returns the name of the game such as "dance" or "pump". Returns whether this game allows the players to have separate styles. Returns any announcer that may have been set. Returns any Character associated with this item (or nil if there isn't one). Returns any Course that may have been set. Returns a course difficulty, if one is set in the GameCommand. Returns a difficulty, if one is set in the GameCommand. Returns the index of this item. Returns any MultiPlayer that may have been set. Returns the choice name. Returns the PlayMode associated with this GameCommand. Returns any preferred modifiers that may have been set. Returns any Profile ID that may have been set. Returns any screen that may have been set as a string. Returns any Song that may have been set. Returns the name of any song group that may have been set. Returns the sort order, if the GameCommand has set one. Returns any stage modifiers that may have been set. Returns any Steps that may have been set. Returns any Style that may have been set. Returns the display text. Returns any Trail that may have been set. Returns any Url that may have been set. This singleton is accessible to Lua via GAMEMAN. Return the first for the specified game. Returns true if any noteskins exist for the specified Game s. Return the localized string representation of st. Returns a table of all selectable games. Returns a table of all the styles for the that exist for game. Sets the current game to Game. The second argument is optional, and if provided will determine which theme is loaded when the game changes. If the second argument is not provided, the default theme from the preferences for the new game type will be loaded.
If only the game changes, the screen specified by the Common::AfterGameChangeScreen metric will be loaded.
If the game and the theme both change, the screen specified by the Common::AfterGameAndThemeChangeScreen metric will be loaded.
The Common::InitialScreen metric will be used if the appropriate metric for the change is blank or invalid.
This singleton is accessible to Lua via SOUND. Set the music volume to fVolume for fDuration seconds. Return the sound balance for pn. Plays a sound from the current announcer. Play the sound at musicPath starting from musicStart for musicLength seconds one time. Both fadeIn and fadeOut can be customized as required. loop tells the sound manager to loop the music part. applyRate tells the sound manager to apply the current music rate. If alignBeat is true or nil, the length is automatically adjusted to cover an integer number of beats. Play the sound at sPath one time. is_action is optional, if it is true, the sound is an action sound, and will be muted if the MuteActions preference is turned on. Stops the music. When music is requested to change, the new music does not start immediately due to latency and buffering. This will return true if the newest music has not yet actually begun. This singleton is accessible to Lua via GAMESTATE. Adds another stage to the specifed player. Applies the specified modifiers for the specified player's preferred modifier set. Applies the song options of ModsLevel_Preferred to the other ModsLevels. Applies the specified modifiers for the specified player for the current stage. Returns true if any player has performed a feat worthy of ranking. The second argument is optional. Apply the GameCommand represented by sCommand for pn, if given. See . Checks various things to determine whether the game will crash when gameplay starts. Returns false and an error string if gameplay cannot be entered safely.
Might not work in all cases, but will catch things like a player not having steps set or no current song or style. Mainly exists for people with a custom ScreenSelectMusic replacement.
Example:

local can, reason = GAMESTATE:CanSafelyEnterGameplay()
if not can then
	lua.ReportScriptError("Cannot safely enter gameplay: " .. tostring(reason))
end
Removes any stage modifiers that are illegal for course play. Returns true if pn's options will disqualify them for ranking. Returns true if enough credits have been inserted to join. fishpolk.mid; See also: Rise of the Triad Returns the environment table. See . Returns the current for the specified . Returns the current . Return the number of inserted but unused coins. This number is decremented when players join. Return the number of coins needed to join based on the current coin and premium modes as well as the number of people joined, if that matters for the premium mode. See and . The s in a are numbered sequentially starting from 0. Return the number of the current . Return the current number of seconds that have passed in the current song. This value can be negative. Return the current . Return the current . Return the current . Return the current . Returns the current stage index (starts at 0). Return the current for the specified Player. Return a variable number of arguments based on the being played by all players. For each distinct being played by the players, in increasing order, the difficulty and description of the is returned as strings.
For example,
local credits = {GAMESTATE:GetCurrentStepsCredits()};
will make a table of the difficulties and descriptions.
Return the current . Return the current for the specified player. Return a string representation of the default song options. Returns the value. Return the easiest of the currently selected steps by all players. For example, if player 1 has selected Hard steps and player 2 has selected Medium steps, Medium will be returned. Return the Edit Local (during Profile editing) or nil if it does not exist. Returns the ID of the Edit Local (during Profile editing). Return the source for the editor or nil if it does not exist. Returns a table of enabled players. Returns the name of the currently expanded section. Return the random seed for the game. Return true if the gameplay lead in is enabled. If false, gameplay begins immediately. Return the hardest of the currently selected steps by all players. For example, if player 1 has selected Hard steps and player 2 has selected Medium steps, Hard will be returned. Returns an array of s corresponding to Human players. Returns the index of the next song in the course. Returns the master player number. Returns true if the game is Multiplayer. Returns the PlayerState for the specified MultiPlayer. Returns the number of active multiplayer NoteFields. Returns the number of players enabled. Returns the number of sides joined. Returns the number of stages for the current Song and its Steps or the current Course. Returns the number of stages left for player pn. Returns the display name for player pn. Returns the effective for player pn. Returns the PlayerState for player pn. Returns the current PlayMode. Returns the preferred difficulty for player pn. Returns the preferred song. Returns the preferred song group. Returns the current Premium. Returns the smallest number of stages left for any human player. [01 alias.lua] Returns the current beat of the song. [01 alias.lua] Returns the current beat of the song without an offset. Returns the current visible beat of the song. [01 alias.lua] Returns the song's current beats per second. [01 alias.lua] Returns true if a delay is active in the song. [01 alias.lua] Returns true if the song is currently in a freeze. Returns the song options for the specified ModsLevel as a string. Returns the song options as a string. Returns the song options for the specified ModsLevel as an object. Returns how much of the song is through at beat fBeat. Returns the current SongPosition. Returns the current SortOrder. Returns the StageResult for player pn. Returns the current stage index. Returns the current StepsSeconds, which is the time value used to set the samples in a player's life record. Return the random seed for the current stage. Returns true if the workout goal is complete. Returns true if an extra stage was earned. Returns true if either player does not have a profile loaded, and there is a loadable profile. Returns true if either player has a profile loaded. Returns true if we are specifically in the Step Editor's editing portion. If in recording or playing mode, this will return false. Inserts iCoins number of coins. iCoins can be negative or positive. Inserts one credit. To deduct a credit, pass a negative integer representing the number of coins per credit to InsertCoin. Returns true if this is an extra stage. Returns true if any human player is using a memory card. Returns true if playing in Battle mode. Returns true if playing in a Course mode. Returns true if in Demonstration mode. Returns true if the match was a draw. Returns true if Event Mode is on, temporary or otherwise. Returns true if this is the first extra stage. Returns true if this is the second extra stage. Returns true if player pn has completed the current Goal. Returns true if player pn is human. Returns true if player pn is enabled. Returns true if player pn has joined the game. Returns true if player pn is the winner. Joins player pn. Does not deduct coins. Similar to JoinPlayer, but checks whether the player is allowed to join and returns false if the player is not allowed to join. Also deducts coins for joining. A player can't join if PlayersCanJoin() returns false, or that side is already joined (is true for both sides when in a style that is OnePlayerTwoSides), or there are not enough coins. If profiles are not loaded, this will load the profiles for each player. It will load from memory cards if they are present, and local profiles otherwise. It will load edits if LoadEdits is true, or by default if the argument is omitted. Returns true if player pn is using modifier sModifier. Returns true if players can join the game. Refreshes the NoteSkin data for the current game. Resets the GameState. Resets the specific Player's mods to the default settings. Saves the bookkeeping and machine profile data. Save profiles. Sets the current for the specified . Sets the current Course to course. Sets the current PlayMode to pm. Sets the current Song to song. Sets Player pn's current Steps to steps. Sets current Style to the provided style. Either a style object or a style string can be provided. If current steps for either player are not valid in the new style, they will be cleared. Sets the current Trail to trail. Tells the engine that the theme explicitly set the fail type for the players so that it won't override it with the easier settings for beginner or easy. Sets if the Jukebox should use modifiers. Sets the number of multiplayer notefields to iFields Sets the preferred difficulty of Player pn to Difficulty dc. Sets the preferred Song to song. Sets the preferred song group to sGroup. Sets the Song Options from so using ModsLevel m. Turns temporary Event Mode on or off, depending on bOn. Stores the ranking name for the player. Use this at the end of a round, on a name entry screen or similar, to set the name for the high scores the player has earned. Determines if Judgment W1 should be shown based on bOn. Unjoins player pn.
Loads the GradeDisplay commands from the Metrics in group sMetricsGroup. Sets the GradeDisplay to show Grade g. Loads the GraphDisplay commands from the Metrics in group sMetricsGroup. Sets the values of the GraphDisplay using the specified StageStats and PlayerStageStats. Sets the GrooveRadar values for Player pn to empty. Sets the GrooveRadar values for Player pn from RadarValues rv Sets the GrooveRadar values for Player pn to the specified (floating point) values in the table. Returns two tables representing the tips and alternate tips in the HelpDisplay. [02 HelpDisplay.lua] Sets the tips from a Song or Course. Sets the seconds between switches of tips to fSeconds. Sets the HelpDisplay's tips using tips (and optionally altTips). Sets the HelpDisplay's text from sTips using colons to separate new sections. Returns the date and time the high score was achieved. Returns the Grade of this high score. Return the number of HoldNoteScores that match hns. Returns the Max Combo of this high score. Returns the modifiers used for this HighScore. Returns the name associated with the high score. Returns the Peak Combo Award for this high score. Returns the percentage of dance points associated with the high score. Returns the RadarValues for this HighScore. Returns the score associated with the high score. Retrns the Stage Award for this high score. Returns the number of seconds survived associated with the high score. Return the number of TapNoteScores that match tns. Returns true if this high score's name uses a fill-in marker. You can get a HighScoreList using . Returns a table of the high scores. Returns the highest score for name in the list. Returns nil if there is no score for name in the list. Returns the rank of the highest score for name in the list. Returns 0 if there is no score for name in the list. (returns 1 if name has the top score, 2 if name has the second place score, and so on) Loads the HoldJudgment for the specified MultiPlayer. This singleton is accessible to Lua via INPUTFILTER. Returns the mouse wheel value. Returns the X position of the mouse. Returns the Y position of the mouse. A newline-delimited list of inputs that are currently being pressed. It will update as inputs are held and released. Handy for custom TestInput screens. Returns the amount of life left in the LifeMeter as a float in the range 0..1. Returns true if failing. Returns true if the LifeMeter is "hot". Returns true if in danger. Changes the player's life by iNumLives. (Negative values subtract lives.) Returns the number of lives remaining. Returns the number of total lives. This singleton is accessible to Lua via MEMCARDMAN. Returns true if player pn's card is locked. Return the state for player pn. Returns the name of the storage device. Returns true if player pn's name is available. Stops the MenuTimer by setting it to 99.99 and pausing. Returns the current MenuTimer's value. Pauses the MenuTimer, stopping it from counting down. Compatibility alias for SetSeconds. Sets the MenuTimer's value to fSeconds. Sets the MenuTimer's silent setting to bSilent. Starts up the timer. Sets the MenuTimer's stealth setting to bStealth. If true, the timer will be invisible and silent. Stops the MenuTimer by setting it to 0 and pausing. This singleton is accessible to Lua via MESSAGEMAN. Broadcast the message to all listeners subscribed to sMessage. The second argument is an optional table of parameters. It may be omitted or explicitly set to nil. Sets whether logging of messages is enabled. If log is true, all messages that pass through Broadcast (from the engine for from the theme or from anywhere else), will be logged with Trace. Sets the width of the MeterDisplay to fWidth. Returns the model's default animation. Controls if the model should loop or not. Plays animation sAniName at fPlayRate speed (default 1.0). Sets how far into the animation the model is. Sets the current animation's playback rate to fRate. Sets the model's default animation to sAnimation at fPlayRate speed (default 1.0). Returns the number of states the Model has. Loads the ModIconRow of Player pn from the Metrics in group sMetricsGroup. Changes the sort order of the wheel. Returns true if the order was changed. Returns a string array of the currently displayed sections in the MusicWheel. Returns the name of the currently selected section. Returns true if the MusicWheel is currently handling Roulette selection. Moves the wheel by n. Selects a course. Returns false on failure. Selects a song. Returns false on failure. This singleton is accessible to Lua via NETWORK.
By default, access to the network is disabled for all target hosts. It can be enabled by setting HttpEnabled=1 in the preferences. Individual hosts have to be added to HttpAllowHosts as a comma separated list to allow access.
Returns true if access to url is allowed. Performs an HTTP request.
Usage example:

NETWORK:HttpRequest{
	url="https://api.example.com",
	method="GET",                                   -- default: "GET"
	body="",                                        -- default: ""
	multipartBoundary="",                           -- default: ""
	headers={                                       -- default: {}
		["Accept-Language"]="en-US",
		["Cookie"]="sessionId=42",
	},
	connectTimeout=3,                               -- default: 60
	transferTimeout=10,                             -- default: 1800
	downloadFile="",                                -- default: no download file
	onProgress=function(currentBytes, totalBytes)   -- default: no callback
		...
	end,
	onResponse=function(response)                   -- default: no callback
		...
	end,
}
Everything but url is optional. Supported methods are GET, POST, PUT, PATCH, DELETE and HEAD.
A response looks like this:

{
	statusCode=200,
	headers={
		["Content-Type"]="application/json",
		["Cache-Control"]="max-age=172800",
		["Server"]="Apache",
	},
	body="{...}"
	uploadSize=204,
	downloadSize=216,
}
In case of an error the callback is called with a structure like this:

{
	error="HttpErrorCode_Blocked",
	errorMessage="access to https://api.example.com is not allowed",
}
If the downloadFile parameter is set, the response body is not accumulated in memory, but written to /Downloads/${downloadFile}. The file is available in the onResponse callback where it can be unzipped/copied to another location using FILEMAN:Unzip()/FILEMAN:Copy() respectively. The file is deleted once the callback returns.
Open a WebSocket connection.
Usage example:

NETWORK:WebSocket{
	url="wss://api.example.com/chat",
	headers={                                       -- default: {}
		["Accept-Language"]="en-US",
		["Cookie"]="sessionId=42",
	},
	handshakeTimeout=3,                             -- default: 60 seconds
	pingInterval=10,                                -- default: disabled
	automaticReconnect=false,                       -- default: true
	onMessage=function(message)                     -- default: no callback
		...
	end,
}
Everything but url is optional.
Messages look like this:

-- Data
{
	type="WebSocketMessageType_Message",
	data="some data",
	binary=false,
}

-- Open
{
	type="WebSocketMessageType_Open",
	uri="/chat",
	headers={
		["Date"]="Fri, 27 May 2022 18:50:47 GMT",
	},
	protocol="",
}

-- Close
{
	type="WebSocketMessageType_Close",
	reason="Normal closure",
	remote=false,
}

-- Error
{
	type="WebSocketMessageType_Error",
	retries=1,
	waitTime=100,
	httpStatusCode=404,
	reason="Expecting status 101 (Switching Protocol), got 404",
	decompressionError=false,

}
Returns the URL encoded representation of value. Returns the query encoded as a query string. Keys and values are automatically URL encoded.
This singleton is accessible to Lua via NOTESKIN. Returns a string from the specified element and value. Returns a string from the specified element and value using NoteSkin sNoteSkin. Returns a command from the specified element and value. Returns a command from the specified element and value using NoteSkin sNoteSkin. Returns a bool from the specified element and value. Returns a bool from the specified element and value using NoteSkin sNoteSkin. Returns a float from the specified element and value. Returns a float from the specified element and value using NoteSkin sNoteSkin. Returns a integer from the specified element and value. Returns a integer from the specified element and value using NoteSkin sNoteSkin. Returns the path for the specified sButton sElement. Returns the path for the specified sButton sElement using NoteSkin sNoteSkin. Returns the actor for the specified sButton sElement. Returns the actor for the specified sButton sElement using NoteSkin sNoteSkin. Returns true if the strName noteskin exists in the current gametype. Returns a table of noteskin names for the current gametype. All functions in this class have camel case equivalents, use whichever naming style you prefer.
The spline handler holds info on how the spline is used by the engine.
Each get/set pair of functions in this class is for a different aspect of the spline's behavior.
Returns the spline for this handler. Returns the beats per t value of the spline. If the beats_per_t is 4, then a note must be on screen for 4 beats to traverse from one point on the spline to the next. Sets the beats per t value for the spline. Returns the t value that receptors are evaluated at. the t value that receptors are evaluated at. Returns the mode the spline is set to.
"NoteColumnSplineMode_Disabled" means the spline will not affect the notes or receptors at all.
"NoteColumnSplineMode_Offset" means the spline will added to the effects from the mods.
"NoteColumnSplineMode_Position" means only the spline affect the notes and mods will be ignored. (but only mods that affect the same aspect of the note as the spline will be disabled. So a rotation spline won't disable Mini or Tiny, but a zoom spline will, and a zoom spline won't disable Dizzy, Twirl, or Roll, but a rotation spline will.)
Sets the current spline mode for this handler. Returns whether the current song beat is subtracted from a note's beat when calculating the t value to use on the spline. Sets whether the current song beat is subtracted from a note's beat when calculating the t value to use on the spline.
All functions in this class have camel case equivalents, use whichever naming style you prefer.
Position, rotation, and zoom each have separate spline handlers to allow them to have separate independent behavior.
It is important to note that the spline handlers are inside the tween state, so whenever you start a new tween on the actor, you need to refetch the spline handlers.
Returns the handler for the position spline. Returns the handler for the rotation spline.
The rotation applied by the rotation spline is in radians.
For convenience, the spatial extent of the rotation spline defaults to 2pi.
Returns the handler for the zoom spline.
All functions in this class have camel case equivalents, use whichever naming style you prefer.
Camel case functions do not have snake case equivalents, though.
Makes the NoteField act as if a hold note was hit in the column, with the given score and bright setting.
The callback for did_hold_note will not be called.
Makes the NoteField act as if a tap note was hit in the column, with the given score and bright setting.
The callback for did_tap_note will not be called.
Returns whether beat bars are enabled on this NoteField. Returns a table of the actors for the columns. This means that each column is an actor, so you can move it around or animate it like an actor. See the NoteColumnRenderer class for a list of special functions for the column's actor. Sets whether beat bars are enabled on this NoteField. Sets the alpha for the beat bars on this NoteField. Specify the alpha for the measure, fourth, eighth, and sixteenth beat bars at the same time. Same as SetDidTapNoteCallback, but for hold notes. Uses HoldNoteScore instead of TapNoteScore. Sets the function that the NoteField will call whenever a tap note is hit.
The callback function is passed the column, the TapNoteScore, and whether the explosion will be bright.
The callback function can return changed values for the NoteField to use instead of the ones that were passed.
Pass nil instead of a function to clear the callback.
Makes the NoteField act as if a press occurred in the column.
The callback for set_pressed will not be called.
Sets the function that the NoteField will call whenever a press occurs.
The callback function is passed the column for the press.
The callback function can return changed values for the NoteField to use instead of the ones that were passed.
Pass nil instead of a function to clear the callback.
Sets the function that the NoteField will call whenever a step occurs.
The callback function is passed the column and the TapNoteScore for the step.
The callback function can return changed values for the NoteField to use instead of the ones that were passed.
Pass nil instead of a function to clear the callback.
Makes the NoteField act as if a step occurred in the column with the given score. The callback for Step will not be called.
Returns true if the first item in the row goes down. Returns an index of the choice in the row that player pn is on. Returns the OptionRow's layout type. Returns the name of the OptionRow. Returns the number of choices in this OptionRow. Returns the row title string. Returns the OptionRow's select type. Returns true if this row is focused by player pn. Returns true if this row forces one choice on all players. Sets the PaneDisplay from the GameState. Sets the PercentageDisplay from the specified PlayerState and PlayerStageStats. Changes the life value by delta. This will broadcast a LifeChangedMessageCommand, to allow custom life bars to update to the new value. Do not call ChangeLife from within LifeChangedMessageCommand. Sets the life to value. This will broadcast a LifeChangedMessageCommand, to allow custom life bars to update to the new value. Do not call SetLife from within LifeChangedMessageCommand. Returns the current TimingData for this player. Sets Actor with Combo position. Sets Actor with Judgment position. (PlayerInfo is a part of ScreenGameplay.) Returns the of player pn. Returns the Steps located at index in the current steps queue. All these functions have an optional last argument: If the last argument is the boolean value true, then instead of returning the previous settings as normal, they will instead return the PlayerOptions object.
This allows you to chain them like this:
player_options:Twirl(5, 1, true):Roll(5, true):Dizzy(true):Twirl()

Functions that take a bool as their arg must have true as the second arg to be used with chaining.
player_options:Backwards(true, true):Beat(5) will chain. player_options:Backwards(true):Beat(5) will not chain.

Most options fall into one of four types: float, int, bool, or enum.
Float type options have this interface:
Option(value, approach_speed)
If value is a float, sets the TimeSpacing modifier to value.
If approach_speed is a float, sets the speed of the transition to approach_speed. Returns the previous values of both.
approach_speed is in units of n per second. value will be approached at the rate of approach_speed per second.
Note that the value and the approach speed arguments are both independently optional.
Example:

-- Sets a to the current value and b to the current approach_speed
a,b = options:Boost()

-- Stores the previous values in a and b, NOT to 5 and .5
-- Sets the value to 5 and the approach speed to .5
a,b = options:Boost(5, .5)

-- Sets a and b to the previous values, NOT to 5 and .5
-- Sets the value to 5 and leaves the approach speed at whatever it was
a,b = options:Boost(5)

Setting the approach speed only matters when modifying the PlayerOptions from ModsLevel_Song.
Int type options are similar to float in that they return and take a number, but they do not have an approach speed.
Bool type options have an almost identical interface, the difference is that they can not have an approach speed.
Enum type options are almost identical to bool type. They take and return an enum value.
For brevity, the functions are only given a description if the option requires careful handling or does not follow the float or bool interfaces.
Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Use 1-16 in place of 'n' to apply Bumpy on a specific column. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. If the player has a CMod set, returns the value of that CMod and its associated approach speed. Returns nil otherwise.
If the optional first argument is passed, sets the CMod to the value and disables any XMod or MMod that is set.
If the optional second argument is passed, sets the speed at which the transition occurs.
Use 1-16 in place of 'n' to apply ConfusionOffset on a specific column. Use 1-16 in place of 'n' to apply ConfusionXOffset on a specific column. Use 1-16 in place of 'n' to apply ConfusionYOffset on a specific column. Use 1-16 in place of 'n' to apply Dark on a specific column. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Selectively disable specific timing windows for a player.
Valid values are W1 to W5 as defined in the enum.
If the player is using Distant (zero skew and positive tilt), returns the value of tilt and its approach_speed.
Returns nil otherwise.
If the optional first argument is passed, sets tilt to value and skew to zero.
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Sets the for the player, if the optional argument is provided. Returns the that was previously set. Returns a table of the currently disabled s for the player. Returns true if step attacks or random attacks are enabled. Returns true if the current PlayerOptions makes the current Course/Trail easier. Returns true if the current PlayerOptions makes the current Song/Steps easier. If the player is using Hallway (zero skew and negative tilt), returns the value of tilt and its approach_speed.
Returns nil otherwise.
If the optional first argument is passed, sets tilt to negative value and skew to zero.
Pass in a positive value for the familiar meaning of Hallway.
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
If the player is using Incoming ((positive skew and negative tilt) or (negative skew and positive tilt)), returns the value of skew and its approach_speed.
Returns nil otherwise.
If the optional first argument is passed, sets tilt to negative value and skew to value.
Pass in a positive value for the familiar meaning of Incoming.
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
Sets the effect clock of certain modifiers for the player, if the optional argument is provided. Returns the that was previously set.
Can also be set through strings in PlayerOptions::FromString().
String Examples: 'ModTimerSong', 'modtimerbeat', etc.
MaxScrollBPM is one of the variables for controlling the speed mod.
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
It is the setting for the MMod.
MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
Sets the min TapNoteScore required for the notes to disappear after being hit. If the player has a MMod set, returns the value of that MMod and its associated approach speed. Returns nil otherwise.
If the optional first argument is passed, sets the MMod to the value and disables any CMod or XMod that is set.
If the optional second argument is passed, sets the speed at which the transition occurs.
MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
Use 1-16 in place of 'n' to move a specific column. Use 1-16 in place of 'n' to move a specific column. Use 1-16 in place of 'n' to move a specific column. Sets the NoteSkin to the named noteskin, unless name is nil or the NoteSkin does not exist. Returns the name of the previous NoteSkin and whether the set attempt succeeded.
Changing the NoteSkin during gameplay is not supported.
Example:

-- Sets note_name to the player's current noteskin
note_name = options:NoteSkin()

-- Sets prev_note_name to the noteskin the player had set
-- changes the current noteskin to "cel"
-- sets succeeded to true if the "cel" noteskin exists.
prev_note_name, succeeded = options:NoteSkin("cel")
If the player is using Overhead (0 tilt, 0 skew), returns true.
If true is passed, sets the tilt and skew to 0.
Re-enable all s that may have previously been disabled. Use 1-16 in place of 'n' to apply Reverse on a specific column. ScrollBPM is one of the variables for controlling the speed mod.
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
It is the setting for the CMod.
ScrollSpeed is one of the variables for controlling the speed mod.
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
It is the setting for the XMod.
Skew is one of the mods for controlling the perspective. Use Overhead, Distant, Incoming, Space, Distant, or Hallway for controlling the perspective in the old way.
Skew moves the vanishing point for the note field away from the center of the screen.
Skew has no effect in single mode if Center1Player is true.
Skew has no effect in double mode.
If the player is using Space ((positive skew and positive tilt) or (negative skew and negative tilt)), returns the value of skew and its approach_speed.
Returns nil otherwise.
If the optional first argument is passed, sets tilt to value and skew to value.
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
Use 1-16 in place of 'n' to apply Stealth on a specific column. TimeSpacing is one of the variables for controlling the speed mod.
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
It controls whether the speed mod is in X mode or C mode. It should only be set to 0 or 1, and is only a float value to allow tweening between the two states.
Tilt is one of the mods for controlling the perspective. Use Overhead, Distant, Incoming, Space, Distant, or Hallway for controlling the perspective in the old way.
Tilt tilts the note field forward and back.
Use 1-16 in place of 'n' to apply Tiny on a specific column. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Has a tangent variant that can be accessed by prepending 'Tan' to the function name. Returns true if the player is using reverse. (equivalent to GetReverse() == 1.0) The time in seconds to adjust a player's visual delay by.
Negative values will shift the arrows up, while positive values will push them down.
Sub-millisecond visual delay values are not saved and are instead rounded to the closest millisecond.
If the player has a XMod set, returns the value of that XMod and its associated approach speed. Returns nil otherwise.
If the optional first argument is passed, sets the XMod to the value and disables any CMod or MMod that is set.
If the optional second argument is passed, sets the speed at which the transition occurs.
Fails the player. Returns true if a full combo (TNS_W3 and up) was obtained. Returns true if a full combo (tns and up) was obtained. Returns the number of Dance Points obtained by the player. Returns how long the player has been alive. Returns the best tap note score for a full combo. Returns the number of calories burned. Returns a table of all the combos. Each entry in the table is a table containing the StartSecond, SizeSeconds, Count, Rollover, StageCount, and IsZero information for that combo. Returns the current possible maximum score. Returns the player's current combo. Returns the player's current life from 0..1. Returns the player's current miss combo. Returns the number of Dance Points possible to be obtained by the player. Returns the player's current score multiplier. Returns true if the player failed. Returns the player's grade. Returns the HighScore for this PlayerStageStats. Returns the number of judgments for a specified HoldNoteScore. Returns the player's actual score on the lesson. Returns the score needed to pass the lesson. Returns table of samples of the life record from 0 to last_second. 'samples' determines the size of the table. 'samples' defaults to 100 if not specified. Returns the player's life remaining seconds. Returns the machine high score index for this performance. Returns the number of controller steps. Returns the peak combo award for this performance. Returns the personal high score index for this performance. Returns a table of played steps. Gets the percentage of taps that were scored as tns. Returns the player's Dance Point percentage. Returns the number of possible Dance Points. Returns a table of possible steps. Returns a RadarValues object representing the player's actual performance. Returns a RadarValues object representing the total values for the song. Returns the score. Returns the number of songs passed. Returns the number of songs played. Returns the stage award for this performance. Returns how long the player survived in seconds. Returns the number of judgments for a specified TapNoteScore. Returns the max combo for this performance. Returns true if the player was disqualified from ranking. Sets the Dance Point limits of the stage. Applies the player options of ModsLevel_Preferred to the other ModsLevels. Returns the current PlayerOptions for this PlayerState. Returns the HealthState for this PlayerState. Returns the multiplayer number for this PlayerState. Returns the PlayerController for this PlayerState. Returns the player number for this PlayerState. Returns a PlayerOptions object for the specified ModsLevel. Returns a string of player options for the specified ModsLevel. (was GetPlayerOptions before sm-ssc v1.2.3) Returns a table of strings, containing the player options for the specified ModsLevel. Returns the SongPosition for this PlayerState. Returns the current Super Meter level for this PlayerState. Sets the player options to sPlayerOptions for the specified ModsLevel. This singleton is accessible to Lua via PREFSMAN. Return the value of the preference sPreference. Return true if preference sPreference exists. Set the value of the preference sPreference to value. Reset preference sPreference to the default value. Saves preferences to disk. Adds cals to the daily total. Adds a screenshot entry to the profile. filename must be the full path of the screenshot, as returned by SaveScreenshot. Calculates the number of calories burned based on the heart rate (in beats per minute), the duration (in seconds), and data in the profile. Returns the age. Returns a table of all high score names that have been used on this profile. Returns the birth year. Returns the number of calories burned during the current day. Returns the profile's high scores for the specified ranking category. Returns the Character being used by this profile. Returns a composite of your high scores over courses with the specified StepsType and Difficulty. Returns the percentage of courses that you've completed with the specified StepsType and Difficulty. Returns the possible score of courses with the specified StepsType and Difficulty. Returns the profile's display name. Return the number of calories burned as a string. Returns the number of calories needed to reach the goal. Returns the number of seconds needed to reach the goal. Returns the current goal type. Returns the GUID of this Profile. Returns whether this profile ignores the step count based calorie calculation. Returns whether this profile uses the male formula when CalculateCaloriesFromHeartRate is used. Gets the profile's HighScoreList for a specified Song and Steps. (Alternate arguments for Courses: Course c, Trail t) Gets the profile's HighScoreList for a specified Song and Steps. (Alternate arguments for Courses: Course c, Trail t)
If the profile does not have a HighScoreList for the Song and Steps, returns nil. Use this to avoid increasing the memory footprint of the profile when checking the score lists for every song and steps.
Returns the last played Course for this profile. Returns the last played Song for this profile. Returns the last used high score name. Returns the number of Toasties gotten using the specified profile. Returns the profile's most popular course. Returns the profile's most popular song. Returns the total number of songs played with the profile. Returns the position the profile should have in its category in the list. Returns the number of times song s has been played with the profile. Returns a composite of your high scores over songs with the specified StepsType and Difficulty. Returns the percent complete for all songs and courses for the specified StepsType st. Returns the percentage of songs that you've completed with the specified StepsType and Difficulty. Returns the possible score of songs with the specified StepsType and Difficulty. Return the total number of calories burned. Returns the number of dance points earned. Returns the number of Hands stepped on. Returns the number of successful Holds. Returns the number of Jumps stepped on. Returns the number of successful Lifts. Returns the number of Mines stepped on. Returns the total number of songs played with the profile. Returns the number of successful Rolls. Returns the number of steps with the specified StepsType and Difficulty that you've scored a certain Grade g on. Returns the number of Taps and successful Holds. Returns the number of trails with the specified StepsType and Difficulty that you've scored a certain Grade g on. Returns the type of the profile. The StepMania engine uses ProfileType to sort the list of profiles, with Guest profiles appearing first, then Normal, then Test.
Additional subsorting can be configured with .
Returns the user table for this Profile. Returns the VO2 max for this profile. Returns how much the player weighs. Returns true if the player has passed any steps in the specified Song s. Returns true if the specified code sUnlockEntryID is unlocked. Sets the birth year of the profile. Sets the current for the Profile. Sets the display name of the profile to name. Sets the goal to iCals calories. Sets the goal to iSecs seconds. Sets the current goal type to gt. Sets whether this profile ignores the step count based calorie counting. Sets whether this profile uses the male formula when CalculateCaloriesFromHeartRate is used. Sets last used high score name. Sets the VO2 max for the profile. 0 is treated as unset. Sets how much the player weighs (in pounds) to weightPounds. Returns the amount of time this profile has spent in gameplay (in seconds). Returns the number of sessions this profile has had. Returns the total session length (in seconds) of this profile.
This singleton is accessible to Lua via PROFILEMAN. Returns the Profile for the specified profile ID. Returns a table of the local profile display names. Returns a table of the local profile IDs. Retuns the machine profile. Retuns the amount of local profiles. Returns the player name for player pn. Returns the profile for player pn. Returns the profile directory for the provided ProfileSlot, formatted like /Save/LocalProfiles/00000001/.
Returns an empty string if the provided ProfileSlot does not have a loaded.
Returns the number of times Song s has been played with the specified ProfileSlot. Returns the current stats prefix. Returns true if player pn's profile is persistent. Returns true if Song s has never been played before (according to the machine profile). Returns true if the profile from the memory card is new. Returns true if pn's Profile was loaded from a memory card. Returns true if the last load of player pn's profile was a LastGood copy of the profile. Returns true if the last load of player pn's profile resulted in a tampered or corrupt profile. Saves the local profile with the specified ID. Saves the machine profile. Saves the profile for player pn. Sets the current stats prefix. The stats prefix is prepended to the Stats.xml file when loading or saving a profile. SetStatsPrefix will reload all profiles from the Stats.xml that has the given prefix. In general, score entries are the only thing not preserved when changing the stats prefix. Profile::HandleStatsPrefixChange in Profile.cpp lists the fields that are preserved.
Quads are rectangular actors that players can see. A Quad can have color, size, position, etc. Returns the value of rc from . You must call create_bezier to create a RageBezier2D to use any of these functions. When you are done with the object, destroy it with its destroy function to avoid a memory leak.
A RageBezier2D is two RageQuadratics, one for the x coordinate and one for the y.
This class is provided as a tool for designers working with bezier tweens who need a tool that displays the tween curve visually.
If you use Actor:tween(time, "TweenType_Bezier", {xa, ya, xb, yb, xc, yc, xd, yd}) to tween an actor, the actor creates a RageBezier2D internally and calls evaluate_y_from_x each frame to set where it is in the tween.
Destroys the RageBezier2D. Do not attempt to use it after it has been destroyed. Evaluates the bezier curve at the given t and returns the x and y values. This is equivalent to using get_x and get_y to fetch the quadratic parts and calling evaluate on them directly. Takes the x given and converts it to a t value, then evaluates the y quadratic with the t value and returns the result. Returns the RageQuadratic used for the x component. Returns the RageQuadratic used for the y component. Sets the values used by the two quadratics. This is equivalent to using get_x and get_y to get the quadratics and setting them directly. Note that the components for the x quadratic and the y quadratic are interleaved.
This singleton is accessible to Lua via DISPLAY. Return the height of the display. Return the width of the display. Return the number of frames per second. Return the VPF. Return the cumulative FPS. Return an array-like userdata of type , which describes the displays configured on the user's machine. Return true if the current renderer supports render-to-texture, false otherwise. Return true if the current renderer/window implementation supports a fullscreen borderless-window mode, false otherwise. These commands require a RageFile handle. You can create one using . Returns true if the current position within the file is the end. (EOF = End of File) Clears the last error message. Closes the file and releases it from memory. Safely deletes the file handle. Flushes the buffer for the file handle, writing any pending output to disk. Gets the last error message and returns it. Gets a line and returns it. Opens a file at sPath (relative to the StepMania root directory).
iAccessType can be set to read (1), write (2), stream (4) or flush to disk on close (8).
These can also be combined with addition. For example, to set up read and write, set iAccessType to 3 (1+2).
Puts a new line in the file. Returns a string containing the entire contents of the file. Returns length bytes from the RageFile's current position. Seeks to a position in the file and returns the new position. Returns the current position in the file. Writes a file with the contents of str.
This singleton is accessible to Lua via FILEMAN. Copies a file from fromPath to toPath. Returns true if the file was copied successfully. Returns true if a file exists at sPath. Returns a listing of files from sPath. The last two arguments are optional (and default to false). Returns a file's size in bytes. Returns the hash of the file at sPath. Unzips zip file at zipPath to targetPath.
strip is optional and defaults to 0. If set to a number larger than 0, that many components are removed from the paths of the extracted files. e.g. a/b/c is replaced with b/c when stripping one component or just c when stripping two.
Returns true if all files were extracted successfully.
This singleton is accessible to Lua via INPUTMAN. Returns an array of connected input device descriptions. If you use Actor:tween(time, "TweenType_Bezier", {a, b, c, d}) to tween an actor, the actor creates a RageQuadratic internally and calls evaluate each frame to set where it is in the tween. Evaluates the quadratic at the given t value and returns the result. Returns the four values that form the quadratic equation. This function returns multiple values, so you must do something like this to get them:
a, b, c, d= quadratic:get_bezier()
Equivalent to evaluate(1), but faster. Equivalent to evaluate(0), but faster. Returns the slope of the curve at the given t value. Sets the four values that form the quadratic equation. Sets the four values that form the quadratic equation, treating the arguments as from a cubic equation instead of as from a bezier curve.
See for loading a sound. Returns the length of the sound loaded into this RageSound. Returns -1 if no sound is loaded. Actually sets the value of sProperty to fVal. The supported properties depend on how the associated was loaded. Attempts (and typically fails) to set the value of sProperty to fVal. The supported properties depend on how the associated was loaded. Sets the pitch to fPitch. The associated have SupportsRateChanging = true on load. Sets the speed (that is, the rate at which the sound plays) to fSpeed. The associated must have SupportsRateChanging = true on load. Sets the volume to fVolume, which is between 0..1. Returns the source width. Returns the source height. Returns the texture width. Returns the texture height. Returns the image width. Returns the image height. Returns the number of frames in this texture. Returns the path to the texture's file. Return the texture coordinate rectangle as {left, top, right, bottom}. Sets the animation or movie looping to bLoop. Sets the animation or movie position to fPos. Sets the animation or movie playback rate to fRate. Reloads the texture. Loads the metrics for this RollingNumbers from sGroupName. Sets the target number to f. Screen is the base screen class containing common methods that all specialized screens inherit.
By itself, Screen does not have the layers (underlay, overlay, decorations, in, out, cancel) commonly used in theming, so themers designing custom screens typically use as the screen class for such endeavors.
This adds the Lua function callback to the list of functions the screen will pass input to, giving Lua access to player input as it occurs.
When an input event occurs, callback will be passed a table with the details of the event. callback must return a bool to indicate whether the event was handled. If callback returns true, the event will not be passed any further.
This method does not handle localization or different keyboard layouts, so is better suited to getting text input from players.
Be aware that both the screen (as handled by the StepMania engine) and your Lua callbacks will be passed input events, and this can result in undesirable side effects.
Basic usage example:

local InputHandler = function( event )
	-- do something cool with the event table in here :)
	-- the details of the event table are documented below

	-- example:
	-- show the GameButton that was most recently pressed/held
	if event.type ~= "InputEventType_Release" then
		SCREENMAN:SystemMessage( event.GameButton )
	end

	return false
end

Def.ActorFrame{
	OnCommand=function(self)
		SCREENMAN:GetTopScreen():AddInputCallback( InputHandler )
	end
}
Details of the event table:

{
	-- The "semi-raw" button that was pressed. This is what
	-- the button was mapped to by the keymap settings, without
	-- the conversions that occur when OnlyDedicatedMenuButtons
	--  is true. Will be empty if the button was not mapped.
	button = string,

	-- "InputEventType_FirstPress", "InputEventType_Repeat",
	-- or "InputEventType_Release".
	type = string,

	-- The "cooked" button that was pressed.  This is button with
	-- mapping that occurs when OnlyDedicatedMenuButtons is true
	-- applied.  This is nil for unmapped buttons.
	GameButton = string,

	-- The player that the controller is mapped to, or nil.
	PlayerNumber = PlayerNumber,

	-- The game controller this event was mapped to.
	-- "GameController_1" or "GameController_2", or nil if the event
	-- wasn't mapped to either controller.
	controller = string,

	-- The details of the event.
	DeviceInput = {
		-- The type of device.  The first half of the string will
		-- be "Device_", the second half will be from InputDeviceNames
		-- in RageInputDevice.cpp.
		device = string,

		-- The button that was pressed. The first half of the string
		-- will be "DeviceButton_", the second half will be from InitNames
		-- in RageInputDevice.cpp.
		button = string,

		-- A floating point value for analog input.
		level = float,

		-- Mousewheel input.
		z = float,

		-- Whether the button is down.  This is level with a threshold
		-- and debouncing applied.
		down = bool,

		-- How long ago this input occurred, in seconds.
		ago = float,

		-- True if the device is a joystick.
		is_joystick = bool,

		-- True if the device is a mouse.
		is_mouse = bool
	},

	-- Unknown purpose. SMOnline?
	MultiPlayer = string
}
Returns the name of the next Screen. Returns the name of the previous Screen. Returns the ScreenType for this Screen. Locks input for f seconds. [02 Other.lua] Gets a metric from the current Screen. Posts a message with the text sScreenMsg to the Screen after fDelay seconds. This removes the callback from the list. Sets the NextScreen value to name. Sets the PrevScreen value to name. [02 Other.lua] Gets a string from the current Screen in the current language.
Returns the current . Returns the current StageStats. This should behave identically to the normal back button behavior. This function is for the pause menu to use when the player forfeits or restarts, so that a score isn't saved. Returns true if a single has its NoteField centered using the Center1Player preference.
Will return false if the current theme has AllowCenter1Player=false under [ScreenGameplay].
Notably, this can return false when the player's NoteField is visually centered, as is convention in double style or Techno_Single8.
Refer to the global function for a somewhat more robust check.
Returns a dummy PlayerInfo for the specified index. Returns the current haste rate. HasteRate * MusicRate is the current total rate the music is multiplied by. Returns the for the specified pn. Returns the next in the current . Returns the PlayerInfo for player pn. Returns the current true beats per second for the specified player.
This takes into account the current music rate and the current haste effect.
If you are displaying the BPM on ScreenGameplay, this is what you should use to have correct behavior when Haste and/or a music rate mod are in effect.
This is part of the system for controlling how haste behaves.
See Docs/Themerdocs/haste.txt.
This is part of the system for controlling how haste behaves.
See Docs/Themerdocs/haste.txt.
This is part of the system for controlling how haste behaves.
See Docs/Themerdocs/haste.txt.
This is part of the system for controlling how haste behaves.
See Docs/Themerdocs/haste.txt.
Sets the next Screen to be loaded. Returns true if the game is paused. Pauses or unpauses the game, depending on the value of bPause.
Returns the LifeMeter. This singleton is accessible to Lua via SCREENMAN. Adds a screen at the top of the screen stack. (sMessage is an optional ScreenMessage posted once the new screen is finished.) Gets the screen at the top of the screen stack. Returns whether the input for the player has been redirected away from the normal screen input function. Input that has been redirected is only sent to Lua input callbacks. Plays the invalid sound. Plays the start sound. Plays the coin sound. Plays the cancel sound. Plays the screenshot sound. Reloads any loaded overlay screens. Returns true if screen class s exists. Returns true if screen s is prepared. Sets the next screen to s. Sets whether the input for the player has been redirected away from the normal screen input function. Input that has been redirected is only sent to Lua input callbacks.
This can be useful when putting a custom menu on a screen, and you want to disable the built in actors while the menu is open. You can handle input through an input callback until the player closes the menu.
Broadcasts a system message.
Returns true if Player pn backspaced successfully. Returns true if Player pn was able to add sKey to their name. Attempts to finish Player pn and returns true if successful. Returns true if anyone is entering their name. Returns true if anyone is still entering their name.
(As opposed to those who are Finalized; see )
Returns true if Player pn is entering their name. Returns true if Player pn is finished entering their name. Gets the currently selected letter of Player pn.
Returns true if all active players are on the last options row. Returns true if the specified player is on an items that ends the screen. Returns the current row that player pn is on. (Was previously GetCurrentRow.) Returns the number of rows on the screen. Returns the specified OptionRow. Returns true if we are going to PlayerOptions. Continues to the next screen. Returns true if there is a profile that can be loaded. Continues to the next screen. Returns true if there is a profile that can be saved. Returns player pn's current selected item as an integer. Returns false if the options list is already open or the UseOptionsList metric is false. Returns true if the player is going to the options screen. Returns the MusicWheel used on this screen. Opens the OptionsList for Player pn [02 StageMods.lua] Sets up modifiers for course modes. [02 StageMods.lua] Sets up modifiers for non-course modes. Tells the screen to go to the previous screen. Attempts to finish the screen and returns true if successful. Returns the profile index of the specified Player. Sets the profile index of Player pn to iProfileIndex.
The following values of iProfileIndex have special, hardcoded behavior:
-1: join the player and play the theme's start sound effect
-2: unjoin the player, unlock their MemoryCard, and unmount their MemoryCard
-3: allow the user to play without a local or USB profile (as a guest)
Using ScreenTextEntry is the preferred way to get text input from players.
For theming, ScreenTextEntry is unique because it is typically added temporarily to the engine's screen stack to be popped off the stack when the player is done entering text.
As such, it is commonly styled to appear to players as an overlay or modal.
Basic usage example:

local args = {
	Question="Do you like Waffles?",
	InitialAnswer="Yeah, we like waffles!",
	MaxInputLength=300,
	OnOK=function(answer)
		-- answer is what the player typed
		local msg = "Your response was: " .. answer
		SCREENMAN:SystemMessage(msg)
	end
}

SCREENMAN:AddNewScreenToTop("ScreenTextEntry")
SCREENMAN:GetTopScreen():Load( args )
Sets up a ScreenTextEntry's values using args.
TextEntrySettings is special struct for ScreenTextEntry, and as a Lua table, it should contain specific attributes:

local args = {
	-- ScreenMessage to send on pop
	-- optional, "SM_None" if omitted
	SendOnPop = "",

	-- the question text to display
	Question = "",

	-- initial answer text
	InitialAnswer = "",

	-- Maximum amount of characters
	MaxInputLength = 0,

	-- mask character input (optional)
	Password = false,

	-- validation function
	-- must return boolean and string
	Validate = function(answer, errorStr) end,

	-- function called on ok
	OnOK = function(answer) end,

	-- function called on cancel
	OnCancel = function() end,

	-- Validate appending a character 
	-- must return boolean
	ValidateAppend = function(answer, append) end,

	-- Format answer for display
	-- must return string
	FormatAnswerForDisplay = function(answer) end
}
Tells the screen to go to the previous screen. Returns true if the screen is currently transitioning. Tells the screen to go to play its Out transition, and then posts the ScreenMessage sScreenMsg. To go to the next screen, use "SM_GoToNextScreen" as the argument. Sets whether the screen allows late joining. This only works for screens that are just ScreenWithMenuElements, as most derived screens have their own hard coded function for whether late joining is allowed. Returns an array of all the available objects for a . Returns the path to the song's background image.
If the stepartist did not provide a path for a background, this returns nil.
Returns the path to the song's banner.
If the stepartist did not provide a path for a banner, this returns nil.
Returns a table with all the data for the song's BGCHANGES line.
Each element of the table is one change like this:
{start_beat=1.0, rate=1.0, transition="example", effect="example", file1="example", file2="example", color1="#FFFFFFFF", color2="#FFFFFFFF"}
Returns the path to the song's CD image.
If the stepartist did not provide a path for a CDImage, this returns nil.
Gets the path to the CDTitle.
If the stepartist did not provide a path for a CDTitle, this returns nil.
Returns the path to the song's disc image (different from CD, think Pump). Returns the displayed artist of the song. Returns a table of 2 floats containing the display BPMs. Returns the displayed full title of the song.
The full title is, at minimum, the main title. If the subtitle is not an empty string, the full title is main title + " " + subtitle.
Returns the displayed main title of the song. Returns the displayed subtitle of the song.
If the stepartist did not provide a subtitle, this returns an empty string.
Returns the first beat of the song. Returns the first second of the song. Returns the genre of the song. Returns the group name that the song is in. Returns the path to the song's jacket image. Returns the last beat of the song. Returns the last second of the song. Gets the path to the lyrics. GetDisplayMainTitle checks the ShowNativeLanguage pref and returns the transliterated title is that pref is false.
GetMainTitle (this function) does not check that pref. Instead, it directly returns the title, exactly as it is in the #TITLE field in the simfile.
Gets the path to the music file. Returns a Step object if the StepType and Difficulty exist. Gets the Song's origin. Returns the path to the Song's preview music. This handles the #PREVIEW tag internally, so it works with songs that use it and songs that don't. Returns the path to the Song's preview video, if it exists. (Returns nil otherwise.) Gets the length of a song's sample time in seconds. Gets the starting position of a song sample in seconds. Returns the song's directory. Returns the songfile path. [02 Other.lua] Returns the number of stages this song costs. Returns a table of Steps that have StepsType st. Returns how long the longest stepchart is in seconds. Returns the song's TimingData. Returns the transliterated artist of the song. Returns the transliterated full title of the song, including subtitle. Returns the transliterated main title of the song. Returns the transliterated subtitle of the song. Returns true if the song has steps for the specified difficulty in st. Returns true if the song has attacks. Returns true if the song has a background. Returns true if the song has a banner. Returns true if the song has BGChanges. Returns true if the song has a CD image. Returns true if the song has a CDTitle. Returns true if the song has a Disc graphic. Returns true if the song has edits. Returns true if the song has a jacket graphic. Returns true if the song has lyrics. Returns true if the song has music. Returns true if the song has a preview video. Returns true if the song has significant BPM changes or stops. Returns true if the song has the specified StepsType. Returns true if the song's DisplayBPM is constant. Returns true if the song's DisplayBPM is random. Returns true if the song's DisplayBPM is secret. Returns true if the song is considered easy. Returns true if the song is enabled. Returns true if the song meets the criteria for a "Long Version". Returns true if the song meets the criteria for "Marathon" length. Returns true if the song and the specified steps have different timing. Returns true if the song only has Beginner steps. Returns the length of the song in seconds. Returns true if the song is normally displayed. Returns true if the song is shown in Demonstration and Ranking.
This singleton is accessible to Lua via SONGMAN. Returns true if the specified course group exists. Returns true if the specified song group exists. Returns a Course if one matching sCourse is found. Returns a Song if one matching sSong is found. Returns an array of all the installed courses. Returns an array of all the installed songs. Returns the course color of Course c. Returns the path to the specified course group's banner. Returns a table containing all of the course group names. Returns a table with all of the courses in the specified group. Returns the extra stage info (Song, Steps) for the specified Style s. If b2ndExtra is true, it will use the second Extra Stage data instead of the first. [Deprecated] Always returns 0. [Deprecated] Always returns 0. Returns the number of course groups. Returns the number of courses. Returns the number of selectable and unlocked songs. Returns the number of song groups. Returns the number of songs. Returns the number of locked songs, regardless of reason for locking. Returns the number of unlocked songs. Returns a table of popular courses for the specified CourseType. Returns a table of popular songs. Returns a table of courses as they'd appear in preferred sort. Returns a table of songs as they'd appear in preferred sort. Returns a random course. Returns a random song. Returns the song color of Song s. Returns a Song given a set of Steps st. Returns the path to the specified song group's banner. Returns the song group color of sGroupName. Returns a table containing all of the song group names. Returns the rank (popularity) of Song s. Returns a table containing all of the songs in group sGroupName. Returns the shortened group name (based on entries in Translations.xml). By default, loads preferred courses from {theme}/Other/SongManager sListName.txt. (New since ITGmania 0.6.0) If the optional argument bIsAbsolute is set, instead treats sListName as an absolute path instead of loading it from the Theme's Other directory. By default, loads preferred songs from {theme}/Other/SongManager sListName.txt. (New since ITGmania 0.6.0) If the optional argument bIsAbsolute is set, instead treats sListName as an absolute path instead of loading it from the Theme's Other directory. Returns the preferred sort section name for the specified Song. Returns a table containing all songs in the specified preferred sort section. [Deprecated] Always returns false. [Deprecated] Always returns false. See the description for PlayerOptions. The functions follow the same design. Limited to the range 0 < rate <= 3 because speeds greater than 3 are likely to crash. A multiplier for the haste system. Limited to the range -1 to 1. Returns the current beats per second. Returns true if a Delay is active. Returns true if a Freeze is active. Returns the row where a warp appears. Returns the warp destination length. Sprite actors can be used to display images and video. If you want to load a png as part of your UI, or animate a visual effect from a sprite sheet, or play a video file, Sprite is what you're looking for.

You can initialize Sprites with a filepath to the graphic asset using their Texture attribute.

local spr = Def.Sprite{
	Texture="path/to/mycoolimage.png"
}
Frame-based animated sprites can be initialized with the Frames attribute.

local spr = Def.Sprite{
	Texture="path/to/Spikes 6x3.png",
	Frames=Sprite.LinearFrames(18, 1)
}
Returns the length of the animation in seconds. Gets whether the Sprite should call the decode function for its texture during updates. Return the number of states this Sprite has. Returns the Sprite's current state (frame number in a multi-frame sprite). Returns the Sprite's texture. [02 Sprite.lua] Returns a Frames table consisting of iNumFrames frames lasting for a total of fSeconds seconds.
This function is not a member function and should be used as Frames = Sprite.LinearFrames( 5, 2.6 ).
If sPath is nil, then unload the texture. Otherwise, load the texture at path sPath. Load the song background texture at sPath. Load the song banner texture at sPath. Loads the image of type sType from the cache based on sPath. Internal types: "Banner", "Background", "CDTitle", "Jacket", "CDImage" and "Disc". [02 Sprite.lua] Loads the background from the current Song or the first Trail entry. [02 Sprite.lua] Load the texture for song's background. [02 Sprite.lua] Load the texture for song's banner. Sets the custom image rectangle. (Works in image pixel space.) Sets custom offsets for the corners of the Sprite. Coordinates are paired, corner order is upper left, lower left, lower right, upper right. Turns off the custom pos coords for the sprite. Sets whether the Sprite should call the decode function for its texture during updates. Set the to mode. Sets the number of seconds into the animation to fSeconds. Sets the properties of the states of the sprite. The properties table is identical to the "Frames" table that can be put in the sprite when calling Def.Sprite.
Example:

{
	{ Frame=0, Delay=0.333, {0, 0}, {.25, .25} },
	{ Frame=1, Delay=0.333, {0, 0}, {.25, .25} },
	{ Frame=2, Delay=0.333, {0, 0}, {.25, .25} },
	{ Frame=3, Delay=0.333, {0, 0}, {.25, .25} },
}
Frame is optional, defaulting to 0.
Delay is optional, defaulting to 0.
The two tables are optional upper left and lower right corners of the fraction of the frame to use. The example makes the sprite only use the upper left corner of each frame.
Simpler example:

{
	{Frame=0, Delay=0.333},
	{Frame=1, Delay=0.333},
	{Frame=2, Delay=0.333},
	{Frame=3, Delay=0.333}
}
This example makes the sprite use the whole of each frame.
Set the texture to texture. Allows the themer to set a custom texture rectangle that effects the way the texture is drawn. Returns true if the sprite is using the effect clock for texcoordvelocity. [02 Sprite.lua] Call RageTexture:loop( bLoop ) on the texture. [02 Sprite.lua] Call RageTexture:position( fPos ) on the texture. [02 Sprite.lua] Call RageTexture:rate( fRate ) on the texture. Scale the Sprite to width fWidth and height fHeight clipping if the dimensions do not match. Set the Sprite's state to iNewState. If use is true, then the sprite will use the effect clock for texcoordvelocity. Set the texture coordinate velocity which controls how the Sprite changes as it animates. A velocity of 1 makes the texture scroll all the way once per second. Crops the Sprite to fWidthxfHeight. [01 alias.lua] Alias for CropTo. Sets all the state delays to fRate. Useful for Sprites that need to change by BPM (e.g. Tran from DDR 5th Mix, the cube from DS EuroMix 2).
Returns true if everyone failed. Returns true if any player has given up on the song. Returns the EarnedExtraStage value. Returns the number of seconds played. Returns the PlayerStageStats of multiplayer mp. Returns the PlayerStageStats of player pn. Returns the Stage value. Returns the stage index. Returns true if at least one person passed. Returns true if player pn has a high score. This singleton is accessible to Lua via STATSMAN. Returns the accumulated played StageStats. Returns the best final grade. Returns the best grade. Returns the current StageStats. Returns player pn's final grade. Returns player pn's final grade. Get the StageStats from iAgo rounds ago. Returns the number of stages played. Returns the worst grade. Resets the stats. Returns the author that made that particular Steps pattern. Returns the Steps chart name. Returns the Chart Style for this Steps. Returns the Steps description. Returns the Steps difficulty. Returns a table with the minimum and maximum values from the DisplayBPM. Returns the DisplayBPM type. Returns the Steps filename from the Cache. Returns a hash of the Steps. Returns the numerical difficulty of the Steps. Returns true if the Steps has any attacks. Returns true if the Steps pattern has significant timing changes. Returns the complete list of RadarValues for player pn. Use to grab a specific value. Returns the Steps type. Returns the TimingData for the Steps. Returns true if the Steps are an edit. Returns true if the Steps are a player edit (loaded from a profile). Returns true if the steps were automatically generated. Returns true if the DisplayBPM is constant. Returns true if the DisplayBPM is random. Returns true if the DisplayBPM is secret. Returns the predicted meter for this Step. Returns true if the Steps use different TimingData from the Song. Loads the StepsDisplay commands from the Metrics in group sMetricsGroup. Sets the StepsDisplay from the GameState using Player pn. Sets the StepsDisplay based on Steps pSteps. Sets the StepsDisplay based on the passed in StepsType, iMeter, and Difficulty. Sets the StepsDisplay based on Trail pTrail. Returns the number of total tracks per player this Style contains (e.g. 4 for dance-versus, but 8 for dance-double). Returns the name of the Style. Returns the StepsType for this Style. Returns the StyleType for this Style. Returns a table containing the Track, XOffset, and Name of the column.
For example, calling GAMESTATE:GetCurrentStyle():GetColumnInfo('PlayerNumber_P1', 2) when the current game is dance will return {Track=2, XOffset=-32, Name="Down"}.
Calling GAMESTATE:GetCurrentStyle():GetColumnInfo('PlayerNumber_P1', 1) when the current game is pump will return {Track=1, XOffset=-96, Name="DownLeft"}.
Returns the draw order of the column. Returns the width of the notefield for the given player with this style. Returns true if this style locks the difficulty for both players. [Deprecated] Always returns false.
Returns the of the Tap Note. Returns the of the Tap Note. Returns the of the Tap Note. Returns the of the Tap Note. Returns the of the Tap Note. Relevant for routine steps. Returns the Attack Modifiers of the Tap Note. Returns the Attack Duration of the Tap Note in seconds. Returns the Keysound Index of the Tap Note. Returns the Hold Duration of the Tap Note in beats. Returns the of the Tap Note. Returns the of the Tap Note. Returns the TapNotOffset of the Tap Note. Returns true if the Tap Note was judged with a result that would stop it from drawing. Returns whether the input for the Tap Note was ever held during the judgment interval. Useful to distinguish a normal miss from a held miss. Returns the of the Hold Note. Returns the life of the Hold Note. Returns the amount of time the hold has overlapped the target. Returns the last beat the Hold Note was held. Returns the number of checkpoints hit. Returns the number of checkpoints missed. Returns true if the note was initiated and is being held. Returns true if the note was initiated. Cancels the running HTTP request. Does nothing if the request has already completed. Loads the TextBanner from the specified metrics group. Loads the TextBanner's child elements from a . Loads the TextBanner's child elements from strings. This singleton is accessible to Lua via THEME. Returns true if the specified language exists in the current theme. Returns true if the specified theme exists. [02 Utilities.lua] Returns the absolute path of a file in the theme. Returns the current language. Returns the theme's current directory. Returns the name of the current theme. Returns the value of Element in Class from metrics.ini. Returns the names of all elements in Class from metrics.ini. Returns the number of selectable themes. Returns the path of ClassName Element in the BGAnimations folder. Returns the path of an element in the Fonts folder. Returns the path of an element in the Graphics folder. Returns three strings: BGAnimation ResolvedPath, MatchingMetricsGroup, MatchingElement.
Used in LoadFallbackB in themes/_fallback/02 Other.lua
Example: local path, metrics_group, element = THEME:GetPathInfoB("ScreenTitleJoin", "decorations")
Returns the path of an element in the Other folder. Returns the path of an element in the Sounds folder. Returns a table of selectable theme directories. Returns the value of Element in Class for the currently loaded language. Returns the names of all elements in Class for the currently loaded language. Returns the author of the current theme or "[unknown author]". Returns the display name of the current theme. Returns a table of strings showing what themes the current theme falls back on.
For example, if the current theme is in a folder named "Home", and the "Home" theme falls back on the "default" theme, which itself falls back on the "_fallback" theme, the table would be:

{
	[1]="Home",
	[2]="default",
	[3]="_fallback"
}
Returns true if the theme has the specified metric. Returns true if the theme has the specified string. Returns true if the specified theme is selectable. Reloads the current theme's metrics. Changes the current theme.
After the theme changes, the screen specified by the Common::AfterThemeChangeScreen metric will be loaded.
The Common::InitialScreen metric will be used if Common::AfterThemeChangeScreen is blank or invalid.
GetBPMsAndTimes, GetStops, GetDelays, GetLabels, GetWarps, GetCombos, GetTimeSignatures, GetTickcounts, GetFakes, GetScrolls, and GetSpeeds all have two different modes.
If false (or nothing) is the argument to these functions, they return tables of strings. The strings are numbers separated by '='.
If the argument is true, they return tables of tables, and the inner tables contain numbers as described for each function.
The first form is kept as the default to maintain compatibility with older themes. The second form can be convenient because there is no need to transform the string into a table of numbers before using it.
Example of first form:

local bpms_and_times = timing_data:GetBPMsAndTimes()
for i, s in ipairs(bpms_and_times) do
	local bpm_and_time = split("=", s)
	bpms_and_times[i] = {tonumber(bpm_and_time[1]), tonumber(bpm_and_time[2])}
end
-- do something with the bpms and times now that they are numbers.

Example of second form:

local bpms_and_times = timing_data:GetBPMsAndTimes(true)
-- do something with the bpms and times because they are already numbers.
Returns the minimum and maximum BPM of the song in a table (in that order). Returns the beat from fElapsedTime. Returns the BPM at fBeat. Returns a table of the BPMs as floats. Returns a table of the BPMs and the times they happen as tables. The first value is the beat. The second value is the bpm. Returns the elapsed time from fBeat. Returns a table of the Stops and the times they happen as tables. The first value is the beat. The second value is the length. Returns a table of the Delays and the times they happen as tables. The first value is the beat. The second value is the length. Returns a table of the Labels and the times they happen as tables. The first value is the beat. The second value is the label. Returns a table of the Warps and the times they happen as tables. The first value is the beat. The second value is the number of beats to warp over. Returns a table of the Combos and the times they happen as tables. The first value is the beat. The second value is the combo. The third value is the miss combo. Returns a table of the Time Signatures and the times they happen as tables. The first value is the beat. The second value is the numerator. The third value is the denominator. Returns a table of the Tickcounts and the times they happen as tables. The first value is the beat. The second value is the number of ticks per beat. Returns a table of the Fakes and the times they happen as tables. The first value is the beat. The second value is the number of beats to not judge. Returns a table of the Scrolls and the times they happen as tables. The first value is the beat. The second value is the scroll rate ratio. Returns a table of the Speeds and the times they happen as tables. The first value is the beat. The second value is the scroll rate ratio. The third value is the length of time to fully activate. The fourth value is the unit of activation (0 for beats, 1 for seconds). Returns true if the TimingData contains BPM changes. Returns true if the TimingData contains delays. Returns true if the TimingData contains any BPM changes with a negative BPM. Returns true if the TimingData contains stops. Returns true if the TimingData contains warps. returns true if the TimingData contains fake segments. Returns true if the TimingData contains speed scrolling changes. Returns true if the TimingData contains general scrolling changes.
Returns true if song s is in the Trail. Returns an array with all the artists in the Trail. Returns the Trail's difficulty. Returns the length of this Trail in seconds. Returns a table of TrailEntry items. Returns the Trail's difficulty rating. Returns the Trail's RadarValues. Returns the Trail's StepsType. Returns the Trail's total meter Returns the TrailEntry at index iEntry. Returns true if any of the Trail entries are secret. Returns a string of modifiers used in this TrailEntry. Returns the Song used in this TrailEntry. Returns the Steps used in this TrailEntry. (why'd I think this was a good idea when we have ?) Sets the UnlockEntry's ID to m_sEntryID. Sets the UnlockEntry's course to sCourseName.
Example: course,"Driven"
Returns the code for this unlock. Returns the Course for this unlock. Returns the unlock description. Returns the UnlockRequirement. Returns true if the UnlockEntry requires you to pass Hard steps. Returns true if the UnlockEntry requires you to pass Challenge steps. Returns the Song related to the UnlockEntry. Get all of the steps locked based on StepsType. Get all of the steps locked based on difficulty. Returns the UnlockRewardType for this entry. Returns true if the UnlockEntry is locked. Sets the UnlockEntry's modifier to sModifier. Sets the requirement for this unlock to m_fRequirement. Makes the UnlockEntry require passing Hard steps. Makes the UnlockEntry require passing Challenge steps. Makes the UnlockEntry hide in Roulette. Sets the UnlockEntry's song to sSongName. sSongName also requires the group.
Example: song,"In The Groove/Pandemonium"
Sets the UnlockEntry to unlock a specified song's steps.
Example: steps,"In The Groove/Pandemonium","expert"
Sets the UnlockEntry to unlock a specified song's stepstype.
This singleton is accessible to Lua via UNLOCKMAN. Returns true if there are any unlocks to celebrate. Returns the associated EntryID. Returns the number of unlocked items. Returns the number of all unlock items, regardless of status. Returns the number of points for the machine profile based on the specified UnlockRequirement. Returns the number of points for the specified profile based on the specified UnlockRequirement. Returns the number of points until the next unlock. Returns a table of songs unlocked by UnlockEntry sEntryID. Returns a table of steps unlocked by UnlockEntry sEntryID. Returns the UnlockEntry at iIndex. Returns the UnlockEntry index to celebrate. Sets the preferred Song/Course to the specified sUnlockEntryID Unlocks an entry by ID. Unlocks an entry by index. Determines if a song is locked by any means. The number returned determines how the song is locked. Closes the WebSocket connection. No further reconnections will be attempted. Sends a message containing data. If the optional binary argument is set to true, the message is marked as binary.
Returns whether the message was sent successfully.
Returns the wheel's current index. Returns the total number of items in the wheel. Returns the WheelItemDataType of the selected item. Returns the WheelItem at index iIndex. Returns true if the wheel is locked. Returns true if the wheel is settled/stopped moving. Moves the wheel by n. Attempts to set the open section to sSection. Returns the color of this wheel item. Returns the text of this wheel item. Returns the type of this wheel item. Returns whether the wheel item has been loaded yet. If this function returns false, calling any other WheelItemBase function will result in an error.
A specific case where this is known to happen is commands that trigger on CurrentSongChanged because the music wheel clears the current song before it finishes loading if the current song is longer than the number of stages remaining.
Sets the WorkoutGraph from the current Workout. Sets the WorkoutGraph from GameState and song index iSongIndex.
StepMania's enums are exposed to Lua as global tables. Note that although the enum values start at 0, these global Lua tables are indexed starting at 1.
Functions that require enums as arguments will accept either the string constant or number value.
For example, accepts a and as arguments. Each of these is valid way to set P1's preferred difficulty to hard:

-- using strings
GAMESTATE:SetPreferredDifficulty( "PlayerNumber_P1", "Difficulty_Hard" )
-- using values
GAMESTATE:SetPreferredDifficulty( 0, 3 )
-- using global Lua tables
GAMESTATE:SetPreferredDifficulty( PlayerNumber[1], Difficulty[4] )
It's worth pointing out that, as tables, these enums can be iterated over using or . This can be handy when you want to perform some action on every value in an enum; for example, displaying a graphic for each Difficulty.

-- Difficulty is a global Lua table that corresponds with
-- the StepMania engine's Difficulty enum
for i, diff in ipairs(Difficulty) do

	-- append a file extension to create a string like
	-- "Difficulty_Beginner.png"
	local filename = diff .. ".png"

	-- load files like "Difficulty_Beginner.png",
	-- "Difficulty_Easy.png", etc. from the directory
	-- where this code is run, and offset each vertically
	af[#af+1] = LoadActor( filename )..{
		InitCommand=function(self) self:y( i * 100 ) end
	}
end
Blending modes. See . Horizontal alignment. See . Possible values for the ProfileSortOrder preference. The engine initially sorts profiles based on their , showing Guest profiles first, then Normal, then Test. ProfileSortOrder allows additional subsorts to be configured.
Priority allows users to manually sort profiles using the Priority= key in each profile's Type.ini file. New profiles are created with Priority=0. A profile with Priority=0 will appear before any profiles with Priority=1 which will appear before any profiles with Priority=2 and so on.
Recent automatically sorts profiles in the order they are used, with the most recently used profile appearing first.
Vertical alignment. See .
The StepMania engine uses singletons internally when it needs only one instance of a class.
Each singleton has a class name (e.g. RageDisplay, NoteSkinManager, etc.) from the C++ engine, and a similar (but different) userdata name available to Lua (e.g. DISPLAY, NOTESKIN, etc.).
Simple examples:

-- use GameState's singleton to get the current song
local song = GAMESTATE:GetCurrentSong()

-- use ScreenManager's singleton to briefly show text on-screen
SCREENMAN:SystemMessage("hello from Lua!")
Actors are the basic building blocks used to script content for StepMania. When the player sees and interacts with something on-screen, like a menu system or a 3D model of a dancing character, that something is an actor.

Each of these actors is available to Lua as a function within the global Def table.

As functions, each actor accepts a table as an argument, and that table contains attributes and commands that define how the actor will behave when rendered by the StepMania engine.

Basic examples:

-- Sprite, Sound, and Quad are each Actors with unique specializations
local spr = Def.Sprite{ Texture="./path/to/image.png" }
local snd = Def.Sound{ File="./path/to/soundeffect.ogg" }
local sqr = Def.Quad{ InitCommand=function(self) self:xy(80, 100) end }

-- common convention is to not use () with actor
-- functions, but syntax like this is also valid
local args = { Texture="./path/to/image.png" }
local spr  = Def.Sprite(args)
For players, screens are individual units of a game cycle that they interact with. Most players understand there is a place where gameplay occurs (ScreenGameplay) that is different than the place used to choose the next song (ScreenSelectMusic).

For scripters, screens are collections of distinct actors wrapped up in a single ActorFrame. That ActorFrame is the "screen" that players interact with.

To be available in a theme, screens must be defined in that theme's metrics.ini file with the desired name between square brackets like [ScreenTitleJoin] or [ScreenPlayerOptions].

The StepMania engine defines many, many classes of screens, each with unique specialization not directly available to Lua. For now, the screens documented here are only those with methods available to Lua.