Is there a bug with the formula : "n"..floor((
I dont know if it was the update but the formula I have with images to show the score stop counting at some random point. I create an actor to display the game.score and it counts like it is supposed to. Does this happened to somebody else?
Comments
If you want to limit the counting of numbers, it's Min/Max
X = min(99,game.score)
X will not be larger than 99 with that formula.
The Unofficial GameSalad Textbook has a math section that explains the different expressions.
"n"..floor(( game.bestScore % self.Div )/( self.Div /10))..".png"
Is there a better one for this?
the n isnt part of the actual expression. You see how its in quotes? It represents the text in the images name. the second part will bring you back another, and the last part ads the .png extension to give you a complete image name so it can pick the image.
So if your images are not named n1.png up to n9.png it wont work
If your image is something like 1_1.png and 2_1.png you can can the end of the expression to something like
.."_1.png"
I use a change attribute and a rule in my custom fonts. So when a "score" happens it changes a game.ScoreHappened to 1, and my custom font's have a rule that when game.ScoreHappened = 1, change attribute to floor((game.score....".png"
I would suggest, so sake of clarity and simplicity, to rename your .png files to 0.png, 1.png, 2.png, etc and remove the "n" portion of your code.
It makes more sense to do that and it's simpler. (Unless you have two differnt fonts being used, then I think that's the best route to go).
@DrGlickert- I just did this and still, I just stop at a certain point.