Question - Code achievement_increment "invalid argument type"?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Elevory, Oct 5, 2019.

  1. Elevory

    Elevory Member

    Aug 27, 2016

    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.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice