User Tag List

Results 1 to 4 of 4

Thread: GameCenter Achievement Object Bug (and fix) [beta 8]

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Exclamation GameCenter Achievement Object Bug (and fix) [beta 8]

    There is an issue with the send achievement action on the GameCenter Achievement object.
    It works great if you only send one achievement, but if you send a lot in quick succession then GameCenter sometimes mixes up the ID's and Percentages.

    This should be possible since Apple even outlines how to achieve this in their documentation.

    You can fix this problem yourself by modifying the following function in the "CRunGameCenterAchievements.m" file.
    It's located in the "\Classes\Extensions\" folder.

    Replace the function "sendAchievement" with the following code:

    Code:
    -(void)sendAchievement:(CActExtension*)act
    {
        NSString* identifier=[act getParamExpString:rh withNum:0];
        int percent=[act getParamExpression:rh withNum:1];
        
        //Create a GKAchievement object and attach the ID and percent
        GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier: identifier];
        achievement.percentComplete = percent;
        //Send the data to GameCenter
        [achievement reportAchievementWithCompletionHandler:^(NSError *error) {}];
        
        flags|=FLAG_SENDACHIEVEMENT; 
    }
    Here is the documentation:
    http://developer.apple.com/library/i...ievements.html

    This will send both the ID and percent in the same message, so the percents won't get mixed up if the messages arrive at different times.

  2. #2
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Hi UrbanMonk.
    Thank you for finding both the bug and the fix. I will make sure to include it in the next update so you don't have to replace the code every time you export a fresh XCode project.

  3. #3
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    Shameless plug, but the problem I report below relates to the GameCenter Achievements Object (with an s). I just wanted to make sure that you guys don't forget to fix it:
    http://community.clickteam.com/showthread.php?t=78161&p=581300&viewfull=1#post581 300

  4. #4
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this bug fixed? It seems I still get the old code on my side.

Similar Threads

  1. Any way to check an achievement was sent on PC?
    By mobichan in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 9th November 2013, 09:23 PM
  2. [Gamecenter] Notification on Achievement
    By Sphax in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 29th October 2013, 01:32 PM
  3. Gamecenter Achievements Object [Missing Function]
    By UrbanMonk in forum iOS Export Module Version 2.0
    Replies: 8
    Last Post: 12th April 2013, 12:36 AM
  4. My Achievement system (it works, but sucks?)
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 8th March 2012, 06:34 PM
  5. No Gamecenter authentication
    By JoKa in forum iOS Export Module Version 2.0
    Replies: 4
    Last Post: 16th December 2011, 05:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •