cgisca / PGSGP

Play Games Services plugin for Godot Game Engine - Android
MIT License
217 stars 61 forks source link

Problem with snapshots not being saved. #6

Closed mabe95 closed 4 years ago

mabe95 commented 4 years ago

Hi. I have a problem where a snapshot I'm saving isn't being saved. I can load a saved game. When I save the game I get the success callback. But when I restart my game and load the save again the data I just saved isn't what is loaded. Does anyone know what might cause this?

cgisca commented 4 years ago

Hi @mabe95 . I have checked saved games functionality and it is working properly. Could you please check if you are doing it right (if you followed Readme, it should be known to you):

  1. Save the game using next function -> play_games_services.save_snapshot("SNAPSHOT_NAME", to_json(data_to_save), "DESCRIPTION") , "SNAPSHOT_NAME" is the name of your saved game, later you can load the saved game using this name. You can provide any name here.

  2. Load the game using next function -> play_games_services.load_snapshot("SNAPSHOT_NAME") . Here you load the game using the same name you saved the game previously. Once the game is successfully loaded, you will be notified in the next callback -> func _on_game_load_success(saved_game): , and then you can get your saved data from the saved_game. Check Readme.

If you are trying latest plugin at the moment 1.2.0 (https://github.com/cgisca/PGSGP/releases/tag/1.2.0), keep in mind that you need to call init function with 3 params (instance id, show popups, enable save game functionality) play_games_services.init(get_instance_id(), true, true)

cgisca commented 4 years ago

Closing the issue. Please check the latest version of the plugin.