Skip to content

Modifiers

TheZoroForce240 edited this page Feb 26, 2023 · 1 revision

Intro to Modifiers

Modifiers are an "effect" used by a modchart, each one runs code that modifies the position and data of a note/strum every time it gets draw to the screen, they can be as simple as offsetting the x/y/z and as complex as you want, being able to edit info of each note individually. Modifiers can be stacked and set to work with only with specific lanes, playfields or players.

Each Modifier has its own value used to change its effect, modifiers can also have sub values to edit certain things like the speed of an effect. A modifier also has a base value which makes it always do nothing when the value = base, as a way to disable it, for most modifiers this value would be 0.

Creating a Modifier

In Editor:

They can be created on the "Modifiers" tab inside the editor.

Modifiers need a few things to be created:

  • Name (must be unique)
  • Class
  • Type (optional)
  • Playfield (optional)
  • Lane (optional)

Name: A string for the name which can be inputted inside the "Modifier Name" input box, they must be unique and if duplicated will overwrite the previous modifier.

Class: A string for the class that the modifier uses, you can pick from the built in ones with the drop down or type in the name of a custom modifier in the "Modifier Class" input box, the class changes what a modifier actually does (for example, picking XModifier as the class means it will just change the x value of a note).

Type: A string for the type, types are optional and will default to "All", there are 4 that can be chosen which are "All", "Player", "Opponent" and "Lane", most of these should be self-explanatory, "Lane" also needs a separate value set which changes the lane it affects.

Playfield: A value which effects the playfield the modifier will effect, if set to -1, it will work on every playfield.

Lane: A value used with the "Lane" type to change which lane it effects.

In Scripts:

startMod(name:String, class:String, type:String, playfield:Int)

setModTargetLane(name:String, lane:Int)

Example:

startMod('reverse', 'ReverseModifier', 'Lane', -1)
setModTargetLane('reverse', 0)

List of built in Modifiers

DrunkXModifier, DrunkYModifier, DrunkZModifier - strums and notes sway/wave, with notes moving at a different rate so they "wiggle" as they reach the strumline, the main value affects the size of the wave, also has the sub value "speed".

TipsyXModifier, TipsyYModifier, TipsyZModifier - strums and notes sway/wave in an alternate like pattern, the main value affects the size of the wave, also has the sub value "speed".

ReverseModifier - flips the scroll (up to down, down to up).

IncomingAngleModifier - changes the angle that notes come from, the main modifier value does nothing, has sub values "x" and "y".

RotateModifier - rotates the notes/strums around the screen (based on its default position), the main modifier value does nothing, has sub values "x" and "y".

StrumLineRotateModifier - rotates the strumline (based on its default position), the main modifier value does nothing, has sub values "x" and "y".

XModifier, YModifier, ZModifier - changes the x/y/z position.

ConfusionModifier - changes the note angle.

ScaleModifier, ScaleXModifier, ScaleYModifier - changes the note/strum scale, the base value is 1! not 0.

SpeedModifier - speed multiplier, the base value is 1! not 0.

StealthModifier, NoteStealthModifier - changes the transparency of strums/notes (0 = visible, 1 = invisible, don't get confused lol).

InvertModifier - swaps the note lanes/columns, no invert: 0,1,2,3 invert: 1,0,3,2.

FlipModifier - flips the lanes/columns, no flip: 0,1,2,3 flip: 3,2,1,0.

MiniModifier - scales down the whole strumline, the base value is 1! not 0.

BeatXModifier, BeatYModifier, BeatZModifier - notes/strums will move to the beat of the song

BounceXModifier, BounceYModifier, BounceZModifier - notes bounce as they move towards the strumline.

BoostModifier - notes speed up as they move towards the strumline.

BrakeModifier - notes slow down as they move towards the strumline.

Custom modifiers

Custom modifiers can be created using hscript in .hx files, they must be placed inside the song data folder (the one that has the .json files for the chart) inside a folder called "customMods"

Template:

function initMod(mod)
{
    mod.noteMath = function(noteData, lane, curPos, pf)
    {
        
    };
    mod.strumMath = function(noteData, lane, pf)
    {
        
    };
    mod.incomingAngleMath = function(lane, curPos, pf)
    {
        return [0, 0];
    };
    mod.curPosMath = function(lane, curPos, pf)
    {
        return curPos;
    };
    mod.noteDistMath = function(noteDist, lane, curPos, pf)
    {
        return noteDist;
    };
}

need to finish this...

Clone this wiki locally