Slightly tricky picking/comparison help needed

For questions about using Classic.

Post » Sat Feb 13, 2010 1:08 pm

Hey, I've got a picking problem
I have ONE object with multiple instances of itself, each one is given it's own numerical ID in ascending order. So if I had 5 objects, their ID's would be 1, 2, 3, 4, 5 respectively.

I want to compare 'Variable1' of Object with ID = X to 'Variable2' of Object with ID = Y

It sounds fairly simple but I'm having a lotta problems getting it working
Any ideas?
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sat Feb 13, 2010 3:40 pm

Have you tried the "Pick by comparison" condition?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Feb 13, 2010 8:52 pm

I thought that would be the way to go, but I'm still unsure how I would go about using it because I need to pick -two- specfic objects of the same type/family and it becomes a little harder when referring to the same object, the picking has to be very specific.
I'm not 100% sure how the picking is handled in this situation anyway, I mean, CAN you pick and compare two specific sprites at all? for example:

Pick Object with .value('ID') = X
Object.value('var1') is less than Object.value('var2')
Pick Object with .value('ID') = Y

It would be nice for situations like that, if it picked the two objects to be compared by the picking criteria before and after the comparison or something. The pick event before the comparison picks the first object, and the pick event after the comparison picks the second object.
Unless of course, there's an easier way that I'm unaware of
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sat Feb 13, 2010 10:09 pm

[quote="Arcticus":1otmluuh]I mean, CAN you pick and compare two specific sprites at all? for example:

Pick Object with .value('ID') = X
Object.value('var1') is less than Object.value('var2')
Pick Object with .value('ID') = Y[/quote:1otmluuh]

I have no idea what the context is in your example, but the answer is yes, you can.

http://dl.dropbox.com/u/529356/pickingvars.cap

I tried to recreate what you posted there as best I could, like I said I don't really understand the context. It uses the family picking trick.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Feb 14, 2010 5:26 am

Ah that's pretty good
So assuming all my objects are already in a family I would have to make a duplicate family to compare them correct?
I always try to avoid having to do that, I think its kinda weak, but I guess, logically the computer needs to differenciate between them somehow.
It'd be cool if, when comparing a family to itself, it checked the other members of the family instead of itself. Unfortunately I guess that would cause other problems when you need to family object to compare something to itself lol... maybe an extra family picking condition - 'Pick from other family members'? :S

Anyway thanks again Deadeye, I'll try and jury rig up a similar system to what I'm trying and see how I go
B
3
S
2
G
5
Posts: 351
Reputation: 2,377


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests