Issue: Pick instance by UID

  • Hi everybody.

    I wasn't sure where to start this topic, so I apologize if I'm not at the right spot.

    I ran to a strange issue with the "Pick by unique ID" event. This is how it looks:

    <img src="https://dl.dropboxusercontent.com/u/64371704/POTREBI/c2.png" border="0" />

    The problem is that the "Chrome log" action is being ignored as if the "pick instance" event never occurs. It works fine if I do it this way:

    <img src="https://dl.dropboxusercontent.com/u/64371704/POTREBI/c3.png" border="0" />

    Which confirms that the instance I want to be picked is valid and therefore the event is valid, and yet the event still doesn't work.

    I also tried this way for the sake of testing:

    <img src="https://dl.dropboxusercontent.com/u/64371704/POTREBI/c4.png" border="0" />

    And I get this warning in the Chrome console:

    <img src="https://dl.dropboxusercontent.com/u/64371704/POTREBI/c5.png" border="0" />

  • This sounds like everything is working perfectly normally. If the 'Pick instance with UID' condition is not met, it does not run the event actions (so does not log anything). If you log text in the 'On function' event, it always logs text first when the function is called, then after that tries to pick an instance with a UID (which may or may not work). Nothing is amiss here.

    The console log message refers to a different function, called "highlight block". It's unrelated, the event you've shown uses a function called "MyFunction".

  • Sorry for the "MyFunction"/"Highlight block" mismatch, I updated the screenshots, but they were only misleading from the real issue, I assure you it is just a pre/after-rename thing (the initial name of the function was "highlight block", then I renamed it to "MyFunction" for the purpose of this topic, made the first 2 screenshots, renamed it back to "highlight block" and made the last screenshot afterwards). The issue still stands, I am sure there's an instance with UID 14 and yet the "pick by UID" event still doesn't work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just to keep it clean, the issue is that "pick by UID" doesn't work even thought the instance that's supposed to be picked does exist and is valid.

  • How many parameters do you call your function with ? The Param collection is 0-indexed and you are using "Param(1)", is it intended ?

  • I call the function with 4 parameters and it's the 2nd parameter I'm retrieving to pick an instance, so yes - Param(1) is the correct one. I've checked and confirmed that the parameter is retrieved correctly, the "picking part" is somehow being ignored.

  • Are you calling the function directly using "14" as a parameter ? Try logging every instance UID to see if there's actually one with the UID "14". If in fact there is, then this one will be confirmed as a bug !

  • Yeah, I tried that, the problem persists.

  • Seems like I've been using a slightly outdated version, I just read this:

    "Please note the following breaking changes since r126:

    In some rare cases, pick by UID can act differently. This should be easily resolved by adding a 'for each' loop above the condition."

    I updated to r132, the bug seems to have been fixed. Now it works great without any change in the code (I didn't even add a "for each" loop). Thank you both for your answers and sorry for alerting you for an outdated bug.

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