valerypopoff's Recent Forum Activity

  • Can't you just add conditions to an "On touched object" event to ignore any that are invisible or on invisible layers?

    Yes, I can just add conditions to an "On touched object" event to ignore any that are invisible or on invisible layers. But:

    1. To ignore objects that are on invisible layer, I'd have to make a condition "System: Layer Sprite.LayerNumber is visible":

    Or the same thing with LayerName. This is a bad practice because it all stops working the second I rename the layer or change the layers order in Layers Panel or move the sprite do a different layer. And if it breaks, it's sooooo hard to find this error.

    2. Checking if the layer or the object itself is visible is not enough. Sometimes objects you don't want to be touchable at the moment are technically visible (for example, under a popup). So to deal with that you should also make a condition "System: ×Layer 'Popup_Layer' is visible":

    It only makes things worse because now you have twice the chance of accidentally breaking everything. Also you have to check all possible popup layers if there's more:

    System: ×Layer 'Popup_LayerShop' is visible

    System: ×Layer 'Popup_LayerPause' is visible

    System: ×Layer 'Popup_LayerGameOver' is visible

    Not only should you check all these layers for visibility, you should also not forget to add a new check when you come up with the new layer sometime later (and you will).

    And don't forget that you have to do all of this with every touchable object in every layout that has touchable objects on at least two layers.

    And all of the above doesn't cover cases when two touchable objects overlap on the same layer. There's not much sense in triggering both of them when I touch the one that's on top of the layer when the one that's behind may not even be seen at all.

    3. No one wants to do all of that anyways. It's 1 in a 100 case when you actually need a tap to go through all layers and objects (even the ones that are invisible) and trigger everything it bumps into. This shouldn't have been a default behavior in the first place.

  • Touch plugin (and Mouse plugin too) desperately needs additional settings:

    This is how official Touch plugin works:

    valerypopoff.ru/construct/forumpics/touch-wrong.gif

    This is how it should work in almost all cases:

    valerypopoff.ru/construct/forumpics/touch-right.gif

    I addressed the issue here:

    construct3.ideas.aha.io/ideas/C3-I-584

    Ashley I already did it with the official plugin and it proved possible. I don't want to release the plugin that is an altered version of the official one. You don't want it either. Pleeeeeeease update the plugin.

  • Ashley Is it guaranteed that all the triggers (of the same plugin and of the same condition) fire during the same tick of the game?

  • Adding html elements to the web page of your Construct game doesn't make any sense. The game is entirely shown in <canvas> element.

    You use js-libraries by invoking javascript. By calling javascript functions for example.

    Thanks for your reply.

    How can I insert an html element like this <wickey-appstore></wickey-appstore> using your plugin?

    > If this is a js-library and it works if you add it to the regular web page, then yes. You can do this with js plugin too.

    >

    > > Hey there.

    > >

    > > I am trying to integrate a library. I don't know anything about Construct unfortunately.

    > >

    > > The lib is here:

    > > wickeyware.github.io/wickeyappstore

    > >

    > > In the index.html I need something like this

    > >

    > > <head>

    > > <!-- WickeyAppStore css -->

    > > <link rel="stylesheet" href="elements/styles.css">

    > > </head>

    > > <body>

    > > <wickey-appstore></wickey-appstore>

    > > <script type="text/javascript" src="elements/wickeyappstore.js"></script>

    > > </body>

    > >

    > > This is the simplest case integration. Can I do that with your plugin?

  • If this is a js-library and it works if you add it to the regular web page, then yes. You can do this with js plugin too.

    Hey there.

    I am trying to integrate a library. I don't know anything about Construct unfortunately.

    The lib is here:

    https://wickeyware.github.io/wickeyappstore/

    In the index.html I need something like this

    <head>

    <!-- WickeyAppStore css -->

    <link rel="stylesheet" href="elements/styles.css">

    </head>

    <body>

    <wickey-appstore></wickey-appstore>

    <script type="text/javascript" src="elements/wickeyappstore.js"></script>

    </body>

    This is the simplest case integration. Can I do that with your plugin?

  • Hey guys! It's been a long time since the basic functionality of JS plugin was introduced. I've polished it since then but if I remember it right, no one really requested any additional functionality. If you wanted to make a suggestion, it's about time.

  • Supercool! Glad if I helped a little. Sorry for my douchebaggy tone)

    valerypopoff

    Thanks again for your explanation!

    I got it to work as intended :)

  • In javascript

    (function(){ ... })()
    

    or

    (function(){ ... }).call(this)
    

    is a self-executing anonymous function. You do this if you want to hide variables from the parent namespace. All the code within the function is contained in the private scope of the function, meaning it can't be accessed from outside the function, making it private.

    Giving this function a name doesn't change anything. It's not accessible. No wonder console says "exitScript is undefined".

    So, the code of ExitApi.js is self-executable. You don't have to do anything to call it. When you add this script to a page, it calls itself.

    If you properly added this script to your page (which we're not sure of. can you give me a project file?), everything should work fine. If you don't see a desirable result, it has nothing to do with the plugin. Most certainly it has something to do with you not completely understanding how it works: api-wise or even javascript-wise.

    > I don't understand what you mean by "I modified it to be: "function exitScript()". What did you modify? Why would you do this?

    The reason I did this is because the script as is is looks like this:

    > 	(function() {
    var a = function() {
    this.exit = this.b;
    this.close = this.close;
    this.delayCloseButton = this.a
    };
    a.prototype.b = function() {
    window.open("http://adwords-displayads.googleusercontent.com/da/b/html5UploadAd.html", "_blank")
    };
    a.prototype.close = function() {
    window.console && window.console.log("Exit API: Close requested.")
    };
    a.prototype.a = function(e) {
    e = Math.min(e, 5);
    window.console && window.console.log("Exit API: Close Button will not appear for " + e + " seconds.")
    };
    var b = new a,
    c = ["ExitApi"],
    d = this;
    c[0] in d || !d.execScript || d.execScript("var " + c[0]);
    for (var f; c.length && (f = c.shift());) c.length || void 0 === b ? d = d[f] && d[f] !== Object.prototype[f] ? d[f] : d[f] = {} : d[f] = b;
    }).call(this);
    

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey, cheers!

    Well I've never used ExitApi.js and I have no idea what that is. But there's no reason to believe that there's something about it that makes it work in web pages but doesn't allow it to work in a Construct game with my plugin.

    Normally you Include the following script in your HTML <head> tag

    You can do the same with javascript by accessing DOM elements.

    I don't understand what you mean by "I modified it to be: "function exitScript()". What did you modify? Why would you do this?

    It doesn't seem to work.

    Why do you think it's not working? What is the expected behavior? Did you look in the console? Does it show any errors?

    Great Addon!

    Curious how to implement google's ExitApi.js for interactive HTML5 ads.

    Normally you Include the following script in your HTML <head> tag:

    <scripttype="text/javascript" src=" tpc.googlesyndication.com/pagead/gadgets/html5/api/exitapi.js "></script>

    Then make the following JavaScript call to enable a final URL: ExitApi.exit()

    - For example, send a consumer to the final URL, using a standard anchor:

    - <a onclick="ExitApi.exit()">Learn more</a>

    Rather than include a link to the ExitApi script I included it as a .js file and then attempted to call the function on touch tap.

    The ExitApi.js file is a global "function()" - I modified it to be: "function exitScript()"

    It doesn't seem to work. Wondering if you or anyone else has experience in getting this to work.

    Thanks in advance!

    Chris

  • lucid good luck)))

  • Ashley super useful, thanks!

valerypopoff's avatar

valerypopoff

Early Adopter

Member since 7 Aug, 2016

Twitter
valerypopoff has 34 followers

Connect with valerypopoff

Trophy Case

  • 8-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies