Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by Borgo · Jan 07, 2011 at 07:16 PM · apipublishingimplementationkongregate

Unity Kongregate API Problem

Hi, I need some help.

I'm having problem implementing the Kongregate API.

I have Used this little script:

var isKongregate = false; var userId = 0; var username = "Guest"; var gameAuthToken = "";

function OnKongregateAPILoaded(userInfoString : String){ // We now know we're on Kongregate isKongregate = true;

// Split the user info up into tokens var params = userInfoString.Split("|"[0]); userId = parseInt(params[0]); username = params[1]; gameAuthToken = params[2];

}

function Awake(){ // Begin the API loading process if it is available Application.ExternalEval( "if(typeof(kongregateUnitySupport) != 'undefined'){" + " kongregateUnitySupport.initAPI('MyUnityObject', 'OnKongregateAPILoaded');" + "};" );

}

function OnGUI(){ GUI.Box(Rect(0,0,100,20),isKongregate.ToString()); }

  • I upload the .unity3d to kongregate
  • If I use a externalEval with "alert(typeof(kongregateUnitySupport))", it will alert "Object". It means that the object exists.
  • The Script calls the initAPI function of this script but doesn't call back the OnKongregateAPILoaded function.
  • The GUI.Box ever show the message "False" what is to be modified when the function is called.

I have used this example: http://answers.unity3d.com/questions/33227/how-do-i-implement-the-kongregate-api But doesn't works.

The Kongregate.Package in the Unity.com page have the some problem to me.

please, help me.

Thanks, William Borgo

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Borgo · Jan 13, 2011 at 07:41 PM 0
Share

Do I need to upload any other file (script) when uploading my game?

avatar image Ehren · Jan 13, 2011 at 10:46 PM 0
Share

Nope. Just the .unity3d file.

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Ehren · Jan 13, 2011 at 10:37 PM

Is the name of the object the script is attached to 'MyUnityObject'? If not, the callback to OnKongregateAPILoaded will fail.

Another possibility: if you're doing other ExternalEvals that happen to result in javascript errors, subsequent ExternalEval calls will not work.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Borgo · Jan 14, 2011 at 10:36 AM 0
Share

Yes!!! It's work. I didn't think that was about the game object. I did think that is about the object of the website.

avatar image Borgo · Jan 14, 2011 at 10:36 AM 0
Share

Tkanks a lot!!!

avatar image Ehren · Jan 14, 2011 at 04:06 PM 0
Share

Glad I could help.

avatar image
1

Answer by 3v3rton · Jan 13, 2011 at 12:59 PM

This looks like a problem with Kongregate Scripts, however they have some games that are able to connect with API.
I sugest you to contact Kongregate support. Maybe they can help you.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Borgo · Jan 13, 2011 at 01:35 PM 0
Share

Ok, I have send this question to kongregate's technical support. The only problem is it can take 5 days for them to respond.

avatar image
0

Answer by psychicparrot · Feb 06, 2011 at 04:24 AM

If you didn't solve it yet, the following fix worked for me (yippeee) after nothing else did!

http://www.kongregate.com/forums/4-programming/topics/140914-unity-kongregate-api-package-not-connecting?page=1#posts-3126582

Enjoy!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How do I implement Kongregate's API? 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Android download error "package not signed correctly 0 Answers

Material doesn't have a color property '_Color' 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges