valerypopoff's Forum Posts

  • Ashley

    I have a plugin that uses c2_callFunction and c3_callFunction in its source code. When I export the project with "minify script" option enabled, it seems to minify c2_callFunction and c3_callFunction to something like "g_zu" which ends up being undefined.

    Am I doing it wrong? Is it a bug? Is it by design?

  • Что, если в проекте мне нужно будет взаимодействовать с невидимыми и одновременно с видимыми объектами? Я так понимаю, если в плагине touch поставить игнор невидимых объектов, то вся система рушится?

    Все, что ты написал, действительно можно расписать в событиях. И смысл тогда? Пусть лучше не забивают себе этим голову, а исправляют баги, да добавляют действительно нужный функционал в С2, который нельзя воссоздать в коде, типа оффсет для tilebackground.

    Your attitude is why people hate russians in internet communities.

    1. The answer to your question "What if I need to interact with both invisible and visible objects" is obvious: do whatever you do now. Create the logic of telling visible objects from invisible ones. The setting "Ignore invisible objects" can't stop you from it. Just don't use it if you obviously don't need it. Your "what if" can't be an argument against what I propose.

    2. The mere fact that you can do anything with checks and events is never sufficient to deduct that we're good here. I never said that you can't recreate it with checks and events. I'm saying that when you do this, it's clumsy. I'm also saying that from my experience it's 1 in 100 case when what you need is a default Touch plugin behavior. You don't have a point here, man.

    3. And please don't do this "Let them do another thing instead". They know what they're doing. If you think that your feature request is more fancy, go create a topic about it and see if people need it.

  • Ashley I messed up a bit.

    "System: Layer Sprite.LayerNumber is visible" works fine if you rearrange or rename layers. It stops working if you have Sprite instances on different layers, which is most certainly the case: imagine a close button that is the same on all popup layers. To deal with that you should also assign an instance variable to the Sprite and make it different for different instances so you can always check the visibility of a layer that contains a certain instance of the Sprite. This is messy.

    And if you try a different approach with "System: Layer 'Layername' is visible", then it gives you all the problems I described in a previous post.

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

  • Try Construct 3

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

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

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