Identifying which family member is being used?

Get help using Construct 2

Post » Sun Aug 18, 2013 8:21 pm

Say I have a function that works for several objects, and these objects are in a family.

I need a way to figure out which member of the family is being used, or in my current line of thinking, I do. Is there a way to do this, or some clever method of determining this?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,234

Post » Mon Aug 19, 2013 4:43 am

Adding a variable to this objects and setting a different value for each one to compare it later?
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Aug 19, 2013 4:46 am

It might help to have some context - what do you mean by 'being used'?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,709

Post » Mon Aug 19, 2013 6:36 am

You mean if you had a family called 'pets' which contains 'cat' and 'dog' objects. And you want to know if the currently picked pets is a cat or dog?

You could do it with an event like this:
pick cat by uid pets.uid

It will only run if pets is a cat.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Mon Aug 19, 2013 6:37 am

If I understood you correctly, you could do this:

.. familyMember1 pick by uid Family
.... Do stuff for familyMember 1

.. familyMember2 pick by uid Family
.... Do stuff for familyMember 2

etc.

Edit: The Hound beat me to it :)vee412013-08-19 06:37:34
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Mon Aug 19, 2013 9:45 pm

Thanks everyone for all the help!

To elaborate more on what I'm trying to do - basically I'm creating a complicated snake. Except there are several snakes and I need to find out which snake I'm working with :)
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,234


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests