Basically, at the end of the mode, the player is taken to a room with a door. The player goes through the door to the score room, where the player can access all his high scores from all the modes. Since the door is an object that is only in that one room, and doesn't have any other actions, I figured I could use it to record what high scores the player got at the end of the mode.
The code for recording the score is as follows:
a=0
while a<5
{
if game_score>ds_grid_get(score_grid,0,a)
{
b=4
while b>=a
{
ds_grid_set(score_grid,0,b,ds_grid_get(score_grid,0,b-1))
b-=1
if b=0
break;
}
ds_grid_set(score_grid,0,a,game_score)
break;
}
a+=1
}
ini_open("challenge1.ini")
score1=ini_write_real('highscores','score1',ds_grid_get(score_grid,0,0))
score2=ini_write_real('highscores','score2',ds_grid_get(score_grid,0,1))
score3=ini_write_real('highscores','score3',ds_grid_get(score_grid,0,2))
score4=ini_write_real('highscores','score4',ds_grid_get(score_grid,0,3))
score5=ini_write_real('highscores','score5',ds_grid_get(score_grid,0,4))
ini_close()And this is the error message that pops up as soon as I run the game:
FATAL ERROR in
action number 1
of Create Event
for object door01:
COMPILATION ERROR in code action.
Error in code at line 24:
score1=ini_write_real('highscores','score1',ds_grid_get(score_grid,0,0))
at position 7: Variable name expected.So where was I supposed to put this alleged "Variable name"? Is there something I'm not getting about ini files?
If there's anything you need to see to help me, like the ini file in question, just ask and I will deliver.











