Implement Spilgames API

0 favourites
  • 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 scirra.com/forum/topic84434.html

    Thanx in advance.

  • 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.

    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.

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

    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.

  • 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?

  • 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

  • I recommend everyone to use PixelRebirth's plugin.My implementation is a total mess using javascript calls.

  • 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?

  • 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?

  • 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?

    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).

    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?

    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.

  • First of all, a very very BIG thanx to PixelRebirth. You saved me from an obvious downfall of my project.

    After some RnD, I found that, after installing this addon, the game works absolutely fine, but it dont show this in the test tool which Spill games provided. Since we have not directly included this in the index.html file. So you need not to worry about the red colored 'API LOADED', as it is loaded but not seen. The advertisement is showing, which indirectly means the API is loaded. And the test tool is not working properly ( I think), the fnResume is called with fnPause.

    I submitted my game with this comments. Hope it works.

  • I did not yet tested all but the plugin seems to be working even so as i cannot test from their page cannot be sure will tell you ass soon as they check and tell me

  • Yeah, their test tool is not detecting the LaodAPI function, but the 'Loading ads' screen is coming, which means it is loaded. I deleted the LoadAPI call from the Construct 2 event and that time the "Loading Ads" screen was not shown. That concludes that the plug in is installed and working.

  • Just wanted to thank skyhunter93, bilgekaan, and Pixelrebirth (and anyone else who helped) for giving away their plugins and helping us with this, so, thanks!.

  • Just wanted to thank skyhunter93, bilgekaan, and Pixelrebirth (and anyone else who helped) for giving away their plugins and helping us with this, so, thanks!.

    You're welcome! <img src="smileys/smiley1.gif" border="0" align="middle" />

    Btw it seems Spilgames updated the HTML5 API test tool. Requesting an ad now properly triggers fnPause as well as fnResume. Nice!

    It seems you can't test games with HTTPS urls anymore though, which means you cannot use dropbox. <img src="smileys/smiley19.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)