playMaker

Author Topic: gamecenter actions  (Read 9173 times)

dennisli168

  • Playmaker Newbie
  • *
  • Posts: 8
gamecenter actions
« on: July 21, 2012, 01:36:15 PM »
I have already finished my game and I'm desperately looking for help in gamecenter integration.
I purchased the Gamecenter plugin from unity asset store and I need help turning the scripts into unity actions.
This is the sample script that came with the plugin, which demonstrates what the plugin is supposed to do:

using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour {

   // Use this for initialization
   void Start ()
   {
      // configure all events
      GameCenter.ConnectionState += new GameCenter.ConnectionStateDelegate(GameCenter_ConnectionState);
      
      // begin authenification
      GameCenter.Authenticate(true, true);
   }
   
   void OnGUI()
   {
      if (GUI.Button(new Rect(10,10,200,200), "Report achievement"))
         GameCenter.ReportAchievement("com.games4fun.ufohotseat.firstwin");
      
      if (GUI.Button(new Rect(10,220,200,200), "Show achievements"))
         GameCenter.ShowAchievements();
      
      if (GUI.Button(new Rect(10,430,200,200), "Show leaderboard"))
         GameCenter.ShowLeaderboard();
      
      if (GUI.Button(new Rect(220,10,200,200), "Post 100 scores to leaderbaord"))
         GameCenter.ReportScore(100, "you leaderboard id");      
      
      if (GUI.Button(new Rect(220,220,200,200), "Get all scores"))
         ShowScores("you leaderboard id");
   }
   
   void GameCenter_ConnectionState(bool _online)
   {
      Debug.Log(System.String.Format("{0} player is {1}", GameCenter.PlayerAlias, _online ? "online" : "offline"));
   }
   
   void ShowScores(string _categoryID)
   {
      Debug.Log(System.String.Format("{0} player have {1} scores in {2} table", GameCenter.PlayerAlias, GameCenter.GetScore(_categoryID), _categoryID));
   }
}

I have no experience in c# coding and I am not sure what I can do to get things started. Is there a tutorial for making custom actions? I know theres a custom action wizard, but I have no idea what to do with it. These methods dont look too complicated, is it possible for me to find similar actions already in playmaker, substitute their codes with these new methods and create new actions?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: gamecenter actions
« Reply #1 on: July 23, 2012, 12:26:55 PM »
Hi,

 allow me few days, and I'll get back to you with something to get you up and running. If no one stepped in before and If you don't hear back next week, don't hesitate to remind me.

bye,

 Jean

Davision

  • Playmaker Newbie
  • *
  • Posts: 23
Re: gamecenter actions
« Reply #2 on: July 23, 2012, 01:41:50 PM »
gamecenter actions would be sweet! I will have to get gamecenter implemented here too.

dennisli168

  • Playmaker Newbie
  • *
  • Posts: 8
Re: gamecenter actions
« Reply #3 on: July 23, 2012, 02:37:15 PM »
Jean,

Words cannot express how much I appreciate your work!!!!
Cant wait to try those gamecenter acitons!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: gamecenter actions
« Reply #4 on: September 03, 2012, 07:23:37 AM »
Hi,

 Ok, it's now available:

http://hutonggames.com/playmakerforum/index.php?topic=2191.0

Thanks again Dennis for your support, this has definitely speed up the development of these actions.

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: gamecenter actions
« Reply #5 on: September 05, 2012, 03:50:58 AM »
Awesome. Does this GameCenter plugin work with Unity 3.5.x I notice it says 3.4 and when I went to the authors website hippo-games.ru it seems to not support the plugin anymore?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: gamecenter actions
« Reply #6 on: September 05, 2012, 04:20:13 AM »
Hi,

 It works on 3.5. Have you contacted them? If they are still selling it, they ought to provide support, else please report this to the Asset store people, this is very important that they know who's playing the ball and who's not.

 all in all, I think the next move on this is to port the actual Unity social api which will essentially provide the same access to the apple gameCenter, but I need to first finish *a lot* of other things for the community before... as always, pm me if you need this urgently, work kind of get prioritize this way   :P

 bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: gamecenter actions
« Reply #7 on: September 05, 2012, 04:23:29 AM »
Glad to hear it works on 3.5  :)

I've not contacted them as I'm still considering my options, was looking at Prime31s Gamecenter plugin when I saw the playmaker actions you made Jean.  ;D

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: gamecenter actions
« Reply #8 on: September 07, 2012, 12:22:28 PM »
I've just bought the GameCenter plugin and I'm at the point of testing on my device but Xcode is giving me lots of errors, see attached image.

Can someone please tell me their workflow?

Thanks




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: gamecenter actions
« Reply #9 on: September 10, 2012, 02:46:31 AM »
Hi,

 it's very likely that you haven't configured properly your xcode project to include the necessary frameworks and settings for it to work with GameCenter system.

please follow this instruction carefully ( this is exactly the one I followed to test this package):

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-game-center-achievements-and-leaderboards-part-1/

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: gamecenter actions
« Reply #10 on: September 12, 2012, 02:08:20 PM »
OK I got it working in Xcode so it didn't give the errors, turned out it was because I was still supporting Armv6 in the settings.  ::)

So, could you please give me an idea what I need so set up first with the actions, it's a bit confusing.

Should I use the connect action on the menu?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: gamecenter actions
« Reply #11 on: September 13, 2012, 06:02:34 AM »
Hi,

 I have attached a sample, so that you can see and test how it can be done. It assumes you have indeed set up gameCenter properly on xcode and your application setup on your apple dev account.

Basically, you use the "GameCenterConnect", wait for the online connection event, and then you can start using other actions.

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: gamecenter actions
« Reply #12 on: September 13, 2012, 12:51:32 PM »
Great, thanks Jean.  :)