Get an object by UID (in action)

Get help using Construct 2

Post » Sun Oct 06, 2013 6:06 am

Hi,

I know the UID of an object and would like to use it in an action.

How can I get this object?

Thx
B
11
S
2
Posts: 40
Reputation: 811

Post » Sun Oct 06, 2013 6:47 am

You have to pick it first, possibly in a subevent, depending on what you are doing.
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Sun Oct 06, 2013 7:15 am

Basically I want to highlight a puzzle piece I am dragging an object over.

here is my capx : www.lo-zone.com/labo/puzzleLo/puzzleLo2.capx

I unhighlight all piece but I need to highlight the one I am over.

I have the uid of the piece I need to highlight in a global variable ( the one I display on screen)

I've got two places where I'd need to get the object based on it's uid

Thx
B
11
S
2
Posts: 40
Reputation: 811

Post » Sun Oct 06, 2013 2:46 pm

Be aware that effects don't work in IE. Use Chrome of Firefox.

puzzleLo2_BHT.capx
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Sun Oct 06, 2013 2:57 pm

For the record, you don't need to use functions here, to call a single command. I see you were told to do this on a second thread, but that was before you posted the code for reference.
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Sun Oct 06, 2013 3:08 pm

Ok good to Know thank you. It's always good to know such things.

So far I use effects for testing only.

I managed to get a hold of my cell Id but now I am stuck with another issue related to the same issue.

It's related to this post : http://www.scirra.com/forum/puzzle-board-game-best-practices-capx-incl_topic76776.html
B
11
S
2
Posts: 40
Reputation: 811

Post » Sun Oct 06, 2013 3:14 pm

I posted twice here. Did you see the first?
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Sun Oct 06, 2013 3:31 pm

Yes thx but so far I only use effect to have visual testing.

If you can help me with my other issue feel free :)
B
11
S
2
Posts: 40
Reputation: 811

Post » Sun Oct 06, 2013 3:51 pm

I hadn't realized that you had modified things and broken what I had already fixed. That's why I was confused that you were asking for the same solution again. You should mark this thread as solved, and keep the other going, if needed still.
ImageImageImage
B
71
S
22
G
258
Posts: 3,792
Reputation: 143,200

Post » Sun Oct 06, 2013 4:22 pm

Sorry i don't get it.

What did you fix that I broke?

Regarding this topic, it's actually still valid. I didn't find a way to get an object by UID and use it in an action.

It might not be possible but would be useful (I think)
B
11
S
2
Posts: 40
Reputation: 811

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests