(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
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

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
383
S
224
G
86
Posts: 24,118
Reputation: 190,444

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
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

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
104
S
23
G
17
Posts: 1,350
Reputation: 22,018

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
21
S
8
G
6
Posts: 346
Reputation: 4,891

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
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

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
96
S
34
G
29
Posts: 3,139
Reputation: 28,236


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests