Severely depressed from UID pick failure

Get help using Construct 2

Post » Wed Jan 25, 2012 7:01 pm

Well you already know that the first array is (0), so the one you create is (1).
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Wed Jan 25, 2012 7:55 pm

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?

B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Wed Jan 25, 2012 10:23 pm

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...
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Wed Jan 25, 2012 10:30 pm

@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 :DYann2012-01-25 22:35:10
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Jan 25, 2012 10:31 pm

@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?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Thu Aug 16, 2012 2:10 am

How to set Index Instances without UID or IID: Instances CAPX
Live sample: Instances HTML5
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Wed Feb 03, 2016 5:21 pm

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 ) ????
B
7
S
1
Posts: 12
Reputation: 622

Post » Wed Feb 03, 2016 5:58 pm

@matteotribros
matteotribros wrote: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.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,841
Reputation: 48,283

Post » Tue Feb 09, 2016 7:07 pm

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 :)
B
7
S
1
Posts: 12
Reputation: 622

Previous

Return to How do I....?

Who is online

Users browsing this forum: alextro, MadSpy, mnmco, Muini, Yahoo [Bot], Yura G and 34 guests