[r184] editor z index iid bug

Bugs will be moved here once resolved.

Post » Sat Oct 18, 2014 6:53 pm

Problem Description
Changing z order in the editor changes the iid of an instance.

Attach a Capx
r184editorzindexidbug.capx


Description of Capx
Shows that iid is changed with z order

Steps to Reproduce Bug
[list]
[*] Step 1: Run preview, note text on instances
[*] Step 2: Click middle instance in editor, send to bottom
[*] Step 3: Run preview again.

Observed Result
Iid of changed z order instance is changed

Expected Result
Iid should not change until one is destroyed

Affected Browsers
[list]
[*] Chrome: (YES)
[*] FireFox: (YES)
[*] Internet Explorer: (YES)

Operating System and Service Pack
764

Construct 2 Version ID
184

Edit:
It seems that runtime changes to zorder are not affected.
You do not have the required permissions to view the files attached to this post.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Mon Oct 20, 2014 4:42 pm

Closing as won't fix. IIDs are not constant and should not be relied on like that. Use UIDs instead.
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Mon Oct 20, 2014 5:06 pm

But why should changing the z change the iid?
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Mon Oct 20, 2014 5:11 pm

Because the initial objects placed in the layout happen to be created in order of their Z order. You shouldn't rely on what order the editor happens to assign IIDs, they swap and change even at runtime as objects create and destroy; UIDs are there to be permanent references.
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Mon Oct 20, 2014 5:27 pm

The runtime change is quite exploitable for instances, as long as the change is predictable.
Uid on the other hand, is not.
Well at least keep it in mind for C3 please.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests