Slightly tricky picking/comparison help needed

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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?

  • Have you tried the "Pick by comparison" condition?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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

    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.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)