Graeme Hawkins
Member
Hi there, I'm having some problems getting the default values of my high score table to show up. I've added a file to 'included files' that I want to be the default values, basically a list of scores to beat - it looks like this...
It grabs the names ok but the scores always display as 0 for some reason. Any idea why it's ignoring the scores and always making them 0? Everything is also working fine otherwise, when the player inputs their own scores, but I'd really like to have these fake scores initially. I'd be grateful for any pointers
This is in my boot room
and then this is in the high score room where they're displayed
Thanks,
Graeme
Code:
[0]
Name=“SSS”
Score=“50000.000000"
[1]
Name=“AAA”
Score=“45000.000000"
.....etc
[9]
Name=“ZZZ”
Score=“5000.000000"
This is in my boot room
Code:
ini_open("highScoreTable");
for (i = 0; i < 10; i++){
global.score_array[i,0] = ini_read_string(string(i),"Name","AAA");
global.score_array[i,1] = ini_read_real(string(i),"Score",0);
}
ini_close();
Code:
//create
ini_open("highScoreTable");
for (i = 0; i < 10; i++){
global.score_array[i,0] = ini_read_string(string(i),"Name","GRR");
global.score_array[i,1] = ini_read_real(string(i),"Score",0);
}
ini_close();
//draw
for (i = 0; i < 10; i++){
//names
draw_text_transformed(xx,yy,string(global.score_array[i,0]),highScoreScale,highScoreScale,0);
//scores
draw_text_transformed(xx,yy,string(global.score_array[i,1]),highScoreScale,highScoreScale,0);
}
Graeme