[Plugin] Can "set_any" pass an object?

  • This question is about creating plugin.

    In expression.js:

         expvalueProto.set_any = function (val)
         {
              if (typeof val === "number")
              {
                  ?this.type = cr.exptype.Float;
                  ?this.data = val;
              }
              else if (typeof val === "string")
              {
                  ?this.type = cr.exptype.String;
                  ?this.data = val.toString();
              }
              // null/undefined/an object for some reason
              else
              {
                  ?this.type = cr.exptype.Integer;
                  ?this.data = 0;
              }
         };

    It seems an object will be ignored by

    this.type = cr.exptype.Integer;
    this.data = 0;

    Can "set_any" pass an object type? Maybe it can carry an object like an array to another plugin object.

  • No - the only expression types supported are int, float and string. Arrays might be supported in future but not for the time being.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Glad to hear that.

    Maybe I can use string to replace passing an array object. <img src="smileys/smiley36.gif" border="0" align="middle">

    Btw, another question is

    How to get combo list of instance variables name?

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