How do I use pick for multiple instances?

0 favourites
  • 6 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Does anyone fully understand "pick" and "for each"

    Just an example: 10 instances of text1, 5 of them have text1.var=1 and 5 have text1.var=2

    "pick all" does just that, easy enough.

    "pick by comparison" picks 1 instance based on criteria

    The question I have is: Other than using "pick all" AND "pick by comparison" is there a way to select all 5 of the text1.var=1 ?

    One would think "for each" with "pick by comparison", or "for each" and "compare 2 values", or "pick all" and "pick by comparison" would work, but only the latter will select all 5 of the text1.var=1.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pick all is actually used to reset the "selected object list" (SOL) when it is currently filtered and you wish to select through all instances again.

    For each is used when you want to do things relative to a single instance at a time.

    Both of which is not what you are after.

    Selecting the text1 instances where var = 1 is as simple as that :

  • Well I'll be. Thanks for the help. Not sure I how I missed this little nugget.

    Thank you again, I've been complicating the hell out of this process for years.

  • For giggles I just saved the project as a new file and tested this out.

    Unfortunately, that too only triggers for the last tex1 and does not pick all the var=1

    addendum, adding a pick all and then your suggestion works. (Same as the pick all AND pick by comp)

    Looks like the pick all basically just needs a specific criteria (as in not a comparison or calculated field, no clue why).

  • It shouldn't trigger only for the last instance. I'm curious to see your implementation if you can reproduce your observed behavior in a simple c3p file.

  • Tested this out this morning.

    Your explanation:

    "Pick all is actually used to reset the "selected object list" (SOL) when it is currently filtered and you wish to select through all instances again."

    You are spot on.

    In testing this text1.var= worked as you indicated.

    In my main project I have multiple "picks" of text1 in sub-events (4 deep) which based on your info indicated I needed to clear the SOL (ie, use the the "pick all" in conjunction with the WHERE criteria).

    Makes sense now, works as expected, and is repeatable.

    Appreciate your responses and the education.

    (just in case someone else finds this while researching "pick")

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