Picking objects in the same family

For questions about using Classic.

Post » Wed Oct 08, 2008 9:17 am

Heyo, I'm having a little difficulty finding ways to use families in picking objects
How exactly would i go about it? because what if i want to compare variables from two different objects in the same family?
if Blue.Value('Value') is greater then Blue.Value('Value')???

Would that work? I'm not really getting any results
I need my events to look something like this: (Blue is the family)

If Blue is overlapping Blue
Pick Blue with highest ZHeight - bring to front

As it stands, i don't really see anything happening, nothing's being picked and the sprite order doesn't seem to change, so i tried something similar:

If Blue is overlapping Blue
If Blue.Value('ZHeight') > Blue.Value('ZHeight') - bring to front

But this has the same result, nothing. Am i doing something wrong? is there a better way to go about this? or do families have a hard time picking objects with differing variables?
please .... halp ..... *cough* *splutter*
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Thu Oct 09, 2008 3:42 am

Hmm yeah the problem is that the condition 'A overlaps A' will select all the A's which are overlapping. So say theoretically you have 5 objects and they all overlap each other. 5 Objects get selected. Then you check which one has the highest Z value...it will bring that one to the front...but the rest have no effect. Instead it would be better to chuck a 'for each ordered' under the overlap condition. However, as I believe this is for your z axis thing, it would be better just to do a for each ordered on every single object that is affected by the z axis.
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Thu Oct 09, 2008 4:31 am

Put each object in two families. Example: if blue('value') is greater than red('value'). I've found that this works quite well if you need to compare values between and check for collisions with an object in the same family.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Oct 09, 2008 6:08 am

Dave: Btw, have you checked my post about instance picking? viewtopic.php?f=17&t=1740 (I'm sorry for advertising it, but it would be cool to hear if it was useful/implementable idea or not from devs)
B
3
S
2
G
5
Posts: 263
Reputation: 2,201


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests