TheZoroForce240 / FNF-Modcharting-Tools

Apache License 2.0
51 stars 24 forks source link

My Modchart broke!! #27

Closed ZSolarDev closed 1 year ago

ZSolarDev commented 1 year ago

I installed this and my modchart died. is this an issue with the tool itself? or is this an issue with my modchart? here is the modchart:

local shaderName = 'Funi waveform'
-- EXTRA CAMERAS
local extraCamAmount = 4
local noteUpDown = true
local camHudLeft = true

function onCreate()
    addHaxeLibrary('FlxCamera','flixel')
    runHaxeCode([[
        FlxG.camera.bgColor=0x00000000;
    ]])
    local camNames="game.camHUD"
    local camCode=""
    for i=1,extraCamAmount+1 do -- the +1 is because pause menu follows last camera created
        if i==extraCamAmount+1 then -- pause menu camera
            local camName="top5CameraFixes"
            camCode=camCode..[[
                var ]]..camName..[[:FlxCamera = new FlxCamera();
                 FlxG.cameras.add(]]..camName..[[, false);
                setVar(']]..camName..[[',]]..camName..[[);
                ]]
        else
            camNames=camNames..",".."extraCam"..tostring(i)..""
            local camName="extraCam"..tostring(i)
            camCode=camCode..[[
                var ]]..camName..[[:FlxCamera = new FlxCamera();
                 FlxG.cameras.add(]]..camName..[[, false);
                setVar(']]..camName..[[',]]..camName..[[);
                ]]
            makeLuaSprite(camName,0,0,'')
            --setProperty(camName..".alpha",0)
            -- ^^ uncomment for camera start hidden
        end
    end
    camCode=camCode..[[
        game.strumLineNotes.cameras = []]..camNames..[[];
        game.grpNoteSplashes.cameras = []]..camNames..[[];
        game.notes.cameras = []]..camNames..[[];
    ]]

    -- ^^ THIS ADDS THE SPLASHES / NOTES / STRUMS TO NEW CAMERAS!
    runHaxeCode(camCode)
    runHaxeCode([[
        FlxG.cameras.add(game.camHUD, true);
    ]])
end

function onUpdate(elapsed)
    for i=1,extraCamAmount do
        local name="extraCam"..tostring(i)
        local y=getProperty(name..".y");
        local x=getProperty(name..".x");
        local angle=getProperty(name..".angle");
        local alpha=getProperty(name..".alpha");
        local zoom=getProperty(name..".scale.x")*getProperty("camHUD.zoom");
        runHaxeCode([[
            var cam:FlxCamera = getVar(']]..name..[[');
            cam.y=]]..y..[[;
            cam.x=]]..x..[[;
            cam.alpha=]]..alpha..[[;
            cam.angle=]]..angle..[[;
            cam.zoom=]]..zoom..[[;
        ]])
    end
end

-- THE ACTUALL SCRIPT

function onCreatePost()
    setProperty('extraCam1.y', -720)
    setProperty('extraCam2.y', -720)
    setProperty('extraCam1.x', -500)
    setProperty('extraCam2.x', 500)
    setProperty('extraCam3.y', 720)
    setProperty('extraCam4.y', 720)
    setProperty('extraCam3.x', -500)
    setProperty('extraCam4.x', 500)
end

function onBeatHit()
    if curBeat == 32 then
        doTweenY('cam1TweenY', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam2TweenY', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
    end
    if curBeat == 64 then
        doTweenY('cam1TweenY', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam2TweenY', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenX('cam1TweenX', 'extraCam1', -700, (crochet/1000 * 2), 'elasticOut')
        doTweenX('cam2TweenX', 'extraCam2', 700, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam1TweenAlpha', 'extraCam1', 0.5, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam2TweenAlpha', 'extraCam2', 0.5, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam1TweenAngle', 'extraCam1', 90, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam2TweenAngle', 'extraCam2', -90, (crochet/1000 * 2), 'elasticOut')
    end
    if curBeat == 96 then
        doTweenX('cam1TweenX', 'extraCam1', -300, (crochet/1000), 'quadInOut')
        doTweenX('cam2TweenX', 'extraCam2', 300, (crochet/1000), 'quadInOut')
    end
    if curBeat == 97 then
        doTweenX('cam1TweenX', 'extraCam1', 200, (crochet/1000), 'quadInOut')
        doTweenX('cam2TweenX', 'extraCam2', -200, (crochet/1000), 'quadInOut')
    end
    if curBeat == 128 then
        doTweenX('cam1TweenX', 'extraCam1', -500, (crochet/1000), 'quadInOut')
        doTweenX('cam2TweenX', 'extraCam2', 500, (crochet/1000), 'quadInOut')
        doTweenY('cam1TweenY', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam2TweenY', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam3TweenY', 'extraCam3', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam4TweenY', 'extraCam4', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam1TweenAlpha', 'extraCam1', 1, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam2TweenAlpha', 'extraCam2', 1, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam1TweenAngle', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam2TweenAngle', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam3TweenAngle', 'extraCam3', 180, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam4TweenAngle', 'extraCam4', 180, (crochet/1000 * 2), 'elasticOut')
    end
    if curBeat > 127 and curBeat % 4 == 0 and curBeat < 192 then
        if camHudLeft then
            camHudLeft = false
            doTweenAngle('camHudAngle', 'camHUD', 10, (crochet/1000), 'elasticOut')

            doTweenAngle('cam1TweenAngle', 'extraCam1', 10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam2TweenAngle', 'extraCam2', 10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam3TweenAngle', 'extraCam3', 190, (crochet/1000), 'elasticOut')
            doTweenAngle('cam4TweenAngle', 'extraCam4', 190, (crochet/1000), 'elasticOut')
        else
            camHudLeft = true
            doTweenAngle('camHudAngleOther', 'camHUD', -10, (crochet/1000), 'elasticOut')

            doTweenAngle('cam1TweenAngle', 'extraCam1', -10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam2TweenAngle', 'extraCam2', -10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam3TweenAngle', 'extraCam3', 170, (crochet/1000), 'elasticOut')
            doTweenAngle('cam4TweenAngle', 'extraCam4', 170, (crochet/1000), 'elasticOut')
        end
    end
    if curBeat == 192 then
        doTweenAngle('camHudAngleOther', 'camHUD', 0, (crochet/1000), 'elasticOut')
        doTweenX('cam1TweenX', 'extraCam1', -500, (crochet/1000), 'quadInOut')
        doTweenX('cam2TweenX', 'extraCam2', 500, (crochet/1000), 'quadInOut')
        doTweenY('cam1TweenY', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam2TweenY', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam3TweenY', 'extraCam3', 720, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam4TweenY', 'extraCam4', 720, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam1TweenAlpha', 'extraCam1', 0.5, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam2TweenAlpha', 'extraCam2', 0.5, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam1TweenAngle', 'extraCam1', 180, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam2TweenAngle', 'extraCam2', 180, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam3TweenAngle', 'extraCam3', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam4TweenAngle', 'extraCam4', 0, (crochet/1000 * 2), 'elasticOut')
    end
    --from here it stops working????
    if curBeat > 191 and curBeat % 2 == 0 and curBeat < 223 then
        if noteUpDown then
            noteUpDown = false
            noteTweenY('Note1', 4, 50 - 40, (crochet/1000), 'circOut')
            noteTweenY('Note2', 5, 50 + 40, (crochet/1000), 'circOut')
            noteTweenY('Note3', 6, 50 - 40, (crochet/1000), 'circOut')
            noteTweenY('Note4', 7, 50 + 40, (crochet/1000), 'circOut')
        else
            noteUpDown = true
            noteTweenY('Note1', 4, 50 + 40, (crochet/1000), 'circOut')
            noteTweenY('Note2', 5, 50 - 40, (crochet/1000), 'circOut')
            noteTweenY('Note3', 6, 50 + 40, (crochet/1000), 'circOut')
            noteTweenY('Note4', 7, 50 - 40, (crochet/1000), 'circOut')
        end
    end
    if curBeat == 224 then
        noteTweenY('Note1', 4, 50, (crochet/1000), 'circOut')
        noteTweenY('Note2', 5, 50, (crochet/1000), 'circOut')
        noteTweenY('Note3', 6, 50, (crochet/1000), 'circOut')
        noteTweenY('Note4', 7, 50, (crochet/1000), 'circOut')
        doTweenX('cam1TweenX', 'extraCam1', -500, (crochet/1000), 'quadInOut')
        doTweenX('cam2TweenX', 'extraCam2', 500, (crochet/1000), 'quadInOut')
        doTweenY('cam1TweenY', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam2TweenY', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam3TweenY', 'extraCam3', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam4TweenY', 'extraCam4', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam1TweenAlpha', 'extraCam1', 1, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam2TweenAlpha', 'extraCam2', 1, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam1TweenAngle', 'extraCam1', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam2TweenAngle', 'extraCam2', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam3TweenAngle', 'extraCam3', 180, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam4TweenAngle', 'extraCam4', 180, (crochet/1000 * 2), 'elasticOut')
    end
    if curBeat > 223 and curBeat % 4 == 0 and curBeat < 288 then
        if camHudLeft then
            camHudLeft = false
            doTweenAngle('camHudAngle', 'camHUD', 10, (crochet/1000), 'elasticOut')

            doTweenAngle('cam1TweenAngle', 'extraCam1', 10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam2TweenAngle', 'extraCam2', 10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam3TweenAngle', 'extraCam3', 190, (crochet/1000), 'elasticOut')
            doTweenAngle('cam4TweenAngle', 'extraCam4', 190, (crochet/1000), 'elasticOut')
        else
            camHudLeft = true
            doTweenAngle('camHudAngleOther', 'camHUD', -10, (crochet/1000), 'elasticOut')

            doTweenAngle('cam1TweenAngle', 'extraCam1', -10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam2TweenAngle', 'extraCam2', -10, (crochet/1000), 'elasticOut')
            doTweenAngle('cam3TweenAngle', 'extraCam3', 170, (crochet/1000), 'elasticOut')
            doTweenAngle('cam4TweenAngle', 'extraCam4', 170, (crochet/1000), 'elasticOut')
        end
    end
    if curBeat == 288 then
        doTweenAngle('camHudAngleOther', 'camHUD', 0, (crochet/1000), 'elasticOut')
        doTweenX('cam1TweenX', 'extraCam1', -500, (crochet/1000), 'quadInOut')
        doTweenX('cam2TweenX', 'extraCam2', 500, (crochet/1000), 'quadInOut')
        doTweenY('cam1TweenY', 'extraCam1', 720, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam2TweenY', 'extraCam2', 720, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam3TweenY', 'extraCam3', -720, (crochet/1000 * 2), 'elasticOut')
        doTweenY('cam4TweenY', 'extraCam4', -720, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam1TweenAlpha', 'extraCam1', 0.5, (crochet/1000 * 2), 'elasticOut')
        doTweenAlpha('cam2TweenAlpha', 'extraCam2', 0.5, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam1TweenAngle', 'extraCam1', 180, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam2TweenAngle', 'extraCam2', 180, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam3TweenAngle', 'extraCam3', 0, (crochet/1000 * 2), 'elasticOut')
        doTweenAngle('cam4TweenAngle', 'extraCam4', 0, (crochet/1000 * 2), 'elasticOut')
    end
    if curBeat == 292 then
        cameraFade('camHUD', '000000', 0.8)
        cameraFade('camGame', '000000', 0.8)
    end
end

function onUpdatePost(elapsed)
    setShaderFloat("tempShader0", "iTime", os.clock())
    if healthDrain then
        if getProperty('health') > 0.1 then
            addHealth(-0.002)
        end
    end
end

function onSongStart()
    makeLuaSprite('tempShader0')
    healthDrain = true
    --runHaxeCode([[
    --  var shaderName = "]] .. shaderName .. [[";

    --  game.initLuaShader(shaderName);
    --   var shader0 = game.createRuntimeShader(shaderName);
    --  game.camGame.setFilters([new ShaderFilter(shader0)]);
    --  game.getLuaObject("tempShader0").shader = shader0;
    --  return;
    --]])
end
Slushi-Github commented 1 year ago

you cannot use tweens from the notes (i.e., those normal functions of making a modchart in Lua) when you have installed that, you would have to redo the modchart with the functions of this modcharts system.

ZSolarDev commented 1 year ago

oh. Well thanks anyways.