Object variable condition on objects within family

Get help using Construct 2

Post » Mon Dec 31, 2012 6:42 pm

Hi all

Just licenced my C2 so I figured it is the right time to also join the "friendly community" (as Scirra put it )

I looked through quite a few posts but couldn't find an answer for my prob: What I am trying to do is to run one "family condition" on multiple objects (all from the same family)so each of them is destroyed or not according to its own variable value.Is it possible to make such action with a single condition line? I only managed to make a condition with the family variable, but not with object variable.

Thnx
M
B
12
S
3
Posts: 104
Reputation: 1,650

Post » Tue Jan 01, 2013 8:24 am

Anyone?
B
12
S
3
Posts: 104
Reputation: 1,650

Post » Tue Jan 01, 2013 9:39 am

Could you be more specific and provide a sample .capx or at least a screenshot of the logic?xoros2013-01-01 09:41:08
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Tue Jan 01, 2013 11:34 am

Hi xoros
I have a text family named ShowResults including the objects ShowResult1, ShowResult2,...ShowResult(n).
Each object has the variable Result.
The multiple condition I want to run on the entire family is:
IF ShowResult(x).Result=0 destroy ShowResult(x).
Family variable will not help here since it is common to all family objects.
B
12
S
3
Posts: 104
Reputation: 1,650

Post » Tue Jan 01, 2013 12:09 pm

The family variable is common to all family objects but not it's value. Each member can have it's own separate value.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Tue Jan 01, 2013 1:15 pm

Thanx ramones :)
I was not aware of that.
Will "IF ShowResults.Result =0 Destroy ShowResults" work for me or will it destroy all family member?
(Im not near my PC so cant test it till tonight...)
B
12
S
3
Posts: 104
Reputation: 1,650

Post » Tue Jan 01, 2013 1:27 pm

It will destroy the family members that have Result = 0.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Tue Jan 01, 2013 2:25 pm

Great. Im all set than. Thnx much!
B
12
S
3
Posts: 104
Reputation: 1,650


Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 30 guests