PauloMarcio's Recent Forum Activity

  • For what i remember, using admob plugin was not very hard, you struggle a bit but get it working... however, i understand your frustration with the "free crap", they make a huge advertise about their services but nothing work without some struggling(sometimes a lot), and the ones who knows how to do the things just hide away and won't share the knewledge, today for example i spent more than 6 hours just trying to make the google play game services work in my apk and it still won't work(at least i learned a lot about google services).

    But to your question: The code to edit... well, hard to explain, but i can say that the best solution is to write a cordova plugin for it, android API for admob must be hard for your if you aren't a developer. Since you are using construct2 and want to make an APK, the best solution is to use cordova, and to use admob in your apk you could develop a plugin(as i said it may be hard) or you can find one, maybe the one from cranberrygame? or you can use the construct2 plugin that just use the cranberrygame cordova plugin.

    The thing is, construct2 games are web applications, they need a native app(on android, ios, windows, etc.) to run on, cordova already give it to you, you just need to develop a plugin to it, in this case the plugin already exist, just learn how to use it. I'm just talking about cordova because intel xdk and cocoon all relies upon cordova to build the final apk.

  • I'm using google play game services, when i run the project in the browser i can access the services, but when i export to cordova and generate the apk the plugin just don't work! for cordova i have installed this plugin:

    cordova-plugin-inappbrowser[/code:6qv9ko6e]
    
    The [b]OnLoaded[/b] event is not being triggered!
    
    I think that this is due to some restriction in the webview used by cordova since in real browsers it works well.
    Does anyone knows how to properly configure this plugin to use it with cordova?
  • Ok, i have edited the keyboard plugin and here comes a little tutorial:

    First go to the directory: YOUR_CONSTRUCT_DIR\exporters\html5\plugins\keyboard

    then open the files: edittime.js and runtime.js

    basically the first file is where you configure the plugins conditions, actions, etc, the second is where you implement this actions and conditions(some plugins may also need thirdy party plugins, when exporting for cordova you need to install them yourself)

    Configuring the actions

    Well, there is two actions that you need: keydown and keyup, in the first file choose some place and post this code there:

    ////////////////////////////////////////////////////////////
    // Actions
    // AddAction(id,				// any positive integer to uniquely identify this action
    //			 flags,				// (see docs) af_none, af_deprecated
    //			 list_name,			// appears in event wizard list
    //			 category,			// category in event wizard list
    //			 display_str,		// as appears in event sheet - use {0}, {1} for parameters and also <b></b>, <i></i>
    //			 description,		// appears in event wizard dialog when selected
    //			 script_name);		// corresponding runtime function name
    
    AddKeybParam("Key", "Choose a key.  Note that international users and users on different operating systems or devices may not have the same keys available.");
    AddAction(
    	0,
    	af_none,
    	"Simulate keydown",
    	"Keyboard Simulation",
    	"Simulate keydown {0}",
    	"Simulate a keydown from the keyboard",
    	"send_keydown"
    );
    
    AddKeybParam("Key", "Choose a key.  Note that international users and users on different operating systems or devices may not have the same keys available.");
    AddAction(
    	1,
    	af_none,
    	"Simulate keyup",
    	"Keyboard Simulation",
    	"Simulate keyup {0}",
    	"Simulate a keyup from the keyboard",
    	"send_keyup"
    );
    [/code:n12gw647]
    
    Please, read the comments, they will explain the parameters for the AddAction function(the AddKeyParam function i just copied and pasted from the keyboard plugin conditions section(you may want to take a look there))
    
    [b]Implementing the actions[/b]
    Open the second file and find this line:
    
    [code:n12gw647]
    	function Acts() {};
    [/code:n12gw647]
    
    right under it you paste this code:
    
    [code:n12gw647]
    	Acts.prototype.send_keydown = function(key){
    		jQuery.event.trigger({ type : 'keydown', which : key });
    	}
    
    	Acts.prototype.send_keyup = function(key){
    		jQuery.event.trigger({ type : 'keyup', which : key });
    	}
    [/code:n12gw647]
    
    If you know some programming you will understand everything easily.
    
    Now you can save and close the two files, when you open construct2 now the keyboard plugin have the two actions: keyup and keydown under the sections [i]Keyboard Simulation[/i], just use them.
    
    The exact same thing can be done for the gamepad, it may be more complicated because simulate gamepad buttons with javascript may be hard(or no).
  • No, the plugins for keyboard and gamepad does not have any action, but i believe that if you edit the plugins yourself you could add the action to simulate a keystroke

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, i created a test application using the google play services plugin, so in my developer console i added a new game and linked it to my app as a web application, then i copy&paste the appID, clientID and client secret in the C2 google play services plugin, then i exported, compiled and uploaded the apk for alpha testing, now when i open the app what i see is a 403 error message: disallowed_useragent, searching on the web i discovered that this i due to some new google security policy, but haven't find any solution, well i would like to know how to solve this problem, does anyone knows how to do it? does anyone here have already used google play services and can give me a help(perhaps make a tutorial)?

    Thanks all for attention

  • Ok, i figured out! The problem is that when exporting to cordova only we have to manually configure the plugins we are using(intel XDK do it for us) , because some plugins uses 3rd party dependencies to do their job, this dependencies are listed in the edittime.js file of the plugin, so, for each plugin you use you must install the cordova plugins to make them run, in this cases they are just bridges between c2 and cordova.

    After that i finally got an "not ok" message, thanks all for attention and sereously i think that this kind of thing should be made more clear, it would save us a lot of time...

    Thanks all for attention.

  • Someone?

  • I'm using newer versions of cordova and c2 to build my game, i'm doing some tests with the IAP plugin but can't get it working, how i build it:

    export the project as a cordova app and dismark the options to export to XDK.

    so in cordova i do: cordova plugin add cordova-plugin-payment-iap(this is from here: github.com/cranberrygame/cordov ... ayment-iap Github)

    the plugin is installed and the build runs ok.

    Note: i also tried to build without the plugin but the app behaviour was the same.

    This is my project:

    on start of layout: add product ID "test_pd" and request store listing
    on store listing succes: text "ok"
    on store listing failed: text "not ok"
    on button clicled: purchase produtct "test_pd"
    on any purchase success: text "purchased"
    [/code:22tw5dz3]
    The problem is: no message is being displayed, it should at least try to download the store(i have no idea from where!!??) and show me a "not ok" message, but nothing is happening, i guess the plugin is not working, so can someone please explain me where can i get the right plugin for the IAP in C2 and the right way to configure it?
    
    Thanks for attention.
PauloMarcio's avatar

PauloMarcio

Member since 14 Feb, 2017

None one is following PauloMarcio yet!

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies