GM Library 2

Forum Listing » Game Achievements Forum » View Topic


  • Alright since the current GM Library is pretty outdated and missing some functionality, I made a second version for you all to use. I tried my best to make it as simple, optimal, and functional as possible. If you have any suggestions/requests/complaints/bugs please let me know and I'll fix them up ASAP.

    You can test the functions via Quick Play and study the code via Download, here: http://www.gamejolt.com/open-source/games/other/game-maker-gj-api-library/8710/ 

    GOOD LUCK! :D

  • Just annoucing that there's a new version up with a highscores example and a new script: GJ_trophyset_fetch();

    Enjoy

  • Maybe you should post just this on the GMC or something. Rather than doing the whole API, to promote the individual libraries that work with it?

  • I kinda wanna post this on the Tutorials forum but idk if they'd let me with Fatal's post alerady up :o

  • Yeah, they seem to be a little crazy. They made him close his other post because he had one from like 2 years ago, right? I don't see how it helps more to resurrect an old post rather than create a new one. meh.

  • I've now made this the default library to use on the landing page. Good work brod! And thanks for creating it.

  • Question: whatdo you put in for the arguments "ascending/descending" for the highscore scripts?

  • There is none, that's handled online on the "highscores" tab of your game's "manage achievements" page

  • CROS suggested to me to make an "auto session" method for the library. Would you guys like that? How would you want it to work? I'd like some suggestions on what to do yo

  • Version 2 is out! I ended up working in auto sessions and they work fantastically! :D

    http://gamejolt.com/games/gamejolt-game-maker-api-example/news/game-maker-s-gjapi-has-updated-to-v2-0/2947/

    Last edited on November 12, 2012 - 12:25 AM by thatbrod

  • I believe I already know the answer but; will the knew version (2) affect games with the old version? Also how easy is it to implement the new version, is there much you need to change?

  • Sorry but no it won't work with the old version, but this one is WAY simpler.

    Example on logging in:

    GJ_login(username, usertoken);

    That's it. It returns success or failure though, which you can use to check if the user put in the wrong password or something. Once logged in, you can use all user related calls like trophies, personal high score list, and personal data storages.

    Examples:
    myTrophy = GJ_getTrophy(trophyID);

    if (GJ_getStatus(myTrophy) == _GJSTATUS_SUCCESS)
    {
        draw_text(0, 0, GJ_getTrophyData(trophyID, "title");
    }

    and that's all you need. Be careful though, you must be logged in (using GJ_login) for GJ_getTrophy to work, along with most other user-related details. One other nice thing about the second version, is that it handles sessions for you automatically

  • "Sorry but no it won't work with the old version, but this one is WAY simpler."

     

    Damn thats a couple months gone down the drain with my game thats built around the old api Ouch!

  • BulleTech, it seems like it's actually pretty quick to migrate to this new version. It actually does a lot of stuff for you and keeps the parameters trimmed down. Give it a shot, eh?

  • Hello there, any easy script for add to game code?

    Thanks.

Friends {{client.onlineFriendsCount}}/{{client.offlineFriendsCount}}

People Online:

Room Users {{client.usersOnline.length}}

: