• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Problem saving time based score

A

ascoider

Guest
Hello everyone,

I am trying to save a time score like this "0:00:00".
I already used ini files and functions ini_write_string and ini_read_string (you can enter and save your name the first time you play and it works fine. Now i'm using the same code but doesn´t work.

1st object: SCORE_LOAD (game start event)
if file_exists("chrono_save.ini")
{
ini_open("chrono_save.ini");
global.chrono = ini_read_string("scores","chrono",0);
ini_close();
}
else
global.chrono = "0:00:0";

2nd object: FREEZES TIME (step event)
if time = 1
global.chrono = string(minutes) + ":" + string(seconds) + ":" + string(decimals);

3rd object: SAVES TIME (create event, if new record is detected)
ini_open("chrono_save.ini");
ini_write_string("scores","chrono",global.chrono);
global.chrono = ini_read_string("scores","chrono",0);
ini_close();


4th object: SHOWS LAST TIME

this one works fine, it shows the last record made


So, when I close the game and open again, the time is not saved.
please some help, thanks.
 
N

nicoltoons

Guest
Try using a persistent object in the game to call the Save ini file(save tiime) in the step event.
 
Top