Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using Snapshots code on Godot 4.x.x #5

Open
YO-SC opened this issue Apr 5, 2023 · 3 comments
Open

Error when using Snapshots code on Godot 4.x.x #5

YO-SC opened this issue Apr 5, 2023 · 3 comments

Comments

@YO-SC
Copy link

YO-SC commented Apr 5, 2023

Hello there, I am having issues with some of the code in Godot 4. This has to do with Save Games. Sadly I don't really understand the issue or what is going on, but I will provide context and hopefully, it can be solved.

I am receiving the following error:
USER ERROR: Error calling from signal '_on_game_load_fail' to callable: 'Node2D(main.gd)::_on_game_load_fail': Method expected 1 arguments, but called with 0.

This occurs for _on_game_saved_fail too

For context, I am making the following connections as such (for Godot 4 compatibility)

# Saved games (cloud saves)
play_games_services.connect("_on_create_new_snapshot", Callable(self, "_on_create_new_snapshot"))

play_games_services.connect("_on_game_saved_success", Callable(self, "_on_game_saved_success"))
play_games_services.connect("_on_game_saved_fail", Callable(self, "_on_game_saved_fail"))

play_games_services.connect("_on_game_load_success", Callable(self, "_on_game_load_success"))
play_games_services.connect("_on_game_load_fail", Callable(self, "_on_game_load_fail"))

On the JSON side of things, I am using the methods directly from the JSON object. Specifically, the stringify() and parse_string(). Example:
from var available_events = parse_json(events_array) to var available_events = JSON.parse_string(events_array)
and
from play_games_services.saveSnapshot("SNAPSHOT_NAME", to_json(data_to_save), "DESCRIPTION") to play_games_services.saveSnapshot("SNAPSHOT_NAME", JSON.stringify(game_save_data), "This is a test")

The other code works using this implementation, it is just the snapshots part that is causing issues. Furthermore, if I try to show, save, or load snapshots only then do the other parts of the code present the same error message for their respective signals for some reason.

Hopefully we can find solutions to this, I will update this thread if I find one.

@YO-SC
Copy link
Author

YO-SC commented Apr 5, 2023

also, thanks a lot for this plugin, its really useful 💪

@YO-SC
Copy link
Author

YO-SC commented Apr 6, 2023

The problem fixed itself (?). I am investigating. The difference was that I ran the game through Google Play Games app. Maybe it has something to do with that?

@finepointcgi
Copy link

Hey i know this is old but I have updated the repo for Godot 4
https://github.com/finepointcgi/PGSGP/tree/4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants