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

async_load=[? "name"] gives undefined.

I'm on a stop for 2 weeks cause I can't get Google Play Services to work properly.

So what is going on here exactly?
I used game makers official tutorial to set it up.
When I launch the game, Play Games asks for consent. After pressing confirm, the Play Games overlay appears showing "my account name" has logged in. Welcome back blablabla.
But when I try to sync data:

global.playername=undefined;

if ds_map_exists(async_load, "id")
{
switch(async_load[? "id"])
{
case achievement_our_info:
global.PlayerName = async_load[? "name"];
global.PlayerID = async_load[? "playerid"];
show_debug_message("GOOGLE SERVICES: User " + global.PlayerName + " with ID " + string(global.PlayerID) + " has logged in");
break;
}
}

It seems like I'm logged in but my game isn't able to catch info about the account whatsoever. Playerid also gives undefined. I'm at a complete loss. Why on earth haven't I gotten anything to work by simply following game makers official tutorials. Why is this support so bad that I have waited over 2 weeks without any help whatsoever.

Maybe someone smarter than me and game makers support, can help me out here cause for me it seems to log in correctly but I aint getting the players account name nor id.

Am I missing some scopes? Do I need sensitive or non-sensitive scopes for that info or what
 

TsukaYuriko

☄️
Forum Staff
Moderator
Output the contents of async_load. If what you're expecting to be in it isn't in it, then what is in it?
 
1631974193190.png
My dear sir you are absolutely right! I'll try the new one and see if it works properly. Thank you! Also did this new version come out any time soon? Since the previous version I got a month ago and there's already a new one?
 

jzavala

GameMaker Staff
GameMaker Dev.
Setup is same, are you using same SHA1, Google Services ID and package name?
Please read the pdf attached to the project
 
Setup is same, are you using same SHA1, Google Services ID and package name?
Please read the pdf attached to the project
First of all the documentation is nowhere near as good as the tutorial used to be: https://help.yoyogames.com/hc/en-us...e-Play-Services-How-To-Use-This-In-Your-Games

And the setup is not the same when the functions arent achievement_login anymore but instead we have to use GooglePlayServices_

I am pretty sure I'm using same SHA1, Google Services ID and package name, since the login prompt goes through. It asks for my consent which I give and an overlay of goole play games appears telling me "Welcome Back Ranzip!"

But what is bothering me is that I'm still not capable of getting the player name and id. Maybe I have a code error or something.
1632052226944.png1632052262538.png242214433_539099223852420_7434192868591202187_n.jpg

I'm not an experienced programmer but for me this documentation seems too unclear to get things set the way intended.

1632052460074.png

JSON Structs

AccountJSON
→ displayName
→ email
→ familyName
→ givenName
→ IdToken
→ photoUrl
→ serverAuthCode

-------------------------
Anyway, it seems to me that the information now gets stored in a JSON file instead of async_load map.

I tried googling about json_parse but I only found how to display the gotten information in the debug console:
1632052739062.png

What am I supposed to do inorder to get displayName or IdToken out of this variable called : accountInfo ( var accountInfo = json_parse(accountInfoJSON) ???
 

jzavala

GameMaker Staff
GameMaker Dev.
Hi KasparTheAhv

Is good that you success the login and I see where is your problem, you are still using the old code
Check this object: Obj_GooglePlayServices_Player

I recommend you create a new project only with Google Play Services extensions and with your same SHA1, Package Name and GoogleServices ID, to see how is working.
On Room_GooglePlayServices you will see how Obj_GooglePlayServices_Player draw your player and account information

You will see an screen like this but with your info:

1632059166219.png
 
Last edited:
Hi KasparTheAhv

Is good that you success the login and I see where is your problem, you are still using the old code
Check this object: Obj_GooglePlayServices_Player

I recommend you create a new project only with Google Play Services extensions and with your same SHA1, Package Name and GoogleServices ID, to see how is working.
On Room_GooglePlayServices you will see how Obj_GooglePlayServices_Player draw your player and account information

You will see an screen like this but with your info:
Thank you for your kind support!

So I messed around their demo project. The account login is successful now. I even got leaderboards to work but there seems to be a problem with the achievements.
They aren't getting incremented. -.-
1632389610550.png 1632389943568.png1632389858494.png1632389811698.png


Within Google Play Games app, I can see that I have them revealed but they all show 0% eventho I have gotten a few A+ in few matches and the global.PlayStatus variable that I'm using for debugging also showed "TryPostAchievement". So the code gets there for sure but the action isn't completed.
I'm wondering why tho? Since the leaderboard seems to work normally.
 

Attachments

jzavala

GameMaker Staff
GameMaker Dev.
The only thing that make me fell uncomfortable is that you call this two functions at same time each update:

GooglePlayServices_Achievements_Reveal("")
GooglePlayServices_Achievements_Increment("")

What happen if you only call GooglePlayServices_Achievements_Increment("") to a revealed achievement?

Regards
 
The only thing that make me fell uncomfortable is that you call this two functions at same time each update:

GooglePlayServices_Achievements_Reveal("")
GooglePlayServices_Achievements_Increment("")

What happen if you only call GooglePlayServices_Achievements_Increment("") to a revealed achievement?

Regards
To be honest. I got everything working just the way it was yesterday. Not sure why the achievements weren't getting updated but they finally did by the end of the day.

But of course somebody already messed something up again as always...

There was an update available on the extension this morning. But now after importing, it doesn't have the extension icon and all of the functions have turned blue(into regular variables)

How do I get back the previous version cause I'm starting to lose all hope in this company.

1632469322731.png1632469555326.png
 
I have a month old backup only. how is this even legal for your program to randomly delete all my files without my consent ?????'
Can I somehow get my stuff back from yesterdays APK?
 

TsukaYuriko

☄️
Forum Staff
Moderator
Can I somehow get my stuff back from yesterdays APK?
No, that would be decompilation and constitute a breach of the EULA.

I have a month old backup only. how is this even legal for your program to randomly delete all my files without my consent ?????'
Software usually includes a clause in their terms of service that it is provided "as is" and that you accept any and all consequences - intentional or unintentional - as a result of using it and will not hold the developer liable for any damage caused by your usage of the software. It is entirely your risk to take (and protect yourself from) when using software. That goes for the vast majority, if not all, of the software you are currently using.


Before you do anything else, make a backup of your project. Then make it a habit to routinely make backups of your project at a vastly more frequent rate than you currently do. Start using source control too.

Then, inspect your project folder on your local file system. Are your resources still where they used to be? If so, chances are that only the project file became corrupted. If so, try restoring it with YYP Maker:
 
No, that would be decompilation and constitute a breach of the EULA.


Software usually includes a clause in their terms of service that it is provided "as is" and that you accept any and all consequences - intentional or unintentional - as a result of using it and will not hold the developer liable for any damage caused by your usage of the software. It is entirely your risk to take (and protect yourself from) when using software. That goes for the vast majority, if not all, of the software you are currently using.


Before you do anything else, make a backup of your project. Then make it a habit to routinely make backups of your project at a vastly more frequent rate than you currently do. Start using source control too.

Then, inspect your project folder on your local file system. Are your resources still where they used to be? If so, chances are that only the project file became corrupted. If so, try restoring it with YYP Maker:
Checked all folders containing any info. all of the .yy files are still here and the masks but no .gml for the code. I lost 25 objects just now. And yes I know it's probably "my" fault that I even considered updating before making a backup. I just wish I could somehow get back my code at least from the apk since I found the sprites/texturepages from %appdata%. I just have to recreate all the objects and was hoping there is still a way I can get my code from my own apk.
I found this <link unfound> ~Tsuk
But I'm not sure if it's going to help at all tbh. I already opened the APK with WinRar and checked every folder/file but couldn't find what file exactly contains my written code.
 
Last edited by a moderator:

TsukaYuriko

☄️
Forum Staff
Moderator
Decompilation breaks all sorts of license agreements and/or laws, so if you want to retrieve your code that way, you won't receive help with it here. The only way to recover your code that I can recommend is backups, source control and file recovery software.
 
Hi @KasparTheAhv

I see your problem, you need upload your IDE to the latest version due the new version of GooglePlayServices is for 2.3.4+.

Regards
Sorry for the mental breakdown yesterday. Updated after losing my project. '
Now its: 1632555128970.png Not sure what it was before. I'm sure as if it was 2.3.4.[Something] already but what the hell.
I'll just start grinding again from my last months backup.

Tips for other victims:

1. I'm not going to decompile cause I read that it will be a messy proccess anyway. The code I might get back wont be 100% the same I wrote in GML so it wont be worth the hustle anyways. It's faster to rewrite.

2. I downloaded a free software and assigned it to do a backup on my projects folder everytime I exit the program since the 1 month backups are too long.

Ever since last month I started grinding in an enormous base. Lost myself in the comfort of everything being okay on every launch. Kinda unexpected to see my project just vanish. What's still bothering me is how the program decided to delete my whole project, not just the project file or corrupt it. I've had this happen a long time ago where the project file itself got corrupted, but at least I still had the .yy and .gml files for the objects and just started a new project with manually importing those files 1by1. But this time it decided to kill the whole project just because I decided to delete an incompatible extension?

Tip for GameMaker devs: Seems like Game Maker is missing quite a few security measures for these kinds of situations. They should give me at least a warning before deleting files like that.
But all I got was a box saying something in the lines of "you could still recover parts from the memory".
But thank you everyone throughout helping me. At least I got everything working fine and uploaded the .apk to play store before destroying my project the day after :D

Felt nice for the moment. Anyways, I'll just start promoting the app for now and slowly build my project upto what it was supposed to be.
You can check it out if you like but for now, peace out and thank you all !!!
and maybe we'll meet again.

1632556180934.png
 
Top