plazatin's Forum Posts

  • Thanks dop2000 for the reply, seems to have done the trick!

  • I'm using image points to set my collision boxes' size and position. I have them in pairs, say image point 1 and image point 2. The col box is placed in point 1 and and sized all the way to point 2.

    I tried checking if both image point 1 and image point 2 exist by accessing it and checking if true, but it still proceeds even if there is no image point 2.

    Tried as condition:

    System: Sprite.ImagePoint(1) ≠ 0

    System: Sprite.ImagePoint(2) ≠ 0

    System: Sprite.ImagePoint("test1") ≠ 0

    System: Sprite.ImagePoint("test2") ≠ 0

    Tried as expression:

    Sprite.ImagePointX(1) <> 0 & Sprite.ImagePointX(2)

    Sprite.ImagePointX("test1") <> 0 & Sprite.ImagePointX("test2")

    Any thoughts on why this is happening?

    Tagged:

  • This post offers the same thought I had, which was to use a local variable for storing events. As mentioned, that would probably be troublesome (more code, more variables) when comparing lots of attributes.

    construct.net/en/forum/construct-2/how-do-i-18/pick-uid-expression-59942

    I ended up using IID as a workaround, which works in my example. First I pick by Nth (0) and assign that object's IID to a local var, and do the same for the next var. Then i just use the IID to reference them in expressions and easily compare attributes

    e.g.:

    Object(IID1).X < Object(IID2).X

    Still, if anyone knows if it's possible to reference via Nth Instance via system expression or UID directly, I'd like to know how. This will remove the need for the temporary vars.

  • Set your acceleration and decceleration to 0 on jump, store it to a temporary variable, then reassign it back on land.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it possible to reference an object by UID or Nth Instance via expressions?

    I am doing a self collision, and found that you can choose the objects that collided by picking the nth instance. I want to compare some values of the objects, say the X-coordinate for this example, and then pick the instance based on it being higher/lower. I initially thought I could directly reference them by Object(0).X and Object(1).X, but as it turns out, this is the IID.

    Is there a way for me to similarly reference objects by the Nth Instance or UID using expressions? This will significantly trim down code, even in this example. Right now I have temporary local variables for the attributes I want to compare. I pick the 1st instance, store it to a temp variable, pick the second, and compare the variable. I understand that you can pick by Instance Comparison, but this would just mean I would have to create the temporary local variables as instance variables. This will be increasingly troublesome if I wanted to compare several attributes.

    So, is there a way, or perhaps a better approach?

  • You do not have permission to view this post