Instance index number

Discussion and feedback on Construct 2

Post » Fri Dec 02, 2011 1:09 pm

Is there a way to see the instance index number of the selected instance of a sprite in the layout editor?

B
14
S
5
G
5
Posts: 8
Reputation: 3,601

Post » Fri Dec 02, 2011 2:03 pm

No, but that's a nice idea.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Dec 02, 2011 2:17 pm

Why is this useful? It has the same problem that you'd have if you showed UIDs in the editor. If you delete a few objects and added a few more the index and UID is different for all the objects. So if you ever used it anywhere now it's wrong.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Fri Dec 02, 2011 2:35 pm

Well it would be useful to keep track of what's where. As it is now you have to track that from memory as you add instances. So if you have a lot of instances that would be helpful.
And its not quite as bad as uid, as you would at least know what to expect to happen when you delete something.
Unless it's not possible to auto-delete any conditions pointed at that index. Then of course its not practical.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Dec 02, 2011 3:13 pm

I could be good to have it just as a reference,
not editable. Isn't the index of and instance like the "basic" Variable of that copy of the sprite?
B
14
S
5
G
5
Posts: 8
Reputation: 3,601

Post » Tue Dec 06, 2011 2:11 am

Let's say in an
exprssison I want to get the "X" position of the "Sprite1.Variable 1", to be changed by a Value like "Pos"

the only way so far is instead of using the Variable1, is to use the index where the Index number becomes Pos ex:

Sprite(Pos).X

what would be the other way of accessing that sprite in an expression
using the Variable1 instead of the index#?
B
14
S
5
G
5
Posts: 8
Reputation: 3,601

Post » Tue Dec 06, 2011 2:31 am

From conditions its either comparing the variable, comparing the uid, comparing one of the many other attributes such as opacity, or pick "nth".
But as an expression in actions the only way is the index, however you can always use that in conjunction with other attributes sprite(index).height, sprite(0).x, or sprite(1).uid even.newt2011-12-06 02:32:49
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests