[PLUGIN] Clay.io (leaderboards & achievements)

Post your completed addons to share with the community

Post » Sat Jul 20, 2013 2:06 pm

Hey guys, love your work. I believe Clay.IO breaks the latest version of CocoonJS. I get the following error when adding the plugin to any project:

JavaScript Exception: (File:'c2runtime.js' Tag:'script') TypeError: Cannot call method 'addEventListener' of undefined
   at instanceProto.onCreate(c2runtime.js:20559:68)
   at Runtime.load(c2runtime.js:7814:14)
   at window.createCocoonJSRuntime(c2runtime.js:10172:12)
   at c2runtime.js:46513:1
   at c2runtime.js:46515:3
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Sat Jul 20, 2013 3:19 pm

[QUOTE=cow_trix] Hey guys, love your work. I believe Clay.IO breaks the latest version of CocoonJS. I get the following error when adding the plugin to any project:

JavaScript Exception: (File:'c2runtime.js' Tag:'script') TypeError: Cannot call method 'addEventListener' of undefined
   at instanceProto.onCreate(c2runtime.js:20559:68)
   at Runtime.load(c2runtime.js:7814:14)
   at window.createCocoonJSRuntime(c2runtime.js:10172:12)
   at c2runtime.js:46513:1
   at c2runtime.js:46515:3[/QUOTE]

I have the same problem, I use the Construct2 139 release and the latest version of CocoonJS and Clay.io

http://imgur.com/1XtgKGl
B
3
Posts: 2
Reputation: 229

Post » Sat Jul 20, 2013 5:22 pm

I already told the problem to Ludei and Austin. Now Ludei figured out what is wrong and Austin is fixing it.
B
23
S
8
G
1
Posts: 172
Reputation: 2,778

Post » Sun Jul 21, 2013 10:20 am

Wow thanks for told the problem to Ludei and Austin i dont try it :D
B
3
Posts: 2
Reputation: 229

Post » Sun Jul 21, 2013 8:37 pm

Just to update everyone - like Shaircast said, I am aware of it and am working on a fix
B
24
S
8
G
4
Posts: 208
Reputation: 6,152

Post » Sun Jul 21, 2013 9:14 pm

I've updated the plugin with what should fix the issue. You will need to make a change to a file in the Construct 2 CocoonJS export however.

In index.html, you will see:
[CODE]
<html>
     <body>
          <script src="c2runtime.js">
          </script>
     </body>
</html>
[/CODE]

Change that to:
[CODE]
<html>
     <body>
          <script src="CocoonJS.js"></script>
          <script src="CocoonJS_App.js"></script>
          <script src="CocoonJS_App_ForCocoonJS.js"></script>
          <script src="CocoonJS_App_ForWebView.js"></script>
          <script src="c2runtime.js">
          </script>
     </body>
</html>
[/CODE]

I've reached out to Ashley about getting that setup by default in C2 because I imagine that's breaking one or two of their plugins as wellaustin2013-09-19 01:01:46
B
24
S
8
G
4
Posts: 208
Reputation: 6,152

Post » Mon Jul 22, 2013 6:27 am

Hey Austin. While that does stop CocoonJS from complaining, it also makes the scaling not work and the plugin cannot connect.

The little white sprite in the top left of the screenshot is all that appears when a leaderboard tries to display:

http://www.lrtw.net/documents/misc/2013-07-22%2015.24.16.png

That little box is scrollable, its just the logo and:
"Loading Leaderboard... Debug Mode"

The leaderboard fails to load, and high scores are not submitted. The condition "Clay.IO is ready" is not true.

CocooonJS spits out the following error:

Clay.IO has not connected to its backend yet. Use Clay.Ready() before this call, or email us if you think the issue is on our end

Keep in mind this all works absolutely fine for the desktop version.cow_trix2013-07-22 06:37:22
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Mon Jul 22, 2013 9:15 am

If you don't mind, can you email me the zip file you're using to preview the game? austin@clay.io
B
24
S
8
G
4
Posts: 208
Reputation: 6,152

Post » Tue Jul 23, 2013 3:23 am

For everyone else reading this, the issue cow_trix has most recently was just due to not copying over the new webview files.
B
24
S
8
G
4
Posts: 208
Reputation: 6,152

Post » Wed Jul 24, 2013 8:45 pm

Hey Austin, how would I go about checking if to see if an in-app purchase was successful after someone clicked a button and successfully credited their credit card?
Image
B
71
S
15
G
3
Posts: 492
Reputation: 8,014

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 6 guests