Edit UID/IID?

Discussion and feedback on Construct 2

Post » Mon Oct 07, 2013 5:00 am

I created a bunch of copies of a base object at design time, but I just sort of assembled them without thought of what order they were in... there are 57 of these and I need them positioned specifically at design time vs. runtime.

But at some point, I want to be able to loop through them in order and I assume this is done by the UID/IID?

So my question is can I edit the UID or Instance ID of these items to make them sequential in the order I want them to be processed in? Sort of like a tabindex for an HTML form.

Thanks!
B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Mon Oct 07, 2013 5:10 am

Whilst I'm not sure about the whole idea of changing their UID/ID's, you could do a workaround!
Have an instance variable for the object (e.g "AnotherID"), and do a "Start of Layout" and "ForEach(ordered)" loop (This will pick each object starting with the lower/highest value given, so you could specify the object's X position and it will pick from left to right in order) and in this loop, set the object's "AnotherID" to loopindex. Now you'd have each object with an ordered ID!
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Mon Oct 07, 2013 5:30 am

Thanks for the lead.. I guess I should have looked at the ForEach(ordered) criteria, I just assumed it processed them in IID order, not that I could specify.

I just put an instance variable called ProcessOrder and manually set them. These objects don't move, so the order of processing is set in the game design.

Awesome, thanks!
B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Mon Oct 07, 2013 5:56 am

You could also arrange their z-order, and "For Each" by that order.
B
230
S
62
G
33
Posts: 902
Reputation: 40,319


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests