1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 Saving and Loading A Seed

Discussion in 'Programming' started by batmanai15, Jun 12, 2018.

  1. batmanai15

    batmanai15 Member

    Joined:
    May 11, 2018
    Posts:
    58
    Hey All,

    I am trying to implement an autosave feature in my game so if the player gets interrupted by a phone call they can pick up where they left off. The issue is it's a rogue-like dungeon crawler much like binding of isaac.

    When you enter a new room you have a random chance of getting a room chosen from a "pool" of rooms.

    i have global variables that keep track of the previous room etc so the play can back track. This works great while playing the game. I tried saving all the global variables to an ini file and then loading the values of those global variables on the continue game but when you go to back track the previous room shows all Black on the screen.

    Not sure why this will not load correctly. I though maybe it's because i have to load the SEED that the save was from. So i tried saving the seed to the ini file with ini_write_real("Levels", "Seed", random_get_seed());
    and then loading it var seed_retrieved = ini_read_real("Levels", "Seed", "");

    however the same thing is still happening when you go to back track after game load the next room is all black.

    Am i loading and saving the seed correctly? Is there something that i am not doing?
     

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