Robsta's Recent Forum Activity

  • yep, it looks like this

    Cnds.prototype.Foobar = function (myparam)
    {
         // Generic comment here
         console.log("Some Text Here");
         return true;
    };
    

    The function doesn't get called (no console log entry, no actions from returning true).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Now I'm having a different problem, this time it's with expressions.

    Here's my code:

    var theReturnNumber = 0;
    
    Exps.prototype.getThisNumber = function (ret)
    {
         MyExternalFunction(function(response)
         {     console.log(response);
              theReturnNumber = response;
         });
              
         ret.set_int(theReturnNumber);
    };
    

    I call this 2ce in a row in construct, essentially saying

    if(theReturnNumber == X)
         Textbox.text = theReturnNumber;
    

    except with construct's trigger/event system

    Here's what happens:

    The console log displays the correct number every time I call the expression.

    The first time I call the if/display, it returns 0 to both if it is == X and displaying in the textbox.

    Every time after the first that I call it, it returns the number it should have returned the last time I called it (the number the console log returned last time).

    Here's what I want to happen:

    The expression to return the same number as the console.log returns every time.

    1 extra question:

    Does Construct 2 support an array as a parameter? Or should I make an array by parsing a string parameter? example: "(0, 2, 1, 4)"

    The original problem is solved; problem left below:

    Hello, new developer here and I'm making a plugin to integrate an existing API with Construct 2.

    I figure the most efficant way to make a number of conditions is to make them triggered, but I can't seem to make triggered conditions work, for example, if my plugin had ID: Foo, and I was trying to trigger condition Foobar, I would try:

    this.runtime.trigger(cr.plugins_.Foo.prototype.cnds.Foobar, this);

    but this line of code appears to break when I export (HTML5, minified), and test the program online.

    Some more information:

    I'm working with a pf_singleglobal plugin

    I've tried putting this code in various places in runtime.js, including pluginProto.Type() and instanceProto.onCreate().

Robsta's avatar

Robsta

Member since 17 Jan, 2014

None one is following Robsta yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies