ShadowMario / FNF-PsychEngine

Engine originally used on Mind Games mod
Apache License 2.0
1.15k stars 2.21k forks source link

i have 3 lua questions #6126

Closed machonessiebaby closed 2 years ago

machonessiebaby commented 2 years ago

Describe your problem here.

I have 3 questions about lua and how to do some things

1: How do i make the notes move around in lua 2: how do i make ghost tapping disable on a song 3: how do i tween move the window

if you can help me Please tell me i wana do this cool thing for an experiment

Are you modding a build from source or with Lua?

Lua

What is your build target?

Windows x64

Did you edit anything in this build? If so, mention or summarize your changes.

nope

JBB248 commented 2 years ago

1: Use noteTweenX(tag:String, note:Int, value:Dynamic, duration:Float, ease:String) or noteTweenY(tag:String, note:Int, value:Dynamic, duration:Float, ease:String)

Instructions on noteTweening are in the Wiki under Tweens and Timers.

2: Use setPropertyFromClass('ClientPrefs', 'ghostTapping', false);

3: Use setPropertyFromClass('openfl.Lib','application.window.x', --[[Whatever value]]); or setPropertyFromClass('openfl.Lib','application.window.y', --[[Whatever value]]);

machonessiebaby commented 2 years ago

Thanks sorry I'm using email I don't have my GitHub in phone

On Wed, Mar 2, 2022 at 11:08 PM Blaze @.***> wrote:

1: Use noteTweenX(tag:String, note:Int, value:Dynamic, duration:Float, ease:String) or noteTweenY(tag:String, note:Int, value:Dynamic, duration:Float, ease:String)

2: Use setPropertyFromClass('ClientPrefs', 'ghostTapping', false);

3: Use setPropertyFromClass('openfl.Lib','application.window.x', --[[Whatever value]]); or setPropertyFromClass('openfl.Lib','application.window.y', --[[Whatever value]]);

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/6126#issuecomment-1057645526, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANNW4V7DCBWZ4ZIWGNCKOZLU6A3NRANCNFSM5PY5XWWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

machonessiebaby commented 2 years ago

setPropertyFromClass('openfl.Lib','application.window.x', --[[Whatever value]]);

hey uh i added the window move but im getting image this error

JBB248 commented 2 years ago

Can you show me the code you used?

machonessiebaby commented 2 years ago

is it like this or did i do a stupid image

machonessiebaby commented 2 years ago

Can you show me the code you used?

let me send the lua file code rq

machonessiebaby commented 2 years ago

local xx = 520; local yy = 450; local xx2 = 820; local yy2 = 450; local ofs = 60; local followchars = true; local del = 0; local del2 = 0;

local notePositions = {}

function onCreatePost() notePositions = { defaultPlayerStrumX0, defaultPlayerStrumX1, defaultPlayerStrumX2, defaultPlayerStrumX3, defaultOpponentStrumX0, defaultOpponentStrumX1, defaultOpponentStrumX2, defaultOpponentStrumX3 }

for i = 1, 8, 1 do
    noteTweenX('noteTween'..i, i-1, notePositions[i], 100, 'linear')
end

end

function onCreate() setPropertyFromClass('ClientPrefs', 'middleScroll', true); setPropertyFromClass('ClientPrefs', 'ghosttapping', false);

setPropertyFromClass('openfl.Lib','application.window.x', --[[Whatever value]]);
setPropertyFromClass('openfl.Lib','application.window.y', --[[Whatever value]]);

end

function onUpdatePost()

if middlescroll and not inGameOver then setPropertyFromGroup('opponentStrums',0,'alpha',0) setPropertyFromGroup('opponentStrums',1,'alpha',0) setPropertyFromGroup('opponentStrums',2,'alpha',0) setPropertyFromGroup('opponentStrums',3,'alpha',0) end

end

function onUpdate() if del > 0 then del = del - 1 end if del2 > 0 then del2 = del2 - 1 end if followchars == true then if mustHitSection == false then if getProperty('dad.animation.curAnim.name') == 'singLEFT' then triggerEvent('Camera Follow Pos',xx-ofs,yy) end if getProperty('dad.animation.curAnim.name') == 'singRIGHT' then triggerEvent('Camera Follow Pos',xx+ofs,yy) end if getProperty('dad.animation.curAnim.name') == 'singUP' then triggerEvent('Camera Follow Pos',xx,yy-ofs) end if getProperty('dad.animation.curAnim.name') == 'singDOWN' then triggerEvent('Camera Follow Pos',xx,yy+ofs) end if getProperty('dad.animation.curAnim.name') == 'singLEFT-alt' then triggerEvent('Camera Follow Pos',xx-ofs,yy) end if getProperty('dad.animation.curAnim.name') == 'singRIGHT-alt' then triggerEvent('Camera Follow Pos',xx+ofs,yy) end if getProperty('dad.animation.curAnim.name') == 'singUP-alt' then triggerEvent('Camera Follow Pos',xx,yy-ofs) end if getProperty('dad.animation.curAnim.name') == 'singDOWN-alt' then triggerEvent('Camera Follow Pos',xx,yy+ofs) end if getProperty('dad.animation.curAnim.name') == 'idle-alt' then triggerEvent('Camera Follow Pos',xx,yy) end if getProperty('dad.animation.curAnim.name') == 'idle' then triggerEvent('Camera Follow Pos',xx,yy) end else

        if getProperty('boyfriend.animation.curAnim.name') == 'singLEFT' then
            triggerEvent('Camera Follow Pos',xx2-ofs,yy2)
        end
        if getProperty('boyfriend.animation.curAnim.name') == 'singRIGHT' then
            triggerEvent('Camera Follow Pos',xx2+ofs,yy2)
        end
        if getProperty('boyfriend.animation.curAnim.name') == 'singUP' then
            triggerEvent('Camera Follow Pos',xx2,yy2-ofs)
        end
        if getProperty('boyfriend.animation.curAnim.name') == 'singDOWN' then
            triggerEvent('Camera Follow Pos',xx2,yy2+ofs)
        end
    if getProperty('boyfriend.animation.curAnim.name') == 'idle' then
            triggerEvent('Camera Follow Pos',xx2,yy2)
        end
    end
else
    triggerEvent('Camera Follow Pos','','')
end

end function opponentNoteHit() health = getProperty('health') if getProperty('health') > 0.4 then setProperty('health', health- 0.017); end end

machonessiebaby commented 2 years ago

wait i think i know what to do

frantastic24 commented 2 years ago

You're supposed to type in your values in --[[Whatever value]] bruh

JBB248 commented 2 years ago

Yeah

machonessiebaby commented 2 years ago

You're supposed to type in your values in --[[Whatever value]] bruh

ah ok

machonessiebaby commented 2 years ago

i fixed it but its now saying line 35 error

JBB248 commented 2 years ago

It’s not a comment anymore, right?

It’s just a number?

frantastic24 commented 2 years ago

Kinda hard to tell which line is 35 with a screenshot and a messed up code block

JBB248 commented 2 years ago

Indeed

machonessiebaby commented 2 years ago

Kinda hard to tell which line is 35 with a screenshot and a messed up code block

here so image i made it only 4 lines and the error was line 4 image

frantastic24 commented 2 years ago

It's supposed to just be the numbers

JBB248 commented 2 years ago

That’s still a comment

machonessiebaby commented 2 years ago

so uncomment it?

JBB248 commented 2 years ago

Take off the hyphens and brackets

machonessiebaby commented 2 years ago

Take off the hyphens and brackets

ok

machonessiebaby commented 2 years ago

Take off the hyphens and brackets

ok so it moves but how would you make it smoothly move?

frantastic24 commented 2 years ago

Start reading the Lua script examples from the wiki to understand basic Lua syntax

machonessiebaby commented 2 years ago

otherwise ill just use what you gave lol

machonessiebaby commented 2 years ago

ok

frantastic24 commented 2 years ago

You'll need an entirely different and way more complex script to make it move smoothly, pretty sure it's in discussions

machonessiebaby commented 2 years ago

You'll need an entirely different and way more complex script to make it move smoothly, pretty sure it's in discussions

k