diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 9734c4bc2b..158e0c9cc6 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -32,7 +32,7 @@ save yourself some time, copy this for undocumented things: 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.
+ 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. @@ -162,7 +162,7 @@ save yourself some time, copy this for undocumented things: 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. + 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] @@ -467,10 +467,6 @@ save yourself some time, copy this for undocumented things: [03 Gameplay.lua] Returns the value to start showing the miss combo at. - - Creates a module.
- module is a core function of Lua's basic library; see the Lua manual for more details. -
Returns the current month of the year in the range 0-11. @@ -692,6 +688,14 @@ save yourself some time, copy this for undocumented things: [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. @@ -826,11 +830,11 @@ local playable_steps = SongUtil.GetPlayableSteps(song) 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.
+ 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.
+ 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]
@@ -846,18 +850,18 @@ local playable_steps = SongUtil.GetPlayableSteps(song) 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.
+ 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 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. @@ -872,7 +876,8 @@ local playable_steps = SongUtil.GetPlayableSteps(song) 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. + 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.
@@ -929,12 +934,12 @@ local n = r['PlayerNumber_P2'] 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.".
+ 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().
+ 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.
@@ -1178,7 +1183,7 @@ local n = r['PlayerNumber_P2'] See Docs/Themerdocs/effect_colors.txt for an example. - + Sets the Actor's bottom edge color to c. @@ -1246,12 +1251,9 @@ local n = r['PlayerNumber_P2'] Set the Actor's effect period to fTime. - Set the Actor's effect timing.
- hold_at_zero is before hold_at_full in the argument list for compatibility. A future version will probably swap them because it makes more sense to have hold_at_full come before hold_at_zero.
+ 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.
- The effect timing controls how long it takes an effect to cycle and how long it spends in each phase.
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.
@@ -1259,8 +1261,8 @@ local n = r['PlayerNumber_P2'] 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: diffuseblink, diffuseshift, glowblink, glowshift, glowramp, rainbow, wag, bounce, bob, pulse, spin, vibrate. + 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. @@ -1377,7 +1379,8 @@ local n = r['PlayerNumber_P2'] 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. See for the common case. + 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. @@ -1392,7 +1395,14 @@ local n = r['PlayerNumber_P2'] [02 Actor.lua] "Hide if b is true, but don't unhide if b is false." - Set the horizontal alignment of the Actor according to align. See for fractional alignment. + 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. @@ -1530,10 +1540,18 @@ local n = r['PlayerNumber_P2'] 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. See for the common case. + 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 vertical alignment of the Actor according to align. See for fractional alignment. + 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. @@ -1794,7 +1812,7 @@ return af Clears all the textures from the ActorMultiTexture. - Sets the EffectMode on the ActorMultiTexture. + Sets the on the ActorMultiTexture. Sets the size of the ActorMultiTexture from the specified texture. @@ -1803,7 +1821,7 @@ return af Sets the coordinates of the ActorMultiTexture. - Sets a TextureMode on the specified index. + Sets a on the specified index. @@ -1940,10 +1958,10 @@ self:SetDrawState{First= 3, Num= 4} Returns the ActorMultiVertex's texture.
- Sets the EffectMode of the ActorMultiVertex. + Sets the of the ActorMultiVertex. - Sets the TextureMode of the ActorMultiVertex. + Sets the of the ActorMultiVertex. Sets the width of the line for DrawMode_LineStrip. @@ -2177,7 +2195,7 @@ Def.Sound{ BitmapText actors are used to display text on-screen.
- The font can be specified using the Font attribute. It takes a font name a string, + 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 @@ -2609,7 +2627,7 @@ Def.BitmapText{ 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(). + Destroys the spline, freeing the memory allocated for it. This can only be called on splines created with create_spline(). @@ -3532,20 +3550,23 @@ end 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. - - Selects a song. Returns false on failure. + + Moves the wheel by n. Selects a course. Returns false on failure. - - Returns a string array of the currently displayed sections in the MusicWheel. + + Selects a song. Returns false on failure. @@ -4684,10 +4705,11 @@ prev_note_name, succeeded = options:NoteSkin("cel") Returns the profile for player pn. - Returns the profile directory of the specified ProfileSlot. + 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 number of times Song s has been played with the specified ProfileSlot. Returns the current stats prefix. @@ -6015,6 +6037,9 @@ local spr = Def.Sprite{ Returns the current StageStats. + + Returns player pn's final grade. + Returns player pn's final grade.