• 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!

GameMaker Loading json file twice deletes object

A

Aaron Walton

Guest
Trying to get my save system implemented, using GM Wolf's "Advanced Save System" tutorial. It uses ds_maps to save specified variables in specified objects to a json file. Loading the game deletes all saveable objects and creates them again with the saved parameters. Currently I have it set to save the x, y, and room of the player object and the camera object (both are persistant). I'm having a few issues with this, but the strangest of them is this: if I save the game, and load it, it works fine. If I load the same game again, the camera object does not get reloaded! If I save the game, load it, close the game, start it again, and then load it, it loads properly. But if you load twice without closing the game and reopening it, the camera doesn't get loaded. Nor does it get loaded if, instead of closing and starting the game, you use the game_restart function. Since the player object loads correctly, it seems like the issue must be with the camera object rather than the save system itself, but I don't know.

I'm not really sure what code to even include here, as the save system includes about five different scripts and the camera has four events.

Any thoughts?
 

flyinian

Member
I recommend watching the video again and double checking code. That would be your best bet. If you haven't already fixed this problem yet.
 
Top