Iakobs / godot-play-game-services

A Godot 4.2 plugin for integration with Google Play Game Services
MIT License
82 stars 5 forks source link

Where i must put ID leaderboard? #15

Closed ZiiGame closed 4 months ago

ZiiGame commented 4 months ago

Hi i am newq in godot. Where i can put ID Leaderboard from my google cloud to your plugin? Thx for future answer.

Iakobs commented 4 months ago

Hi @ZiiGame

You don't have to put your leaderboards or achievements ids in any specific place. You have some methods in the plugin where you can send the leaderboard ids to get or submit scores, to show a specific leaderboard, etc. These methods are in the LeaderboardClient of the godot plugin. The same logic applies for achievements, with relevant methods in the AchievementsClient.

You have some examples of its usage in the demo project, here and here.

You have some explanation on how to run the demo project and how it works in the README of the demo project itself. You can open that folder from Godot and follow the steps described there and you should be able to run the demo project.

Please let me know if you need any more help, hope the plugin works for you!

ZiiGame commented 4 months ago

Hi @Iakobs

If I understand correctly so instead of this

func _load_player_score() -> void: LeaderboardsClient.load_player_score( leaderboard.leaderboard_id, LeaderboardsClient.TimeSpan.TIME_SPAN_ALL_TIME, LeaderboardsClient.Collection.COLLECTION_PUBLIC )

I use my exaplcode as vrvnevnei5vv

So the result will be

func _load_player_score() -> void: LeaderboardsClient.load_player_score( leaderboard.vrvnevnei5vv, LeaderboardsClient.TimeSpan.TIME_SPAN_ALL_TIME, LeaderboardsClient.Collection.COLLECTION_PUBLIC )

Sorry to bother you and delay you. I just tried to find it on youtube and I was looking at your demo project and tried reverse engineering. But I didn't see the leaderboard ID from google cloud anywhere, and when I tried to insert it after leaderboard_id, I kept getting an error. I'm a complete beginner, so I'm mostly learning by trial and error. Everywhere on youtube we only saw videos on the 3.5 version and there they used a constant definition for the id of each leaderboard created in the google cloud. Thank you for your patience.

ZiiGame commented 4 months ago

image

Iakobs commented 4 months ago

Hi! I'm happy to help, don't worry about asking :) I try to explain as simple as possible, but don't be afraid to ask again if you don't understand something.

In the demo project the leaderboard id is loaded from google directly, connecting to the all_leaderboards_loaded signal, here. Then that leaderboard information is stored in the LeaderboardDisplay scene, which uses the leaderboard id to call the method you are referring to. You can do that or either use your constants as you saw on youtube.

ZiiGame commented 4 months ago

Bro it works. Thank you very much. Now I just have to figure out how to put player points into that leaderboard and I'll be done. Thank you very much.

Do you happen to know any plugin for storing data on firebase? I have paired firebase only for analytical data, but I haven't seen anywhere a functional connection to android that I will create in firebase storage and save and upload data there when I just log in to google service via your plugin. If you don't know, then don't bother me just in case you don't know. Once again, thank you very much for the explanation.

Iakobs commented 4 months ago

Hey! I'm so happy it works! I don't know about any plugin for firebase, though. Hope you can find what you're looking for