GM:S 1.4 Problem saving time based score

Discussion in 'Programming' started by ascoider, May 31, 2018.

  1. ascoider

    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")
    global.chrono = ini_read_string("scores","chrono",0);
    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)
    global.chrono = ini_read_string("scores","chrono",0);

    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.
  2. nicoltoons

    nicoltoons Member

    Nov 4, 2016
    Try using a persistent object in the game to call the Save ini file(save tiime) in the step event.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice