(R136) Pick highest/lowest only picks 1 instance

Bugs will be moved here once resolved.

Post » Wed Jul 03, 2013 5:30 pm

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    Whiteclaws2013-07-03 17:33:42
B
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

Post » Wed Jul 03, 2013 5:44 pm

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.
Scirra Founder
B
415
S
248
G
92
Posts: 25,288
Reputation: 200,960

Post » Wed Jul 03, 2013 7:00 pm

@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



Whiteclaws2013-07-03 19:01:48
B
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

Post » Wed Jul 03, 2013 7:54 pm

@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.
Image
B
110
S
24
G
18
Posts: 1,391
Reputation: 23,017

Post » Wed Jul 03, 2013 9:10 pm

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.
B
23
S
10
G
6
Posts: 351
Reputation: 5,151

Post » Wed Jul 03, 2013 9:15 pm

@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 ...
B
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

Post » Wed Jul 03, 2013 11:16 pm

This is event what you are looking...



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

B
99
S
35
G
29
Posts: 3,139
Reputation: 28,426

Post » Tue Apr 10, 2018 10:46 am

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.
B
2
Posts: 1
Reputation: 152

Post » Tue Apr 10, 2018 11:01 am

brainbite wrote: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.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
147
S
33
G
89
Posts: 5,991
Reputation: 62,797


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest