• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code achievement_increment "invalid argument type"?



For the last few weeks, my game has been experiencing a crash with the achievement_increment function. Seems like it has to do with the second parameter, which is the value by which I'm trying to increment an achievement.

The weird thing is, if I manually set the parameter to 1, the crash does not occur, i.e.

achievement_increment("Achievement Name",1);

works fine. But this does not:

achievement_increment("Achievement Name",inc_amt);

where inc_amt = 3. I have confirmed that the variable is indeed set to 3, and that it's a real.

Stranger still, this function does not crash when it's triggered from another object. This particular achievement can be progressed in a few different ways, but it always fires the same script and uses the same variables...

I'm on GMS2 v2.2.3.437 and runtime v2.2.3.345. Crash is occurring on Android. Don't have time to rewrite all of my IAP code right now so I'm not updating GM.

Anyway, I'm wondering if anyone else has been running into trouble with the achievement_increment function.

The only thing I can think of is that I'm supplying my achievement name string instead of the unique ID that Google generates... I've seen mixed reports about whether the unique ID is necessary. It also doesn't explain why sometimes the function executes without crashing.

Any advice would be appreciated.