Open Average-FNF-Modder opened 1 week ago
Reason why it only plays twice is because there isn't any other callback to the second set of tweens, but there are up to two ways to do this depending on what version of Psych you're playing on and if you want to incorporate some Haxe with Lua. First option you could do is a persistent tween for all the notes using math.sin() in the onUpdate() function (I will follow up on this tomorrow, it's 1 am ;-; )
Basically if you want to do this with both notes, you could use something like this (with the slight ghost effect on alpha of course):
function onUpdate(elapsed)
noteTweenX(elapsed..'12',4,defaultPlayerStrumX0 + 1+(21*math.sin(getSongPosition()/400)),0.01)
noteTweenX(elapsed..'22',5,defaultPlayerStrumX1 + 2+(21*math.sin(getSongPosition()/400)),0.01)
noteTweenX(elapsed..'32',6,defaultPlayerStrumX2 + 3+(21*math.sin(getSongPosition()/400)),0.01)
noteTweenX(elapsed..'42',7,defaultPlayerStrumX3 + 4+(21*math.sin(getSongPosition()/400)),0.01)
noteTweenY(elapsed..'1',4,defaultPlayerStrumY0 + (11*math.sin(1+getSongPosition()/255)),0.01)
noteTweenY(elapsed..'2',5,defaultPlayerStrumY1 + (11*math.sin(2+getSongPosition()/255)),0.01)
noteTweenY(elapsed..'3',6,defaultPlayerStrumY2 + (11*math.sin(3+getSongPosition()/255)),0.01)
noteTweenY(elapsed..'4',7,defaultPlayerStrumY3 + (11*math.sin(4+getSongPosition()/255)),0.01)
end
If you're using any version that supports runHaxeCode() though, something like
runHaxeCode([[
for (i in 0...playerStrums.members.length) {
FlxTween.tween(playerStrums.members[i],{x: Math.sin(playerStrums.members[i].x) + playerStrums.members[i].x + 20},,{ease:FlxEase.sineInOut, type:FlxTween.PINGPONG});
}
]])
would probably work too. (only thing is I haven't found out how to really delay each for a wavy effect like the one above)
Describe your problem here.
I am a newbie at Lua coding, trying to make notes move back and forth to look all ghostly. Getting fucked.
There is a bunch of code I (Badly) tried to do this with. It barely works. It moves the first 2 once and then stops. If anyone has a script that does this or just knows how to fix my broken code that would be cool.
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.
No, I did not.