How do I select an object by UID

Get help using Construct 2

Post » Wed Jan 21, 2015 1:37 pm

Message: bentwonk is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Hi this is driving me insane..

I a sprite type object, I used the editor to place five of them on screen, each insists on having a unique name (I assume these are the instances or the object). On game initiation I store the UID of each of these, but I cannot work out how to access them again via the UID.

I have looked at both the system.pick by comparison, and system.pick nth instance but both require me choose the object, (and then lists the five unique names), if I already knew the object I would not have to pick it, I simply want to pick the object from all game objects that matches the UID.

I have been unable to find example code of picking by UID, would very much appreciate seeing it.

What am I missing?

(when deleting my sprites form the layout, they are referred to as instances, but then each one (instance?) is listed when asked to 'pick an object" in the events sheet, this is confusing me)


Found the problem, thanks to ROJOhounds example here: because I was right clicking on the layout and selecting insert new object, where as I should have dragged them from the projects panel to create instances under the same name.

Thank you
Ben
Last edited by bentwonk on Wed Jan 21, 2015 2:16 pm, edited 1 time in total.
B
7
Posts: 33
Reputation: 351

Post » Wed Jan 21, 2015 2:11 pm

Sounds like you've cloned the object, not copied it.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725

Post » Wed Jan 21, 2015 2:39 pm

Try this demo
You do not have the required permissions to view the files attached to this post.
B
245
S
37
G
15
Posts: 1,940
Reputation: 40,089

Post » Wed Jan 21, 2015 10:18 pm

Yes!, blackhornet, thank you.

Hmm, which leads me to a second problem, I want my game to be multiplayer, but I seem only to be able to sync objects, not instances of objects, attached is a slightly modified pong demo, whats odd is the two sprite instances are transmitted to the client, but the rest are lost.

Seems kmsravindra 876478 is the same issue



Lordshiva I don't think I explained my self well enough, but thank you for the swift reply.
You do not have the required permissions to view the files attached to this post.
B
7
Posts: 33
Reputation: 351


Return to How do I....?

Who is online

Users browsing this forum: htmlgames and 4 guests