rexrainbow's Forum Posts

  • Never mind. I should not name these plugins too ordinary. it's easy to collide with others.

    I will change my plugins and make a tool to help user changing plugin-id in cap project file.

  • Thanks for the notification.

  • Since r64 has rotate behavior, I rename my roate behavior to "rex_rotate" to prevent name collision.

  • Thanks, I work around by change

    this.a_hash = {a: 10, b: 20};

    to

    this.a_hash = {"a": 10, "b": 20};

    and it works.

  • It seems minify will change the name of properties in an object. If this object is a hash and fetched by a key string. It may become an error.

    For example, create a plugin with this code.

         behinstProto.onCreate = function()
         {
            debugger;
            this.a_hash = {a: 10, b: 20};
            this.value = this.a_hash["a"];
            debugger;
         };

    after minify

    a.U=function(){debugger;this.Te={Gi:10,Hi:20};this.value=this.Te.a;debugger};

    The goal of origin script is to get data by key "a" from a hash. But minify changes the name of key in the hash.

    origin:

    this.a_hash = {a: 10, b: 20};

    minify

    this.Te={Gi:10,Hi:20};

    So that

    this.value=this.Te.a;

    will not get the correct value.

    I put the test code in

    dl.dropbox.com/u/5779181/test_minify.7z

    My C2 version is r63 64bits

  • Ah, sorry for my bad English.

    My question is not how to get instance variables in event sheet.

    My question is how to get instance variables' name(in engine, the name will be transfered to an index) in plugin, like the condition : "Compare instance variable" does.

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/getpvofinst.png" border="0" />

    More precise, how to get the combox input to select instance variablies in plugin.

  • I don't know

    varaiable("yournamehere"&loopindex)

    exactly means, sorry. Is it a condition with some expressions in event sheet?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, user can pass an instance variable like a number/string in expression.

    My plan is that user can assign an instance variable(index) in an action. And the (behavior)plugin will remember which variable need to be log. And then it doesn't need to call log action every tick.

    The interface is like the condition in sprite: "Compare instance variable" to get an instance variable(index)

  • For example, to log the value of a property(i.e inst.X, inst.Y) or a private variable of instance.

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

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

  • I am a C2 plugin maker.

    Wish C2 can be more popular!

  • Thanks, I got it!

  • Hi,

    It seems double quoted is used to identify the string in ACE dialog. How to use double quoted in a string?

    For example: show this string

    He said "Nice!"

    in a text object.

  • If you can not get touch.X and touch.Y, try to download again, I have updated it again.