How do I identity objects?

Get help using Construct 2

Post » Thu Aug 15, 2013 5:53 pm

Hi. Im new to the forum, but I have been using Construct 2 for while...

I'm currently making strategy game. In the game you have alot controllable objects. And player must be able to move them one by one.

My problem is that, if I have two(or more) same objects in game at same time the system thinks its one object so if I move one of them, other one moves as well.

The way I choose what object I control is basicly just by clicking it. Then system makes that object active. It works great if I have only one object in layer, but when its 2 or more system don't know how to Identity/give that object unique key so I can control it alone.

If anyone have soulution to the problem, please tell me how to do that, or send example.

Thanks for reading and sorry about my bad English.Moneyface2013-08-15 18:02:12
B
2
Posts: 4
Reputation: 208

Post » Thu Aug 15, 2013 6:56 pm

The object has a UID. Store that and then Pick by UID.
ImageImageImage
B
71
S
21
G
220
Posts: 3,646
Reputation: 123,721

Post » Thu Aug 15, 2013 6:57 pm

B
43
S
22
G
20
Posts: 735
Reputation: 11,977

Post » Thu Aug 15, 2013 8:18 pm

Thank you guys, I should have searched it up more. :/Moneyface2013-08-15 20:18:16
B
2
Posts: 4
Reputation: 208

Post » Fri Aug 16, 2013 3:10 pm

Hey, I adjusted code by adding UID activation. Now i have new problem, when i move one "Villager" and other one at same time, when one of them reach goal and stop other one stops as well.

So I want other objects (same objects) keep moving instead stopping when one of them stop.

here is picture to the code, please help me out to fix this problem.
http://imageshack.us/photo/my-images/17/ded8.png/Moneyface2013-08-16 15:11:09
B
2
Posts: 4
Reputation: 208

Post » Fri Aug 16, 2013 3:14 pm

You probably need a For Each for the Is NOT moving event so you only interact with the one object.
ImageImageImage
B
71
S
21
G
220
Posts: 3,646
Reputation: 123,721

Post » Fri Aug 16, 2013 3:36 pm

Thank you blackhornet, added for each and works perfectly!
B
2
Posts: 4
Reputation: 208


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests