How do I pick an instance by UID?

Get help using Construct 2

Post » Sat Oct 01, 2016 10:05 am

Hi,

this question seems to be stupid, but I have some troubles picking an instance by its UID. The game itself has a lot of objects (about 1.000).
It's a board game with a big grid.

On this board I spawn some towers (it's a tower defense game). Then I try to pick an specific tower by it's UID.
The tower is there, and the UID is matching the UID from the tower. However sometimes it doesn't pick the instance.
Below you will find the function.

Image

It works fine if I add tower by tower, but it doesn't work if I add more towers and then call the function shown above.
Any idea what can the issue could be? I know it's difficult to say with out the capx file.

I'm using Construct 2 r236 beta.

Thank you!
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,928

Post » Sat Oct 01, 2016 2:34 pm

Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Sat Oct 01, 2016 2:49 pm

Id would stay away from UID and IDD but rather just product a variable for each and just do when created set variable to What ever numbering choice you like in this case if you still want to use UID and then just function.paramter its variable rather then UID or IDD cause lots of time ive seen it reorder the number a couple of time either due to me modified the layout delete stuff and add stuff tend to screw up the UID ordering and or a bug goes un-notice like accident create and self delete lol.

Think of it like an inventory without using UID.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Sat Oct 01, 2016 3:36 pm

Thanks for your inputs. I made a workaround, so that that I haven't to use the UID. Now it's working fine. However I'm not sure why it doesn't work the way above.
Thanks!
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,928


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests