Repository navigation
Lua Script API: Reflection Functions
Sets one of PlayState's variable value to a new value.
-
variable- The variable inside PlayState to be used. -
value- The new value for thevariableparameter to be set. -
allowMaps- An optional parameter, Whether to allow to set the value of maps or not, which is basically a haxe dictionary just to let you know; Default value:false.
Sets one of the specified classes variable value to a new value.
Warning
In versions 0.7 or above, the classVar parameter should have the file name in which the class is located, followed by a dot . character. With the name of the class that you've chosen; Example: backend.ClientPrefs, states.PlayState, flixel.FlxG, etc. You can check where the class files are located, just click here!!!!.
Note
If you are trying to set a static variable from PlayState, this is required since the normal setProperty only works on non-static variables.
-
classVar- The name of the class; Example:ClientPrefs,Conductor,CoolUtil, etc. -
variable- The variable inside the class to be used. -
value- The new value for thevariableparameter to be set. -
allowMaps- An optional parameter, Whether to allow to set the value of maps or not, which is basically a haxe dictionary just to let you know; Default value:false.
setPropertyFromGroup(obj:String, index:Int, variable:Dynamic, value:Dynamic, ?allowMaps:Bool = false)
Sets one of PlayState's array/group variable member to a new value.
-
obj- The name of the array/group; Example:opponentStrums,playerStrums, etc. -
index- The index number of the array/group member to be referenced. -
variable- The variable to be used for the array/group member. -
value- The new value for thevariableparameter to be set. -
allowMaps- An optional parameter, Whether to allow to set the value of maps or not, which is basically a haxe dictionary just to let you know; Default value:false.
Gets one of PlayState's variable value.
-
variable- The variable inside PlayState to get. -
allowMaps- An optional parameter, Whether to allow to get the value of maps or not, which is basically a haxe dictionary just to let you know; Default value:false.
Gets one of the specified classes variable value.
Warning
In versions 0.7 or above, the classVar parameter should have the file name in which the class is located, followed by a dot . character. With the name of the class that you've chosen; Example: backend.ClientPrefs, states.Playstate, flixel.FlxG, etc. You can check where the class files are located, just click here!!!!.
Note
If you are trying to get a static variable from PlayState, this is required since the normal getProperty only works on non-static variables.
-
classVar- The name of the class; Example:ClientPrefs,Conductor,CoolUtil, etc. -
variable- The variable inside the class to be used. -
allowMaps- An optional parameter, Whether to allow to get the value of maps or not, which is basically a haxe dictionary just to let you know; Default value:false.
Gets one of PlayState's array/group variable member's current value.
-
obj- The name of the array/group; Example:opponentStrums,playerStrums, etc. -
index- The index number of the array/group member to be referenced. -
variable- The variable to be used for the array/group member. -
allowMaps- An optional parameter, Whether to allow to get the value of maps or not, which is basically a haxe dictionary just to let you know; Default value:false.
Calls a function from a PlayState.
-
funcToRun- The function name from PlayState to be referenced. -
args- An optional parameter, The argument(s) to be passed to the function; Default value:nil.
Calls a function from a specified class.
-
className- The name of the class; Example:LuaUtils,Conductor,CoolUtil, etc. -
funcToRun- The function name from the class to be referenced. -
args- An optional parameter, The argument(s) to be passed to the function; Default value:nil.
Used in combination with callMethod() or callMethodFromClass() functions; Allows you to use objects as arguments.
-
instanceName- The object name to be used. -
className- An optional parameter, The class to get the object from.
Example:
function onCreatePost()
callMethod('uiGroup.remove', {instanceArg('scoreTxt')})
endCreates an object instance of the class by calling the constructor.
-
variableToSave- The object's tag name. -
className- The name of the class to use. -
args- An optional parameter, The argument(s) to be passed to the class constructor; Default value:nil.
Example:
createInstance('characterTag', 'objects.Character', {0, 0, 'gf'}) -- Will create a characterCreating an object instance of a class using the Character class (Reference):
new Character(x, y, json, isPlayer);Adds the object from the specified tag name.
-
objectName- The object's tag name. -
inFront- An optional parameter, Whether the object will be in front of the characters or not; Default value:false.
Removes an object from the group with its specified member ID
-
obj- The name of the array/group member; Example:opponentStrums,playerStrums, etc. -
index- The index number of the array/group member to be referenced. -
dontDestroy- Whether if the object will be removed permanently making it unable to be re-added; Default value:false.
Updates the object's hitboxes with its specified member ID.
-
obj- The name of the array/group; Example:opponentStrums,playerStrums, etc. -
index- The index number of the array/group member to be referenced.
Tip
More object properties can be found on the HaxeFlixel website (FlxBasic, FlxObject, FlxSprite, etc).
-
.x- The x position value of the object. (Float) -
.y- The y position value of the object. (Float) -
.width- The width size value of the object. (Float) -
.height- The height size value of the object. (Float) -
.alpha- The alpha/opacity value of the object; Goes from0to1. (Float) -
.angle- The angle value of the object. (Float) -
.color- The hex color of the object. (Int) (Must be a hexadecimal value) -
.visible- Whether the object is visible or not. (Boolean) -
.antialiasing- Whether the border of an object will be smooth or not, this will affect performance. (Boolean) -
.flipX- Flips the object on the x axis. (Boolean) -
.flipY- Flips the object on the y axis. (Boolean) -
.scale.x- The scale at the x axis value of an object, The hitbox is not automatically updated. (Float) -
.scale.y- The scale at the y axis value of an object, The hitbox is not automatically updated. (Float) -
.offset.x- The x offset value of the object. (Float) -
.offset.y- The y offset value of the object. (Float) -
.origin.x- The x origin value of the object. (Float) -
.origin.y- The y origin value of the object. (Float) -
.scrollFactor.x- The scroll factor at the x value of the object. (Float) -
.scrollFactor.y- The scroll factor at the y value of the object. (Float)
-
noteData- Which strum this note will go on; Goes from0to3(Int) -
strumTime- Where this note in the chart is, in milliseconds. (Float) -
noAnimation- Disables any singing animations when hitting this note. (Boolean) -
noMissAnimation- Disables any missing animations when missing this note. (Boolean) -
hitCausesMiss- Gives misses when hitting this note. (Boolean) -
blockHit- Blocks the player from being able to hit this note.(Boolean) -
ignoreNote- Whether this note should have a penalty for missing. (Boolean) -
canBeHit- Checks if this note is in range and can be hit by the player. (Boolean) -
noteWasHit- Checks if this note was hit, duh. (Boolean) -
wasGoodHit- Checks if this note was hit by the player. (Boolean) -
hitByOpponent- Checks if this note was hit by the opponent. (Boolean) -
tooLate- Checks if this note is no longer in range and cannot be hit. (Boolean) -
hitsoundDisabled- Whether the hitsound should be disabled on this note. (Boolean) -
hitsound- Which sound to play when hitting this note. (String) -
hitHealth- The specified amount of health gained when hitting this note; Default value:0.023. (Float) -
missHealth- The specified amount of health lost when missing this note; Default value:0.0475. (Float) -
mustPress- Checks if this note is on the player's side. (Boolean) -
isSustainNote- Checks if the note is a sustain note. (Boolean) -
texture- The texture of the note. (String) -
noteType- Checks the note type. (String) -
gfNote- Checks if GF is singing. (Boolean) -
offsetX- Offsets the note'sXposition; Does not requirecopyXto be turned off. (Float) -
offsetY- Offsets the note'sYposition; Does not requirecopyYto be turned off. (Float) -
offsetAngle- Offsets the note'sangleposition; Does not requirecopyAngleto be turned off. (Float) -
multAlpha- Thealphamultiplier value of the note; Does not requirecopyAlphato be turned off. (Float) -
multSpeed- The scroll speed multiplier of the note. (Float) -
copyX- Variable determining if the note will follow the strum'sXposition; It's recommended to use theoffsetXvariable instead of turning this off. (Boolean) -
copyY- Variable determining if the note will follow the strum'sYposition; It's recommended to use theoffsetYvariable instead of turning this off. (Boolean) -
copyAngle- Variable determining if the note will follow the strum'sanglevalue; It's recommended to use theoffsetAnglevariable instead of turning this off. (Boolean) -
copyAlpha- Variable determining if the note will follow the strum'salphavalue; It's recommended to use themultAlphavariable instead of turning this off. (Boolean) -
rgbShader- The RGB Shader that the strums and notes are using; More info on how to disable it here!! (RGBShaderReference) -
noteSplashData.disabled- Whether the note splashes will be disabled or not. (Boolean) -
noteSplashData.texture- The note splashes texture to use. (String) -
noteSplashData.useGlobalShader- If set totrue, the note splash will use the note's default RGB colors in the options. (Boolean) -
noteSplashData.useRGBShader- If set tofalse, note splashes will no longer use the RGB Shader. (Boolean) -
noteSplashData.r- The note splashes red value; Default value:-1. (Int) -
noteSplashData.g- The note splashes green value; Default value:-1. (Int) -
noteSplashData.b- The note splashes blue value; Default value:-1. (Int) -
noteSplashData.a- The note splashes alpha/opacity value; Default value:0.6. (Float)
Deprecated Note Properties:
-
noteSplashDisabled- Whether the note splashes will be disabled or not. (Boolean) -
noteSplashTexture- The note splashes texture to be used. (String) -
noteSplashHue- Changes the HUE value of the note; Goes from-180to180; Default value:0. (Int) -
noteSplashBrt- Changes the brightness value of the note; Goes from-100to100; Default value:0. (Int) -
noteSplashSat- Changes the saturation value of the note; Goes from-100to100; Default value:0. (Int)
-
notes- Notes that are currently spawned. -
unspawnNotes- Notes that are not currently spawned. -
grpNoteSplashes- The note splash group. -
eventNotes- Self explanatory. -
playerStrums- Notes from the Player strums; Goes from0to3. -
opponentStrums- Notes from the Opponent strums; Goes from0to3. -
strumLineNotes- Notes from both Player and Opponent strums; Goes from0to7; Opponent Strums:0,1,2,3; Player Strums:4,5,6,7.
Is the page in some way inaccurate? an error, a typo, or outdated data? To report it, use the "Issue Tab". Or do you wish to include a new function or add new information? use the "Pull Request Tab". Help is always appreciated!
- Event Callbacks
- Custom Sprite
- Custom Text
- Object Functions
- General Functions
- Scripting & File Functions
- Game Input Control Functions
- Language Translation
- HScript Functions
- Custom Substates
- Custom Shaders
- Deprecated & Removed Functions
- Sound & Music Functions
- Tweens & Timers Functions
- Reflection Functions
- Variables