(R136) Pick highest/lowest only picks 1 instance

  • Capx

    I guess it's not totally a bug , it may be by design , so no capx is needed ...

    Steps to reproduce:

    1. Create 3 instances of 1 object

    2. Give the object a variable and set 2 of them to a value other than 0

    3. Pick the instances with the condition

    Observed result:

    Only picks 1 instance even if multiple instances have the same variable values

    Expected result:

    Picks all the instances that have the highest instance variable

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Not needed

    Construct 2 version:

    136

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing, it's by design (I think it would be a surprise if it picked more than one instance, so it's better for it to pick an arbitrary single instance if there's more than one with the same maximum value).

    Please always provide a .capx, though. It's always necessary and in this case would have also helped illustrate what you meant.

  • Ashley , but it always prefer the instances near 0,0 , as I want it to pick a random instance , and that is a bummer ...

    Is there any workarounds , as I want it to pick the highest instances , but randomly

  • Ashley,

    If I prefer to filter one object by its instance called by ID, like giving a specific behavior for all the monsters with ID = 1.

    I could use a for each loop to select all of them?

    Just curious about it.

  • To pick a random instance there, you would

    PickHighest/Lowest.

    Save the number of that instance as a variable

    then in another event pick the object based on variable and then pick a random out of all those objects that have the same variable you checked the High/Low on.

    Just adds like 2 events, and I think the Pick Highest/Lowest is better being designed to pick a singular object VS multiple objects.

  • Thndr

    Already thinked of that and that's what I'm using now , and doesn't seem elegant tho

    Well , it's a workaround after all ...

  • This is event what you are looking...

    <img src="http://i.imgur.com/gm1pEgO.png" border="0" />

    Maybe you think Pick Highest/Lowest is still useless... but it may be useful to arrange all instances in order to delete

    <img src="http://i.imgur.com/vKrhvYw.png" border="0" />

  • I think Pick lowest/highest is useless when it gives you only one if there are more matches.

    I wanted to choose a random next level by the points the player achieves. If it would work like expected, it would be just a simple condition, and now its a lot more hassle.

    Not what I expect from a game engine.

  • I think Pick lowest/highest is useless when it gives you only one if there are more matches.

    I wanted to choose a random next level by the points the player achieves. If it would work like expected, it would be just a simple condition, and now its a lot more hassle.

    Not what I expect from a game engine.

    Why post in a closed thread from 5 years ago? Nothing you post here has any relevance to how the software was 5 years ago.

    Also, the sticky specifically states not to post here.

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