High scores not clearing and input not stopping

C

Crossoni

Guest
Hi, I'm having problems with clearing my high scores. When I use the highscore_clear(); command on my game it clears my high score list, but when I delete that command from my script, the same high scores are back. I would want that I could empty my high score now but that it would save all the future high scores without resetting them every time I run the game. I am using the build-in high score table, so I am also wondering where does it save my high score info, since I can't seem to find the file anywhere. When I play my game with another computer the scores are reset, so the file has to be somewhere in my computer files.

Also I have problems with my input for high score name. When my player dies it asks for a name, and it should stop registering keys for the input after I press enter, but it doesn't. My script for it looks like this:

draw_text(room_width/2-50,room_height/2+50,"Please enter your name: "+keyboard_string)
if keyboard_string!=""&&keyboard_check_released(vk_enter)
{
name=keyboard_string
highscore_add("Wave: "+string(global.wave-1)+" " +name,global.points)
room_goto(rm_highscore)
}

I'm thankful if someone is willing to help me!
 

Jakylgamer

Member
highscore data is in the %localappdata% / yourgamename < just search for that.
as for adding to highscore:
Code:
var str = get_string("","Player");//first ask the player for name
if str != "" {
   highscore_add("Wave: "+string(global.wave-1)+" " +str, global.points);
}
 
C

Crossoni

Guest
highscore data is in the %localappdata% / yourgamename < just search for that.
as for adding to highscore:
Code:
var str = get_string("","Player");//first ask the player for name
if str != "" {
   highscore_add("Wave: "+string(global.wave-1)+" " +str, global.points);
}
Thanks for the quick reply! The problem with get_string is that when I play on full screen, the pop-up message messes up everything. It takes me to my desktop and makes my game show black screen. That's why I am using the keyboard_string, since it asks it inside the game. Do you have any suggestion how I can make it so that it stops registering buttons for it when I press enter? If it matters in this case, I have this whole script written inside the draw event.

Also is there a way to save my scores inside the game, so that when I for example put it on my USB stick and play on someone else's computer, it would use the same high score file?
 
C

Crossoni

Guest
Thanks for that, it will take some time for me to understand what all that code means, but if I run into more problems about this topic I'll come back to this thread.
 
G

Guest User

Guest
So...did anybody ever figure out how to cpear scores on build?
 
Well, highscore_clear() in the Create Event of an instance that is created at the start of the game should clear the highscore when you boot up the game? Is that what you're trying to do?
 

jocelo

Member
Replying to a 2 year old post, but I ran into this issue just now. To permanently delete previous high scores you will have to delete the "hiscore.dat" file.

On a mac, the hiscore.dat file is located in the folder: /Users/<username>/Library/Application Support/com.yoyogames.macyoyorunner/

However, if you are running the "executable" version of the game, the file will be located in: /Users/<username>/Library/Application Support/<app id>/

... and you can find "<app id>" by going (in the asset browser window right-hand side) game options > macOS > general > app id

Hope this helps anyone having the same issue.
 
Top