Severely depressed from UID pick failure

0 favourites
From the Asset Store
Act on your instances, get/set their properties and variables only thanks to their UID. No more picking trouble! Plugin
  • Ashley, I've discovered another bit of strange behavior with the pick although I'm not willing to discount the possibility that maybe I'm just misunderstanding how the pick is working in this case.

    <img src="http://dl.dropbox.com/u/12667027/Construct%202/ForloopPickBug/forlooppickfailure%20screencap.png" border="0">

    Since I've reset my pick list, how come referencing a specific BaseArray via a (UID) index doesn't seem to be working properly?

    I created this capx from scratch to test it.

    Forloop Pick Project

  • The indexing in actions ( array(index) ) works with a specific indexing of the currently picked instances (possibly IID, to be confirmed by Ashley), not their UID.

    If you want to pick a specific array out of its UID, add conditions after "Pick all BaseArray" Array.Pick by UID = your global variable.

  • KYATRIC. Thanks that clears it up, I didn't realize that the ( ) index was a reference to a IID. I'm going to have to re-read the manual about picking/indexing/IID/UID so that I avoid making this kind of mistake again.

  • Picking is picky ^^

    But that's what makes the beauty and power of C2 in the end.

  • Well you already know that the first array is (0), so the one you create is (1).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, I messed around with saving IID values instead of UIDs, since the arrays are going to be around for the duration of the program. It appears that accessing an object via its IID, aka object(IID), is not affected by any prior picking; I don't have to do any resetting or worry about selections. And unless I'm mistaken, the IID values should remain constant for a given object type *provided* that nothing is destroyed, right? Is there anything I should be concerned about when using IIDs?

  • You're right, the Object(index) syntax skips the picked objects and uses the full instance list. This was done because it turned out the feature wasn't actually useful if it stuck to the picked objects - there were lots of other cases it worked better using the full instance list. Basically it's best to stick to UIDs.

    I wonder if another feature would be more helpful here - perhaps Object[UID].Expression, like a UID version of the current expression indexing...

  • Ashley yeaaah definitely =D I dream of this feature.. often

    And addToken, deleteToken, findTokenn .... well... more token stuff 'cause token are pretty handy for some stuff

    Also Sprite["myVar" = 2].Count to count how much sprite has a variable "myVar" set to 2 :D

  • Ashley

    It might help, but you still can't know what the uid is till runtime, so basically you would end up doing object[object.variable("")].

    What about an id that the user can create from the editor, or at runtime?

  • How to set Index Instances without UID or IID: Instances CAPX

    Live sample: Instances HTML5

  • I am looking for a way to do a condition and an action on an object with the same UID.

    i am making falling objects with many platforms, the object are setting to the Y platform when they fall on it, but they always pick a random platform and never stop to the good platform,

    so is there possible to do that the falling object choose the same UID object to stop (the touched one ) ????

  • I am looking for a way to do a condition and an action on an object with the same UID.

    i am making falling objects with many platforms, the object are setting to the Y platform when they fall on it, but they always pick a random platform and never stop to the good platform,

    so is there possible to do that the falling object choose the same UID object to stop (the touched one ) ????

    This thread is well over 3 years old.

    It is preferable to create a new thread rather than bump such an old dead thread.

    You are not contributing to the OP but asking your own question, therefore you should create your own thread.

  • Thanks Zenox98, by the way I found a way to do what i wanted, I'm working on a tuto that i will post someday

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