Implement Spilgames API

Get help using Construct 2

Post » Sun Feb 02, 2014 1:59 pm

@PixelRebirth: Thanx for the plug in. Just to be sure, I must call the LoadAPI at 'on start of layout', and 'Request Ads' at the time when I need to show ads (for me, its on clicking play again button), right ??   Still in doubts. Do I need to make timescale 0 ? Is there a variable to change (for eg 'apiTry' in an example on this thread) ?

P.S.- This is my very first HTML5 project and I am not too much familiar with Construct 2 yet.

Also can you (or anyone) please help me on a problem I am facing. This is for the same game I am working on. Please take a look here http://www.scirra.com/forum/topic84434.html

Thanx in advance.Raganork2014-02-02 14:25:11
B
6
S
2
G
1
Posts: 77
Reputation: 708

Post » Sun Feb 02, 2014 3:00 pm

[QUOTE=Raganork] @PixelRebirth: Thanx for the plug in. Just to be sure, I must call the LoadAPI at 'on start of layout', and 'Request Ads' at the time when I need to show ads (for me, its on clicking play again button), right ??   Still in doubts. Do I need to make timescale 0 ? Is there a variable to change (for eg 'apiTry' in an example on this thread) ?

P.S.- This is my very first HTML5 project and I am not too much familiar with Construct 2 yet.
[/QUOTE]

Yes, add the load API action ideally in the first layout with a "On start of layout" condition. Make sure to only do this once. Don't add it to every layout and in case the user can go back to the very first layout the event shouldn't run again either.

And yeah, when you want to show an ad, use the request action. You will have to define what happens when an ad is shown with the "On pause" and "On resume" conditions. Disable user input ingame or whatever is required. Setting the timescale to 0 and back to 1 could very well be part of it. It very much depends on your game and where you want to show ads.
B
23
S
6
G
11
Posts: 1,047
Reputation: 8,065

Post » Mon Feb 03, 2014 2:26 am

Thanks a lot Not still working but managed to do the LoadApi...
even so i did not found the "branding Logo" option about GetLogo
nor in actions...or conditions or expresion..
all i got as expressions were..
Count, IID, MyExpresion, PickedCount and UID

so really not sure how to set the GetLogo, may be i just have an old version. can you confirm the version or check if you manage to see the GetLogo?
or you just have to set GetLogo inside the as message in the load the spilGames API text?
B
5
S
1
Posts: 23
Reputation: 421

Post » Mon Feb 03, 2014 8:46 am

[QUOTE=stelarfox] Thanks a lot Not still working but managed to do the LoadApi...
even so i did not found the "branding Logo" option about GetLogo
nor in actions...or conditions or expresion..
all i got as expressions were..
Count, IID, MyExpresion, PickedCount and UID

so really not sure how to set the GetLogo, may be i just have an old version. can you confirm the version or check if you manage to see the GetLogo?
or you just have to set GetLogo inside the as message in the load the spilGames API text?[/QUOTE]

I updated the plugin already once. The earlier version didn't have the "Get logo"-action and the expressions yet. Please download the plugin again. The current version has the .c2addon file extension (previous one was just zip).

EDIT: Please download the plugin yet again. I updated it to fix problems with minification and the "Get logo"-action. Current version is 0.91.PixelRebirth2014-02-03 13:18:49
B
23
S
6
G
11
Posts: 1,047
Reputation: 8,065

Post » Mon Feb 03, 2014 1:48 pm

Ok then i am sure i have the old because was a zip.. how do i uninstall this old and where do i find the new one?
B
5
S
1
Posts: 23
Reputation: 421

Post » Mon Feb 03, 2014 2:23 pm

Just delete the folder of the old plugin (found in \exporters\html5\plugins\)and then simply drag the c2addon-file into an open Construct 2 window.

The old link has been updated, here is it again: Download
B
23
S
6
G
11
Posts: 1,047
Reputation: 8,065

Post » Mon Feb 03, 2014 4:22 pm

I recommend everyone to use PixelRebirth's plugin.My implementation is a total mess using javascript calls.
B
35
S
4
G
5
Posts: 84
Reputation: 4,860

Post » Mon Feb 03, 2014 7:31 pm

Ok i managed to get working perfectly fine the part In-Game Ads
as i am testing it in the "Game API Test Tool"

the other 2 API Loaded and Branding is not working.
I set the Api the main menu... just 1 time for sure (i have something that shows me)..
also the getlogo but, is not showing in there....so, is not working or the tester does not work?
B
5
S
1
Posts: 23
Reputation: 421

Post » Mon Feb 03, 2014 8:43 pm

by the way in your new plugin i found only 2 expresions.
BrandingImage and BrandingLink but as they are no action i cannot asign anything to them .. or how could I?

besides, how can i set where i want it?
B
5
S
1
Posts: 23
Reputation: 421

Post » Mon Feb 03, 2014 10:05 pm

[QUOTE=stelarfox] by the way in your new plugin i found only 2 expresions.
BrandingImage and BrandingLink but as they are no action i cannot asign anything to them .. or how could I?

besides, how can i set where i want it?[/QUOTE]

These expressions return the image url and link address after you have used the "Get logo"-action.

You can load the image to a sprite with the "Load image from URL"-action. Put the BrandingImage expression there. Because of the Same-origin policy this will not actually work before the game is on Spilgames' server.

And use the BrandingLink expression to link to the address on click/touch (needs the browser object).

[QUOTE=stelarfox]Ok i managed to get working perfectly fine the part In-Game Ads
as i am testing it in the "Game API Test Tool"

the other 2 API Loaded and Branding is not working.
I set the Api the main menu... just 1 time for sure (i have something that shows me)..
also the getlogo but, is not showing in there....so, is not working or the tester does not work?[/QUOTE]

Yes, I have been discussing this with Raganork before per email. It seems the test tool isn't recognizing the API being loaded. But of course it is loaded, otherwise the ad request wouldn't work. Try removing the "Load API"-action and request an ad - it won't work.

Raganork has been suggesting that API loaded lights up green if you include the script like described in the documentation from their url. Since you cannot define remote dependencies in plugins this uses a local copy of the script.

However skyhunter93 also used a local script and his implementation got still accepted. You can of course try to remove the script tag adding spilgames.js in the index.html file and add the script from the documentation instead.PixelRebirth2014-02-03 22:11:35
B
23
S
6
G
11
Posts: 1,047
Reputation: 8,065

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: adelwich, kizlengames, WesleyDeveloper9 and 8 guests