rfisher's Forum Posts

  • I got around it by checking all instance variables if they are strings and if it is a string, check for a certain string which then allows my behavior to disable the solid behavior just for my behavior.

    What I did was make a behavior that allows the player to walk through a wall that is solid but blocks all enemies.

  • I'm trying to check for overlap of a solid with:

    var collobj = this.runtime.testOverlapSolid(this.inst);

    Then check a instance variable of the overlap instance. The following works, but i want to reference by its name, not index.

    collobj.instance_vars[0]

    Any help would be appreciated.

  • Here is the code that solved my problem.

    var mylen, myl;
    var myflag = 0;
    var mytype = this.inst.type;
    var myinstances = mytype.instances;
    
    for (myl = 0, mylen = myinstances.length; myl < mylen; myl++)
    {
        myinst = myinstances[myl];
        if ( myinst.x == this.inst.x && myinst.y == this.inst.y && this.inst.get_iid() != myinst.get_iid() )
        {
            myflag = 1;
        }
    }
    
    
  • Tried the following code and it gets stuck at cnd.type, it says its null.

    var runtime = this.runtime;
    var cnd = runtime.getCurrentCondition();
    var mytype = cnd.type;
    var mysol = mytype.getCurrentSol();
    var myinstances = mysol.getObjects();
    var mylen, myl;
    var myflag = 0;
    
    for (myl = 0, mylen = myinstances.length; myl < mylen; myl++)
    {
        myinst = myinstances[myl];
        if ( myinst.x == this.inst.x && myinst.y == this.inst.y )
        {
            myflag = 1;
        }
    }
    
  • So basically i'm asking how do I get the x and y postion of each instance so i can check for overlap?

  • I have created a behavior that moves a enemy in a grid and is restricted by solid objects. I would like to make each enemy not overlap each other inside the behavior. Can anybody point me in the right direction to add the functionality to my behavior.

  • Ashley

    What you described "deeply nested subevents and for-each loops" is why my game has better performance. All i can say is, THANK YOU!!!

  • Is anybody else seeing a performance increase compared to r103.2? My current game at times would dip to 45-50 fps during certain actions and now it only hits 58-60 fps.

  • The javascript function getTime() returns the number of milliseconds since midnight Jan 1, 1970 and will always be unique. If you can use this variable it will solve your problem. The problem is how to implement this solution.

  • Schoening

    What competition? I would like to enter if its not already over.

  • Is there any reference to the new expressions for the touch plugin. I would love to use them, but since i don't think anybody knows, I'm forced to reinvent the wheel.

  • Is there a simple example on how to use this variable. I'm just not sure on what AngleAt(0) means or AngleAt(1) means.

  • You can represent the 3 postions using binary with 1 variable.

    Like with a 8 bit number the least significant bit is 1 and the next is 2 and the next is 4.

    variable == 4 the result is oox

    variable == 2 the result is oxo

    variable == 1 the result is xoo

    So the variable can be anything between 0-7 which represents a condition you can act on.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    Thanks for the reply.

    My Bounce Behavior is using dt and all i did was multiply dt by time scale. I also disable the behavior when time scale == 0.

    Keep up the good work, C2 is AMAZING.

  • Disregard, i already found out what to do.

    "this.runtime.timescale" is just a multiple of time and after implementing this in my behavior, the pause plugin works great.