Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Score Text With Lua (and some arrow hud thing which is optional lmao) #14777

Closed
PumpkinSheee opened this issue May 29, 2024 · 37 comments
Closed
Labels
help wanted Extra attention is needed

Comments

@PumpkinSheee
Copy link

Describe your problem here.

so basically the basic score text on the hud is "SCORE: 0 | MISSES: 0 | RATING: ?" but is there any way to edit it with lua to something like "SCORE: 0 // COMBO BREAKS:0" without the rating text
and for the arrow hud thing, im trying to make each arrow press have a fade, so that whenever an arrow is pressed instead of the usual 2 frame return animation its a nice tweened smooth return, i have animated it but it only works if i keep the arrow pressed - and as far as i know theres no way to force the confirmation animation to play fully

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 response

@PumpkinSheee PumpkinSheee added the help wanted Extra attention is needed label May 29, 2024
@TFLTV
Copy link

TFLTV commented May 29, 2024

setProperty("scoreText.txt","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

@TFLTV
Copy link

TFLTV commented May 29, 2024

Could you show your code for the animated arrows?

@PumpkinSheee
Copy link
Author

Could you show your code for the animated arrows?

i dont have any code for them, i animated them to have a long fade thing, if you need an example im trying to make it look how it does in the reworked skylimit teaser here: https://www.youtube.com/watch?v=bV8DZZFB9vo

@PumpkinSheee
Copy link
Author

setProperty("scoreText.txt","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

btw that doesnt work 😭

@TFLTV
Copy link

TFLTV commented May 30, 2024

setProperty("scoreText.txt","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

btw that doesnt work 😭

oops mb
I got mixed up a bit

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

@PumpkinSheee
Copy link
Author

setProperty("scoreText.txt","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

btw that doesnt work 😭

oops mb I got mixed up a bit

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

yeah man i noticed that and changed it, still doesnt work. I tried this method a while ago and even then it didnt work which is why i asked on here

@TFLTV
Copy link

TFLTV commented May 30, 2024

setProperty("scoreText.txt","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

btw that doesnt work 😭

oops mb I got mixed up a bit

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

yeah man i noticed that and changed it, still doesnt work. I tried this method a while ago and even then it didnt work which is why i asked on here

That's weird. What version are you using?

@PumpkinSheee
Copy link
Author

setProperty("scoreText.txt","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

btw that doesnt work 😭

oops mb I got mixed up a bit

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

yeah man i noticed that and changed it, still doesnt work. I tried this method a while ago and even then it didnt work which is why i asked on here

That's weird. What version are you using?

0.7.3, base version i havent made any modifications to the exe or compiled it, downloaded straight from the github

@TFLTV
Copy link

TFLTV commented May 31, 2024

Hmm...

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

is working fine for me (I'm using version 0.7.3)...
Are you putting the line of code in onUpdatePost or onUpdate? (I'm pretty sure onUpdatePost would be better for this.)

@PumpkinSheee
Copy link
Author

Hmm...

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

is working fine for me (I'm using version 0.7.3)... Are you putting the line of code in onUpdatePost or onUpdate? (I'm pretty sure onUpdatePost would be better for this.)

ah ok, i was using onUpdate, lemme try with post

@TFLTV
Copy link

TFLTV commented May 31, 2024

Hmm...

setProperty("scoreTxt.text","SCORE: " .. score .. " // COMBO BREAKS: " .. misses);

is working fine for me (I'm using version 0.7.3)... Are you putting the line of code in onUpdatePost or onUpdate? (I'm pretty sure onUpdatePost would be better for this.)

ah ok, i was using onUpdate, lemme try with post

kk, ill wait

@PumpkinSheee
Copy link
Author

holy shit that worked 😭

@PumpkinSheee
Copy link
Author

thanks man, also any luck with the notes fading thing?

@TFLTV
Copy link

TFLTV commented May 31, 2024

thanks man, also any luck with the notes fading thing?

Nah, i haven't looked into it yet. Ill get to it in a bit tho.

@PumpkinSheee
Copy link
Author

thanks man, also any luck with the notes fading thing?

Nah, i haven't looked into it yet. Ill get to it in a bit tho.

aight ill wait patiently - tysm

@TFLTV
Copy link

TFLTV commented Jun 2, 2024

thanks man, also any luck with the notes fading thing?

Nah, i haven't looked into it yet. Ill get to it in a bit tho.

aight ill wait patiently - tysm

Ah crap, it's been about two days and i haven't started on it . . . ill try to get it done by tonight

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

Dude i finally got the script!

function onCreatePost()
    local arrow_dirs = {"left", "down", "up", "right"};
    for i = 0, 3 do
        makeLuaSprite(arrow_dirs[i+1].."_arrow_glow","arrow_glows/"..arrow_dirs[i+1],getProperty("playerStrums.members["..tostring(i).."].x"),getProperty("playerStrums.members["..tostring(i).."].y"));
        addLuaSprite(arrow_dirs[i+1].."_arrow_glow",true);
        setObjectCamera(arrow_dirs[i+1].."_arrow_glow","hud");
        setProperty(arrow_dirs[i+1].."_arrow_glow.alpha",0);
    end
end

function onUpdate(delta)
    local arrow_dirs = {"left", "down", "up", "right"};
    for i = 1, 4 do
        if(keyJustPressed(arrow_dirs[i]))then
            local key = arrow_dirs[i];
            setProperty(key.."_arrow_glow.alpha",getProperty("playerStrums.members["..tostring(i-1).."].alpha"));
            doTweenAlpha(key.."_arrow_glow_alpha", key.."_arrow_glow", 0, 0.4, "linear");
        end
    end
end

function goodNoteHit(membersIndex, noteData, noteType, isSustainNote)
    local arrow_dirs = {"left", "down", "up", "right"};
    local key = arrow_dirs[noteData+1];
    setProperty(key.."_arrow_glow.alpha",getProperty("playerStrums.members["..tostring(noteData).."].alpha"));
    doTweenAlpha(key.."_arrow_glow_alpha", key.."_arrow_glow", 0, 0.4, "linear");
end

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

So, works differently than just an animation integrated into the note skin, it makes graphics that ARE the note glows and whenever the user taps the keys it appears and then fades out.
Just change the path of the Arrow Glow textures in line 4.
@PumpkinSheee

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

Oh, yea, and if you wanna make it so when the user ghost holds down the key, the note glow stays, then replace keyJustPressed (in onUpdate) with keyPressed

@PumpkinSheee
Copy link
Author

Dude i finally got the script!

function onCreatePost()
    local arrow_dirs = {"left", "down", "up", "right"};
    for i = 0, 3 do
        makeLuaSprite(arrow_dirs[i+1].."_arrow_glow","arrow_glows/"..arrow_dirs[i+1],getProperty("playerStrums.members["..tostring(i).."].x"),getProperty("playerStrums.members["..tostring(i).."].y"));
        addLuaSprite(arrow_dirs[i+1].."_arrow_glow",true);
        setObjectCamera(arrow_dirs[i+1].."_arrow_glow","hud");
        setProperty(arrow_dirs[i+1].."_arrow_glow.alpha",0);
    end
end

function onUpdate(delta)
    local arrow_dirs = {"left", "down", "up", "right"};
    for i = 1, 4 do
        if(keyJustPressed(arrow_dirs[i]))then
            local key = arrow_dirs[i];
            setProperty(key.."_arrow_glow.alpha",getProperty("playerStrums.members["..tostring(i-1).."].alpha"));
            doTweenAlpha(key.."_arrow_glow_alpha", key.."_arrow_glow", 0, 0.4, "linear");
        end
    end
end

function goodNoteHit(membersIndex, noteData, noteType, isSustainNote)
    local arrow_dirs = {"left", "down", "up", "right"};
    local key = arrow_dirs[noteData+1];
    setProperty(key.."_arrow_glow.alpha",getProperty("playerStrums.members["..tostring(noteData).."].alpha"));
    doTweenAlpha(key.."_arrow_glow_alpha", key.."_arrow_glow", 0, 0.4, "linear");
end

HOLY SHIT!!!! THANK YOU SO MUCH BRO
YOURE ACRUALLY HIM

@PumpkinSheee
Copy link
Author

LEMME TEST THIS

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

DID IT WORK ??

@PumpkinSheee
Copy link
Author

UHHH YES AND NO, THE TEXTURES DONT APPEAR SO IT JUST HAS THE HAXEFLIX LOGO

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

UHHH YES AND NO, THE TEXTURES DONT APPEAR SO IT JUST HAS THE HAXEFLIX LOGO

DID YOU FORGET TO PUT THE ARROW GLOW TEXTURES IN THE CORRECT PATH?

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

arrow_glows/*the direction name (left, right, etc.)*

@PumpkinSheee
Copy link
Author

OH WAIT
do i need to have the arrow glows be individual images?
or can i just use the sprite sheet for them

@PumpkinSheee
Copy link
Author

also the arrow glows directory should be in images i assume

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

OH WAIT do i need to have the arrow glows be individual images? or can i just use the sprite sheet for them

sadly you have to export it as each individual image, idk how to do spritesheets in lua

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

also the arrow glows directory should be in images i assume

yea

@PumpkinSheee
Copy link
Author

OH WAIT do i need to have the arrow glows be individual images? or can i just use the sprite sheet for them

sadly you have to export it as each individual image, idk how to do spritesheets in lua

got it

@PumpkinSheee
Copy link
Author

do you know the dimensions that each arrow should be?

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

do you know the dimensions that each arrow should be?

uhhhh, ah crap, i don't, it should just be the arrow strum's dimensions

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

ok, the dimensions should be something around 96x96

@TFLTV
Copy link

TFLTV commented Jun 4, 2024

any updates?

@TFLTV
Copy link

TFLTV commented Jun 8, 2024

@PumpkinSheee did you forget about this post? uhh its been idle for a while by now.

@PumpkinSheee
Copy link
Author

@PumpkinSheee did you forget about this post? uhh its been idle for a while by now.

oh shi mb bro
yeah script works perfectly thank you so much youre the GOAT

@TFLTV
Copy link

TFLTV commented Jun 9, 2024

@PumpkinSheee did you forget about this post? uhh its been idle for a while by now.

oh shi mb bro yeah script works perfectly thank you so much youre the GOAT

Lfg
glad i could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants