Pick Or Bug

Report Construct 2 bugs here.

Post » Tue Apr 04, 2017 5:34 am

Problem Description
When pick by evaluate is used, a sub event with Or block will not limit itself to the picked.

Attach a Capx
https://1drv.ms/u/s!AhHSZHEulqh_gXytJvUD1PEiFvE7

Description of Capx
it picks by evaluate, and then does an Or condition. It then prints to text object.
Image

Steps to Reproduce Bug
  • simply run program
  • look at events.

Observed Result
Or block is run

Expected Result
Or block shouldn't run.

Affected Browsers
  • Chrome: (YES/NO)
  • FireFox: (YES/NO)
  • Internet Explorer: (YES/NO)

Operating System and Service Pack
vista

Construct 2 Version ID
r243
B
45
S
20
G
65
Posts: 1,115
Reputation: 38,121

Post » Sat Apr 15, 2017 6:17 am

Hi @prominent, here are some observations. You are using 2x 'On start layout' triggers. The first one inits the arrays, and the second one picks. The problem I see with this, and this is a recurring issue (of which I always have to find workarounds), is that during the creation of objects, the objects themselves are not registered quickly enough in memory to be referenced.

This happens in many situations, and yours seems to be one of them. If you have a look at this modified capx I've removed the second trigger, and combined the pick condition after the creation. When you preview, you'll see that the 'bug' text is not shown.
B
41
S
12
G
1
Posts: 68
Reputation: 2,955

Post » Sat Apr 15, 2017 2:46 pm

@faulknermano , That isn't the issue. If you change the second start of layout condition to a on key press, it will still show the text change to bug.
capx: https://1drv.ms/u/s!AhHSZHEulqh_ggFf7IjdZMjb7GMP
Image
The point is that it shouldn't run because there are no instances that match all those conditions.
B
45
S
20
G
65
Posts: 1,115
Reputation: 38,121

Post » Sat Apr 15, 2017 7:41 pm

@prominent, I see what you mean. There is a marked inconsistency with how picking is recognised. But also, as you pointed out, is it also an 'or' bug, because if you separate the 'type="yes"' away from the type="no" in different events, you won't fire the 'bug' text.

On the other hand, if you use the system Pick (like you did with name="one") with "yes" and "no", while using 'or' the 'bug' text doesn't fire.

Looks like an 'or' conditional issue. Either way there's certainly something amiss.

Image
B
41
S
12
G
1
Posts: 68
Reputation: 2,955

Post » Sat Apr 15, 2017 8:35 pm

For what it's worth, this bug is actually present in C3 as well. Just tried it. Perhaps we could get the devs attention to C2 if the problem is known to exist in C3.
B
41
S
12
G
1
Posts: 68
Reputation: 2,955

Post » Sat Apr 15, 2017 8:50 pm

@faulknermano
Here's some info on when newly created objects can be picked. There is probably more info elsewhere if you search the forum for "top level event" or something like that.
viewtopic.php?f=151&t=188042&p=1103159&hilit=top+level+event+picking&sid=7fedee42b545c8add8fc29287ac034e6#p1103159
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » Sun Apr 16, 2017 2:19 am

@R0J0hound, that's a great resource and reference. Many thanks for that. It's sometimes difficult to remember the issue I had before because the behaviour seemed inexplicable. So thanks for info. :-)
B
41
S
12
G
1
Posts: 68
Reputation: 2,955


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests