TheZoroForce240 / FNF-Modcharting-Tools

Apache License 2.0
51 stars 23 forks source link

Not an Issue but explaining what SOME functions do and how to go about it in Psych Lua #25

Open Cdash1w opened 1 year ago

Cdash1w commented 1 year ago

I hope someone can explain this better than me lol

startMod(Name: variable of the modifier, ModClass: modifier selected (Ex: ReverseModifier), Type: Strums that'll get effected by the modifier (All, Opponent, Player, Lane, set it to nothing Ex: '' for all, Playfield: playfield effected [-1 effects all of them])

setModTargetLane(Name: variable of the modifier, Value: lane of the strum EX: 0,1,2,3)

addPlayfield(X: Horizonal Axis, Y: Vertical Axis, Z: I think it's self explanatory now)

removePlayfield(ID: number of the playfield added)

tweenModifier(Modifier: variable of the modifier, Value: modifier value, Time: how long it takes to ease, Ease: type of motion it goes in (Ex: quadIn and Out))

tweenModifierSubValue() <-- Initially does the same thing as the function above ^ However some modifiers have sub values like the rotation modifier so that's what its there for (Ex: tweenModifierSubValue('rotateStrums', 'x', 3, 1, 'circOut'))

set(Beat: beat of the song (Ex: 1, 1.2, 2, 5.45), Args: value of modifier [Ex: "1,reverse"])

ease(Beat: beat of the song, Time: how long it takes to ease, Ease: self explanatory, Args: value of modifier [Ex: "1,reverse"])

you can look at the wiki for help whenever it gets updated lol

Sample Lua File and Json file for the modchart editor

Samples.zip

EdwhakKB commented 1 year ago

Hello im here to explain better how to use every modchart thing

modifiers

    DrunkXModifier, DrunkYModifier, DrunkZModifier

    TipsyXModifier, TipsyYModifier, TipsyZModifier

    ReverseModifier, IncomingAngleModifier, RotateModifier, StrumLineRotateModifier, (the last 3 ones works with [X Y Z, for StrumLine IncomingAngle and Rotate] [rotatePointX and rotatePointY, for Rotate and StrumLine])

    BumpyModifier,

    XModifier, YModifier, ZModifier, ConfusionModifier,

    ScaleModifier, ScaleXModifier, ScaleYModifier, SpeedModifier,

    StealthModifier, NoteStealthModifier, InvertModifier, FlipModifier,

    MiniModifier, ShrinkModifier, BeatXModifier, BeatYModifier, BeatZModifier,

    BounceXModifier, BounceYModifier, BounceZModifier,

    EaseCurveModifier, EaseCurveXModifier, EaseCurveYModifier, EaseCurveZModifier, EaseCurveAngleModifier,

    InvertSineModifier, BoostModifier, BrakeModifier, JumpModifier

--To move betwen center right and left i show you this shits MIDSCROLL:

340 for right -340 for left 0 to center again

RIGHTSCROLL:

-370 to center -670 to left 0 to right

--FOR OPONNENT

MIDSCROLL:

340 for center (0,1 strumLines) -340 for center (2,3 strumLines) 665 for right (0,1 strumLines) -665 for left (2,3 strumLines) 0 to original again

RIGHTSCROLL:

370 to center 670 to left 0 to right

--------------MODCHART VARS---------------- startMod(name,modClass,type,pf) --To start a modifier

setMod(name, value) --set a variable for the modifier (to make a modifier got a default value)

setSubMod(name, subValName,value) --A submodifier variable (this works only subValues it be specific, example setSubMod(sameNameAsStartMod, theSubValueItHave, the value))

setModTargetLane(name, value) --Strum Specific modifier value (for LaneSpecific basically setModTargetLane(nameOfTheModifier, lane))

setModPlayfield(name,value) --Extra line value (simply more strums thing same like setMod)

addPlayfield(x,y,z) --Add a extra line (add another line)

removePlayfield(idx) --Remove a extra line (remove one LMAO)

tweenModifier(modifier,val,time,ease) --do a modifier with a tween in seconds (make a modifier get a value with a tween)

tweenModifierSubValue(modifier,subValue,val,time,ease) --do a modifier with a subValue (make a modifierSubValue get a new value with a tween)

setModEaseFunc(name,ease) --A mod ease with a value (set a simple mod ease function)

set(beat, argsAsString) --Add a working variable in a beat

ease(beat, time, easeStr, argsAsString) --Add a working variable with movement in a beat --------------APPLY A MODCHART-------------- startMod('Whatever','BoostModifier','',0) --'modName','modifiername','lines(strumsToApply, player, opponent, custom, leave [""] for all, playfield 0 = default playfield

--start time, ease time, ease, modifier data (value, name) ease(beat, 2, 'expoOut', [[ 0.5, DrunkY, ]]) --Notes moves funky and cool, sustains also do curve effect

--Check example for more info about this lmao -Ed --------------SOME CHANGES SHITS LMAO---------------- ModName:speed ModName:x ModName:y ModName:z ModName:rotatePointX ModName:rotatePointY ---------------LANES YOU CAN USE------------- case 'player': PLAYERONLY;

case 'opponent': OPPONENTONLY;

case 'lane' | 'lanespecific': LANESPECIFIC; --------------DIFERENCE BETWEN HX AND LUA CUSTOM MODIFIERS----------------- --LUA game.playfieldRenderer.modifiers.get("customModTest").math you must call this with "startMod" before example

startMod('customModTest', 'Modifier', '', -1)

--you might get an error if you have luaDebugMode enabled, just ignore them lol it should still work
runHaxeCode([[

    //move notes and strums back a little
    game.playfieldRenderer.modifiers.get("customModTest").noteMath = function(noteData, lane, curPos, pf)
    {
        noteData.z += game.playfieldRenderer.modifiers.get("customModTest").currentValue * -500;
    }
    game.playfieldRenderer.modifiers.get("customModTest").strumMath = function(noteData, lane, pf)
    {
        noteData.z += game.playfieldRenderer.modifiers.get("customModTest").currentValue * -500;
    }

    //do crazy incoming angles
    game.playfieldRenderer.modifiers.get("customModTest").incomingAngleMath = function(lane, curPos, pf)
    {
        var xAngle = 45*lane + curPos/30;
        var yAngle = 90*lane + curPos/7;
        var value = game.playfieldRenderer.modifiers.get("customModTest").currentValue;
        return [xAngle*value, yAngle*value];
    }
]])

ease(64, 1, 'cubeInOut', [[
    1, customModTest
]])

--HX mod.math this one is with haxe code same like the modifiers inside the "modifier.hx" example

function initMod(mod)
{
    mod.curPosMath = function(lane, curPos, pf)
    {
        if (curPos <= -1250)
        {
            curPos = -1250 + (curPos*0.02);
        } 
        return curPos;
    };
    mod.noteMath = function(noteData, lane, curPos, pf)
    {
        var note = instance.notes.members[noteData.index];
        //desaturate the notes
        if (curPos <= -1250)
        {
            curPos = -1250 + (curPos*0.02);
            note.colorSwap.saturation = -0.95;
            note.colorSwap.brightness = -0.2;
        } 
        else if (curPos <= -700)
        {
            var a = (700-Math.abs(curPos))/(700-1250); //lerp out the desat
            note.colorSwap.saturation = -0.95*a;
            note.colorSwap.brightness = -0.2*a;
        }
        else 
        {
            note.colorSwap.saturation = 0;
            note.colorSwap.brightness = 0;
        }
    };
}

thats all

EdwhakKB commented 1 year ago

Well if you want it to be in lua you need add the modifier with a name i recommend using this for i = minNum, maxNum (usually 0,7) do startMod('X'..i, 'XModifier', 'lane', pf) --then add this setModTargetLane('X'..i, i) end

for editor you need to check the variable of (laneSpecific) inside the create modifier section and change the number bellow to add the modifier to a specific lane

EdwhakKB commented 1 year ago

you can make playfields invisible