[SOLVED] Quick question regarding Game Center
by Luis E Pabon · in iTorque 2D · 10/28/2011 (7:46 pm) · 7 replies
My app throws "unable to find function" whenever it hits a game center function such as initGameCenter and closeGameCenter when running on debug mode. I'd like to verify if this is normal. I am running the game on iTorque 1.5, with no modifications. I tried building and not building the dso files.
On the same note, if anyone could share with me a way to test Achievements and Leaderboards without releasing the game I would really appreciate it.
On the same note, if anyone could share with me a way to test Achievements and Leaderboards without releasing the game I would really appreciate it.
About the author
#2
The game is already setup on iTunes Connect.
Unfortunately I am still having the "unable to find function initGameCenter" error pop up, as well as all the other ones.
This error happens both in the iPhone simulator and my device.
I will keep trying.
10/29/2011 (10:23 am)
Thanks for the help. I added the TORQUE_ALLOW_GAMEKIT flag on the GameCenter.h file, which finally made it stay enabled on TGB.The game is already setup on iTunes Connect.
Unfortunately I am still having the "unable to find function initGameCenter" error pop up, as well as all the other ones.
This error happens both in the iPhone simulator and my device.
I will keep trying.
#3
10/29/2011 (10:29 am)
Have you added the GameKit library to the project?
#4
10/29/2011 (10:35 am)
I am not sure if I have. The platformiPhone folder appears in the Xcode solution, so I assumed it was on by default.
#5
Will edit this post if I figure it out quickly.
Edit - I tried writing both:
at the end of torqueConfig.h, but they are not working. The Game Builder is getting them though.
10/29/2011 (10:57 am)
I commented out the ifdef TORQUE_ALLOW_GAMEKIT and endif statements in the gamecenter code, and that made them trigger. I don't understand, since I added the flag.Will edit this post if I figure it out quickly.
Edit - I tried writing both:
#define TORQUE_ALLOW_GAMEKIT //and #define TORQUE_ALLOW_GAMEKIT true
at the end of torqueConfig.h, but they are not working. The Game Builder is getting them though.
#6
I'm not sure why but that's what I did, and I'm not sure if the IT2D_EDITOR_FLAGS are working or not.
I'm just not sure :P but you can just manually add the TORQUE_ALLOW_GAMEKIT to the Preprocessor macros list and it will show up.
AND you have to link your project to the GameKit library. I forgot that bit. ^^^
EDIT: you find the macros (Debug, Release and Shipping) when you click the project name at the top of the XCode class list. Then click the target, goto the Build Settings tab and scroll all the way down to LLVM GCC 4.2 - Preprocessing
EDIT 2: I believe GameKit is linked by default in the 1.5 version of iTorque now that I look at it.
10/29/2011 (11:06 am)
I think I had to manually add TORQUE_ALLOW_GAMEKIT under the LLVM GCC 4.2 preprocessor macros.I'm not sure why but that's what I did, and I'm not sure if the IT2D_EDITOR_FLAGS are working or not.
I'm just not sure :P but you can just manually add the TORQUE_ALLOW_GAMEKIT to the Preprocessor macros list and it will show up.
AND you have to link your project to the GameKit library. I forgot that bit. ^^^
EDIT: you find the macros (Debug, Release and Shipping) when you click the project name at the top of the XCode class list. Then click the target, goto the Build Settings tab and scroll all the way down to LLVM GCC 4.2 - Preprocessing
EDIT 2: I believe GameKit is linked by default in the 1.5 version of iTorque now that I look at it.
#7
10/29/2011 (12:19 pm)
Yeah that did it. The Game Center is working perfectly now. Thanks!
Daniel Liverance
Blinker Studios
Also you need to run the game either on a device or on the iPhone simulator to be able to even test the GameCenter (just in case you were trying to use the Torque simulator)
To test Game Center without releaseing (actually you are supposed to test it thoroughly before you release according to apple) you need to go to itunes connect.
Create the game you are making on itunes connect.
Enable Game Center on itunes connect (under Manage Game Center).
Add some leaderboards and achievements.
Then you are ready to test them using a "Sandbox" GameCenter account.
I'm not 100% sure on how to make a Sandbox account, but when you run your game just try making a new account like "TestUser" or something, and log into it once you run your game in debug mode and it may ask you to turn the account into a sandbox account.
Also if you log into that account in the GameCenter app and look at the bottom of the screen where it usually says "Me" it will say "Sandbox" and you know you are good.
Hope this helps.