CocoonJS plugin updates

Discussion and feedback on Construct 2

Post » Fri Dec 05, 2014 10:04 pm

ludei wrote:
hollowthreat wrote:@ludei thanks for quick reply & good job with recent improvements, cjs deserved to stay in c2 official support! i noticed new Cocoonjs plugin has removed "Is logged in to Game Center", also "Request login", are these no longer necessary?


They are both in Social. The "Is logged in" now is included internally in every Social Service available (Facebook / Google Play / Game Center) and the "Request Login" should appear in Social too. The required params depend on the service you want to use. You can select the social service through the CocoonJS object ( you can pick between GP / GC depending on the nature of the device, o force the device to use just one). Unfortunately, you still cannot use Facebook AND Google Play or Facebook AND Game Center. That requires a lot of programming time and we still cannot face it.
All the required params you need to fill in the CocoonJS object for configuring the Social Services are specified there.


@ludei I'm still having trouble to use "Is logged in", can't see any 'Social' option under a 'Function', I was able to add "Is logged in to Game Center" in old C2 embedded CJS plugin, but the manually installed new CJS plugin won't show any 'Social' options under a 'Function', I can see 'Social' outside a Function tho, this possibly a bug?

To reproduce this problem:
1. New project
2. Insert new object > Function
3. Insert new object > CocoonJs
4. in event sheet, add event > Function > On Function
5. right click on the added Function > Add blank sub event
6. double click on the added blank sub event > Cocoonjs, you will see no 'Social' options available!
Doo Doo Diving App Store | Google Play

Donut Pirate App Store | Google Play
B
17
S
2
G
1
Posts: 195
Reputation: 1,578

Post » Tue Dec 09, 2014 9:52 am

TheWyrm wrote:Did this already happen? I was hoping to see something about Cordova plugins in CJS builds.


Still working on it. Sorry. We will publish everything as soon as it is ready, so do not worry, we will keep you all inform.

hollowthreat wrote:I'm still having trouble to use "Is logged in", can't see any 'Social' option under a 'Function', I was able to add "Is logged in to Game Center" in old C2 embedded CJS plugin, but the manually installed new CJS plugin won't show any 'Social' options under a 'Function', I can see 'Social' outside a Function tho, this possibly a bug?

To reproduce this problem:
1. New project
2. Insert new object > Function
3. Insert new object > CocoonJs
4. in event sheet, add event > Function > On Function
5. right click on the added Function > Add blank sub event
6. double click on the added blank sub event > Cocoonjs, you will see no 'Social' options available!


It is not a bug. You should see the attached image when adding a condition. If you can see this, it means you are using the latest plugin and the "Is logged in" is done internally and not necessary. If you want to check the code, you can open the runtime.js inside the cocoonjsads folder and open it. If you search for "isLoggedIn()", you will find it as a condition. We are checking it for you.

Regards.
You do not have the required permissions to view the files attached to this post.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Post » Tue Dec 09, 2014 9:32 pm

ludei wrote:
TheWyrm wrote:Did this already happen? I was hoping to see something about Cordova plugins in CJS builds.


Still working on it. Sorry. We will publish everything as soon as it is ready, so do not worry, we will keep you all inform.

hollowthreat wrote:I'm still having trouble to use "Is logged in", can't see any 'Social' option under a 'Function', I was able to add "Is logged in to Game Center" in old C2 embedded CJS plugin, but the manually installed new CJS plugin won't show any 'Social' options under a 'Function', I can see 'Social' outside a Function tho, this possibly a bug?

To reproduce this problem:
1. New project
2. Insert new object > Function
3. Insert new object > CocoonJs
4. in event sheet, add event > Function > On Function
5. right click on the added Function > Add blank sub event
6. double click on the added blank sub event > Cocoonjs, you will see no 'Social' options available!


It is not a bug. You should see the attached image when adding a condition. If you can see this, it means you are using the latest plugin and the "Is logged in" is done internally and not necessary. If you want to check the code, you can open the runtime.js inside the cocoonjsads folder and open it. If you search for "isLoggedIn()", you will find it as a condition. We are checking it for you.

Regards.



@ludei thanks for reply, i'm still a bit confused, i can see the conditions as your attached image ONLY OUTSIDE a "Function", when I'm under a "Function", Cocoonjs conditions are very limited, image I attached is what I see under a "Function", doubt this is normal. (btw, i'm on latest cjs plugin, just updated again this morning)
cjs-func-condition.jpg


Also attached a capx made with R190, I created a "Function" and a blank sub-event, you can try add cjs condition in the blank sub-event. you should see the problem.
cjs-condition-problem.capx
You do not have the required permissions to view the files attached to this post.
Doo Doo Diving App Store | Google Play

Donut Pirate App Store | Google Play
B
17
S
2
G
1
Posts: 195
Reputation: 1,578

Post » Tue Dec 09, 2014 9:59 pm

I think it's normal, what are you wanting to be able to do? Are you wanting Is Logged In as a sub event of the function? That event is a trigger.
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Tue Dec 09, 2014 10:29 pm

ArcadEd wrote:I think it's normal, what are you wanting to be able to do? Are you wanting Is Logged In as a sub event of the function? That event is a trigger.

@ArcadEd i'm trying to convert my old game to new cjs plugin, which i have a 'gameover' function, triggered that function at end of each game, checks "Is logged In", if true, submit score.

i was able to add that condition in old built in cjs before, thats why i thought its broken, maybe im doing the events wrong? :shock:
Doo Doo Diving App Store | Google Play

Donut Pirate App Store | Google Play
B
17
S
2
G
1
Posts: 195
Reputation: 1,578

Post » Tue Dec 09, 2014 11:05 pm

Well since Is Logged In is a trigger, what you might want to do is just leave it as a stand alone event and set a variable. I do something like

Is Logged In - Set loggedIn = 1

Then use that variable (loggedIn) in your function instead.
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Wed Dec 10, 2014 12:27 am

ArcadEd wrote:Well since Is Logged In is a trigger, what you might want to do is just leave it as a stand alone event and set a variable. I do something like

Is Logged In - Set loggedIn = 1

Then use that variable (loggedIn) in your function instead.


@ArcadEd yeah this will work, thank you! but wouldn't this checks Is Logged In all the time? I missed the old cjs where I can just do it in function, and i can trigger the function whenever i need.
Doo Doo Diving App Store | Google Play

Donut Pirate App Store | Google Play
B
17
S
2
G
1
Posts: 195
Reputation: 1,578

Post » Wed Dec 10, 2014 12:33 am

No, a Trigger event only happens when that event is triggered.

This is from the C2 manual
Image
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Wed Dec 10, 2014 2:09 am

So, I'm looking to test a couple of my current projects on my new android device. It's a smartphone, 1.2ghz dual core, running Android 4.4.2.

I've done some exports with crosswalk, now I'd like to export CocoonJS versions for comparison. All the official documentation on Scirra is out of date. So...where do I start? What do I try? Is it even worth bothering with CocoonJS for android?

Any input would be a big help...:)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Wed Dec 10, 2014 2:15 am

I've published all of my games with CocoonJS, including Hungry Hal https://www.scirra.com/construct2/games/hungry-hal

My steps, as I am targeting more than just Android 5 and iOS8
Sign up for their cloud compiling service.
Download and install the latest plugin, and take a look at the example CAPX included with it. https://github.com/ludei/Construct-2-plugin
Export your project as CocoonJS (You may need to activate it by right clicking in the export windows and choose "Show depreciated exporters")
Setup everything on the cloud compiler, drop in your zip file that C2 created and export as Canvas+

You can also export and then try it in the CocoonJS Launcher app that is available for ios and android. Though I prefer testing actual compiled files.

If you have more questions, just ask.
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests