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

Is there a way to change the score text in only one song? #9803

Closed
Username2120 opened this issue Jul 19, 2022 · 8 comments
Closed

Is there a way to change the score text in only one song? #9803

Username2120 opened this issue Jul 19, 2022 · 8 comments
Labels
question Further information is requested

Comments

@Username2120
Copy link

What is your question?

I'm wondering if there is a way to change the score text at the bottom of every song for only 1 song, I've tried for a while but just cant seem to get it to work. it doesn't matter if its through source or Lua.

@Username2120 Username2120 added the question Further information is requested label Jul 19, 2022
@FFoxyyy
Copy link

FFoxyyy commented Jul 19, 2022

use a script

@Username2120
Copy link
Author

okay, but how? like i know how a script works and how to use it. but i dont know what i need to put in the script to get what i want.

@TheKitBoi
Copy link

TheKitBoi commented Jul 19, 2022

okay, but how? like i know how a script works and how to use it. but i dont know what i need to put in the script to get what i want.

If your using a font put it in the fonts folder
image

go into scripts folder and make a file called scorefont.lua and paste this code in
function onCreatePost()
setTextFont("scoreTxt", "youtfont.ttf")
setTextSize("scoreTxt", 16)-- whatever size you like
end

@Cyachao
Copy link

Cyachao commented Jul 19, 2022

For source you can do:
Ctrl+F and type in "scoreTxt" and go to 3-8 results which is creation of the FlxText.
if (SONG.song.toLowerCase() == 'song name') {
scoreTxt = new FlxText(0, healthBarBG.y + 36, FlxG.width, "", 20);
scoreTxt.setFormat("Comic Sans MS", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
scoreTxt.scrollFactor.set();
scoreTxt.borderSize = 1.25;
scoreTxt.visible = !ClientPrefs.hideHud;
} else {
scoreTxt = new FlxText(0, healthBarBG.y + 36, FlxG.width, "", 20);
scoreTxt.setFormat(Paths.font('vcr.ttf'), 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
scoreTxt.scrollFactor.set();
scoreTxt.borderSize = 1.25;
scoreTxt.visible = !ClientPrefs.hideHud;
}
add(scoreTxt);
Well, just change the upper one.

@Username2120
Copy link
Author

this isn't exactly what I meant, but its my fault for not being more clear about it. I more meant something like the word "miss" in the score text and renaming it to something like "combo breaks", but only for 1 song. or in other words, changing the words in the score text and not the font.

@Cyachao
Copy link

Cyachao commented Jul 19, 2022

    if (SONG.song.toLowerCase() == 'song name') {
        if(ratingName == '?') {
            scoreTxt.text = 'Score: 0 | Combo Breaks: 0 | Accuracy: 100%';
        } else {
            scoreTxt.text = 'Score: ' + songScore + ' | Combo Breaks: ' + songMisses + ' | Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '%';
        }
    } else {
        if(ratingName == '?') {
            scoreTxt.text = 'Score: 0 | Misses: 0 | Accuracy: 100%';
        } else {
            scoreTxt.text = 'Score: ' + songScore + ' | Misses: ' + songMisses + ' | Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '%';
        }
    }

Sorry if it's a bit modified. But if you're on new psych then a function called "updateScore" should exist.
Don't forget to put your song name all lowercase.

public function updateScore(miss:Bool = false)
	{
        if (SONG.song.toLowerCase() == 'song name')
        {
		    scoreTxt.text = 'Score: ' + songScore
		    + ' | Combo Breaks: ' + songMisses
		    + ' | Rating: ' + ratingName
		    + (ratingName != '?' ? ' [${Highscore.floorDecimal(ratingPercent * 100, 2)}% | $ratingFC]' : '');
        } else {
            scoreTxt.text = 'Score: ' + songScore
		    + ' | Misses: ' + songMisses
		    + ' | Rating: ' + ratingName
		    + (ratingName != '?' ? ' [${Highscore.floorDecimal(ratingPercent * 100, 2)}% | $ratingFC]' : '');
        }
		if(ClientPrefs.scoreZoom && !miss && !cpuControlled)
		{
			if(scoreTxtTween != null) {
				scoreTxtTween.cancel();
			}
			scoreTxt.scale.x = 1.075;
			scoreTxt.scale.y = 1.075;
			scoreTxtTween = FlxTween.tween(scoreTxt.scale, {x: 1, y: 1}, 0.2, {
				onComplete: function(twn:FlxTween) {
					scoreTxtTween = null;
				}
			});
		}
		callOnLuas('onUpdateScore', [miss]);
	}

@Username2120
Copy link
Author

This worked! thank you so much!

@einbuis07
Copy link

    if (SONG.song.toLowerCase() == 'song name') {
        if(ratingName == '?') {
            scoreTxt.text = 'Score: 0 | Combo Breaks: 0 | Accuracy: 100%';
        } else {
            scoreTxt.text = 'Score: ' + songScore + ' | Combo Breaks: ' + songMisses + ' | Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '%';
        }
    } else {
        if(ratingName == '?') {
            scoreTxt.text = 'Score: 0 | Misses: 0 | Accuracy: 100%';
        } else {
            scoreTxt.text = 'Score: ' + songScore + ' | Misses: ' + songMisses + ' | Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '%';
        }
    }

Sorry if it's a bit modified. But if you're on new psych then a function called "updateScore" should exist. Don't forget to put your song name all lowercase.

public function updateScore(miss:Bool = false)
	{
        if (SONG.song.toLowerCase() == 'song name')
        {
		    scoreTxt.text = 'Score: ' + songScore
		    + ' | Combo Breaks: ' + songMisses
		    + ' | Rating: ' + ratingName
		    + (ratingName != '?' ? ' [${Highscore.floorDecimal(ratingPercent * 100, 2)}% | $ratingFC]' : '');
        } else {
            scoreTxt.text = 'Score: ' + songScore
		    + ' | Misses: ' + songMisses
		    + ' | Rating: ' + ratingName
		    + (ratingName != '?' ? ' [${Highscore.floorDecimal(ratingPercent * 100, 2)}% | $ratingFC]' : '');
        }
		if(ClientPrefs.scoreZoom && !miss && !cpuControlled)
		{
			if(scoreTxtTween != null) {
				scoreTxtTween.cancel();
			}
			scoreTxt.scale.x = 1.075;
			scoreTxt.scale.y = 1.075;
			scoreTxtTween = FlxTween.tween(scoreTxt.scale, {x: 1, y: 1}, 0.2, {
				onComplete: function(twn:FlxTween) {
					scoreTxtTween = null;
				}
			});
		}
		callOnLuas('onUpdateScore', [miss]);
	}

What is Location?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants