ShadowMario / FNF-PsychEngine

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

How can i make screen wave like on Sunshine sonic.exe #3658

Closed Den198888 closed 2 years ago

Den198888 commented 2 years ago

Describe your problem here.

i am trying to port but it was my first time doing it, LUA is what i am using i already did the lights out but idk how to make screen wave and floating opponent in circle help plssss Screenshot_2022-01-17-06-54-19-49_e4b17b709a49379a0b207d2e3e43882a

Are you modding a build from source or with Lua?

Lua

What is your build target?

Neko, HashLink, or other build system

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

Just winning icon

frantastic24 commented 2 years ago

you can create a vcr effect with addVCREffect() and for the floating effect

local floaty = 41.82
local tailscircle = '' -- you'll use this to make the opponent hover up/down or in circles

function onUpdate()
    floaty = floaty+0.03

    if tailscircle == 'hovering' or tailscircle == 'circling' then
        setCharacterY('dad', getCharacterY('dad')+math.sin(floaty) * 1.3);
    end
    if tailscircle == 'circling' then
        setCharacterX('dad', getCharacterX('dad')+math.cos(floaty) * 1.3);
    end
end
Den198888 commented 2 years ago

Thank you so much ♥️♥️

On Tue, Jan 18, 2022, 8:15 AM frantastic24 @.***> wrote:

you can create a vcr effect with addVCREffect() and for the floating effect

local floaty = 41.82 local tailscircle = '' -- you'll use this to make the opponent hover up/down or in circles

function onUpdate() floaty = floaty+0.03

if tailscircle == 'hovering' or tailscircle == 'circling' then setCharacterY('dad', getCharacterY('dad')+math.sin(floaty) 1.3); end if tailscircle == 'circling' then setCharacterX('dad', getCharacterX('dad')+math.cos(floaty) 1.3); end end

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1014967649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGG7DO7B7ZS2TVYMCQTUWSWJTANCNFSM5MDJ6OLA . 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: @.***>

Den198888 commented 2 years ago

can i ask 1 amm, where i gonna put the 'addVCREffect()' on stage or lua on data tnxx

On Tue, Jan 18, 2022, 8:15 AM frantastic24 @.***> wrote:

you can create a vcr effect with addVCREffect() and for the floating effect

local floaty = 41.82 local tailscircle = '' -- you'll use this to make the opponent hover up/down or in circles

function onUpdate() floaty = floaty+0.03

if tailscircle == 'hovering' or tailscircle == 'circling' then setCharacterY('dad', getCharacterY('dad')+math.sin(floaty) 1.3); end if tailscircle == 'circling' then setCharacterX('dad', getCharacterX('dad')+math.cos(floaty) 1.3); end end

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1014967649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGG7DO7B7ZS2TVYMCQTUWSWJTANCNFSM5MDJ6OLA . 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: @.***>

frantastic24 commented 2 years ago

if you are planning to just use it in one stage just put it in your stage .lua under onCreate()

Den198888 commented 2 years ago

Screenshot_2022-01-18-09-11-13-72_87c2225eebc34d2513fa0e7ad5b93cfc

Like this, i run the game and the stage is gone

frantastic24 commented 2 years ago

you have to specify which camera to add the effect on, like addVCREffect('camHUD') for example

Den198888 commented 2 years ago

ohh, okay imma try it

Den198888 commented 2 years ago

for some reason, if i put it in the TDStage.lua the TailsBG is gone but it doesn't say error on lua

frantastic24 commented 2 years ago

then you're doing something wrong

Den198888 commented 2 years ago

Screenshot_2022-01-18-10-35-03-02_87c2225eebc34d2513fa0e7ad5b93cfc

but i placed it on under the function onCreate()

frantastic24 commented 2 years ago

you didn't close the line with ;

Den198888 commented 2 years ago

im sorrryyy, i am not good at lua's

On Tue, Jan 18, 2022, 10:50 AM frantastic24 @.***> wrote:

you didn't close the line with ;

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1015024411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGBIAQBG5AU5OKNOSS3UWTIQFANCNFSM5MDJ6OLA . 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: @.***>

Den198888 commented 2 years ago

Screenshot_2022-01-18-10-54-39-85_87c2225eebc34d2513fa0e7ad5b93cfc

i did it but, i doesn't apply the effects and bg still gone

Den198888 commented 2 years ago

Screenshot_2022-01-18-10-57-02-99_99c04817c0de5652397fc8b56c3b3817

frantastic24 commented 2 years ago

you probably have an outdated version that doesn't support shaders then

Den198888 commented 2 years ago

I am at 0.5, but still thank you for your help :)

On Tue, Jan 18, 2022, 11:16 AM frantastic24 @.***> wrote:

you probably have an outdated version that doesn't support shaders then

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1015035589, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGFW7AYEP5Y3XJT3OMLUWTLSTANCNFSM5MDJ6OLA . 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: @.***>

frantastic24 commented 2 years ago

i'm pretty sure 0.5 doesn't have shader support so yeah

Den198888 commented 2 years ago

maybe, i will wait for 0.5.1 port 😄

On Tue, Jan 18, 2022, 11:23 AM frantastic24 @.***> wrote:

i'm pretty sure 0.5 doesn't have shader support so yeah

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1015038267, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGGVBGFAQMW4ZXR6NXTUWTMKLANCNFSM5MDJ6OLA . 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: @.***>

frantastic24 commented 2 years ago

You're doing everything through the mods folder right? If so you can just get the latest version and just copy the folder I recommend updating to 0.5.1 anyways since some Lua variables (namely curBeat I think) were broken in 0.5

Edit: actually shaders are not in any release yet, but they are in source. If you can get a build from source (through the Actions tab) then you should have shader support

Den198888 commented 2 years ago

Ok, I'll do that. thanks, im using android ports soo i gonna need to wait till, someone or the porter update it😄

On Tue, Jan 18, 2022, 11:35 AM frantastic24 @.***> wrote:

You're doing everything through the mods folder right? If so you can just get the latest version and just copy the folder I recommend updating to 0.5.1 anyways since some Lua variables (namely curBeat I think) were broken in 0.5

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1015042658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGGA5FN27LUWYTBF2RDUWTNZHANCNFSM5MDJ6OLA . 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: @.***>

frantastic24 commented 2 years ago

I see, probably gonna take a good while then unfortunately

Den198888 commented 2 years ago

Ok, no problem. but can i have an 1 question again 😅 it is possible to change the 3, 2, 1, GO to ready, set, go using the onStartCountdown i saw it on the source of sonic with crochet i think, but how can i stop the song while playing the ready, set, go

On Tue, Jan 18, 2022, 11:43 AM frantastic24 @.***> wrote:

I see, probably gonna take a good while then unfortunately

— Reply to this email directly, view it on GitHub https://github.com/ShadowMario/FNF-PsychEngine/issues/3658#issuecomment-1015044954, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7OPGCNQFWA7YDE535WYIDUWTOVTANCNFSM5MDJ6OLA . 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: @.***>

Den198888 commented 2 years ago

Screenshot_2022-01-18-23-22-56-19_87c2225eebc34d2513fa0e7ad5b93cfc

i did mine like this

frantastic24 commented 2 years ago

You should use function onStartCountdown() and if counter == (number) for that, I think I'm doing my own port of this song so I can let you know if this works in a bit

Den198888 commented 2 years ago

like this? or i will put the counter on up (sorry i didn't notice your comment i sleep)

function onStartCoundown() if counter == 0 then setProperty('ready1.visible', true); playSound('intro2') end

Den198888 commented 2 years ago

i will try it

edit: goodnews the porter updated it to 0.5.1 but beta so i will still wait for 1-7weeks maybe

edit2: do i need to put if notAllowCoundown then because it used the old one

frantastic24 commented 2 years ago

Well I did kinda manage to replicate it by skipping the countdown and just doing it manually but in doing that it messed up the spawning strums and the opponent's left strum behaves weirdly, so I just decided not to include it

Den198888 commented 2 years ago

maybe the best way is just like on sounds make no sound intro3 'ready' the intro1 (will be intro2) 'rename ready to intro2' 'set' intro2 (intro1) 'rename set into intro1' 'go' introGo

then ready, set, go assets

(make Sunshine folder so it doesn't affect all songs Countdown)

Den198888 commented 2 years ago

is the

var is local? and

spr.alpha like when tdoll-alt hits note will hide the hud

im learning lua because i dont know how to do source even i watch tutorials

frantastic24 commented 2 years ago

Unfortunately you can't use different countdown assets with a folder, although you can if you include the song in a different pack but that's just inconvenient I can send you the code I made for the lights out segment if you want Here's the finished product if you're interested

Den198888 commented 2 years ago

wait, how do you keep the hud fade when long notes, i alrdy did the off lights

frantastic24 commented 2 years ago

if curStep > 588 and curStep < 860 and isSustainNote == false then

Den198888 commented 2 years ago

the if curStep on function onStepHit

function opponentNoteHit the isSustainNote == false then doTweenAlpha('hudAlpha', 'camHUD', 1, 0.1, 'linear');

is the 'and' is part of it

frantastic24 commented 2 years ago

this doesn't go in onStepHit, the entire line (yes, the ANDs are part of it) goes under opponentNoteHit

Den198888 commented 2 years ago

ohh sorry, i thought curStep only will be on onStepHit thnx

(i will credits you 😄)

Den198888 commented 2 years ago

Screenshot_2022-01-19-10-57-58-20_87c2225eebc34d2513fa0e7ad5b93cfc

like this or doNoteAlpha is what i need i cant send videos here for soem reason

frantastic24 commented 2 years ago

first you need to set the alpha to 0.7, then do an alpha tween that lowers it to 0

setProperty('camHUD.alpha', 0.7);
doTweenAlpha('hudAlpha', 'camHUD', 0, 0.4, 'linear')

that's pretty much what i did except i individually got rid of each UI object so i can just brighten the strums and nothing else, but this works if you prefer the simpler solution

Den198888 commented 2 years ago

id, direction, noteType, isSustainNote iforgot to put this, but it fade fast then back to normal again

frantastic24 commented 2 years ago

it's supposed to fade quickly, that's how it works in the original song what do you mean by "back to normal" though, because it's working fine for me

Den198888 commented 2 years ago

how can i send vids here, wait i will show ti

frantastic24 commented 2 years ago

you could upload it to google drive or something if it's too big

Den198888 commented 2 years ago

https://user-images.githubusercontent.com/96397208/150059009-9b3089bc-39b1-46ac-82a9-32de5d3775cf.mp4

this

it will back to normal

frantastic24 commented 2 years ago

Screenshot_2022-01-19-10-57-58-20_87c2225eebc34d2513fa0e7ad5b93cfc

like this or doNoteAlpha is what i need i cant send videos here for soem reason

did you delete the tween on this screenshot

Den198888 commented 2 years ago

yes and replaced it like this like ehat you said

setProperty('camHUD.alpha', 0.7); doTweenAlpha('hudAlpha', 'camHUD', 0, 0.4, 'linear')

Den198888 commented 2 years ago

Screenshot_2022-01-19-11-26-24-63_87c2225eebc34d2513fa0e7ad5b93cfc

frantastic24 commented 2 years ago

no you did it the other way around, just copy the code and paste it as it is

Den198888 commented 2 years ago

https://user-images.githubusercontent.com/96397208/150060406-a1fc1666-ab38-4f39-ac57-f79064edb1cc.mp4

still keeps coming back to normal it doesn't want to stay faded

frantastic24 commented 2 years ago

send a screenshot of the code, i already tested it twice and it works fine

Den198888 commented 2 years ago

![Uploading Screenshot_2022-01-19-11-51-13-30_87c2225eebc34d2513fa0e7ad5b93cfc.jpg…]()

Den198888 commented 2 years ago

Screenshot_2022-01-19-11-51-13-30_87c2225eebc34d2513fa0e7ad5b93cfc