Why using OR seems to fail often

For questions about using Classic.

Post » Mon Oct 04, 2010 7:27 pm

Ok, I stumbled upon this problem: [url:2fwxhfn7]http://www.scirra.com/forum/viewtopic.php?f=3&t=7422[/url:2fwxhfn7]

I made some tests and finally think I found the symptom. Maybe it helps the developers fixing it. It seems that an event with OR'ed conditions needs several (at least two) time units. I'm avoiding the word tick, because it doesn't need to be consecutive. The evaluation is only done correctly on the second time unit earliest. I think that's why you get the impression of OR working with a kind of randomness. Because, if you use it as a sub-event for example, it will most likely be tested only once and therefore give no correct result. But as soon as it has enough time units, it works correctly.

I've made a little cap to demonstrate it. All it does is generating a random number per click and testing if this number is in a certain range (for testing purposes in an elaborate way). The trick is, that there are three event groups called method 1 to 3, and you can switch through them. You will see, that method 1 works as expectable, method 2 does not work at all, and method 3 is "half-working". The last method is the reason for me to not talk about consecutive ticks. In this group the OR'ed event is a sub-event of a "every 3000 ms" event. If you look closely, you will see that the evaluation is incorrect the first time it is called, but correct on the second call, 3000 ms later.

or_issue.cap
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Oct 05, 2010 8:36 pm

did you post it to the tracker?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Oct 06, 2010 1:13 pm

No, I didn't.

And with the list of open bugs being so long, I just hoped this one would get more attention if posted here ;)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Oct 06, 2010 9:50 pm

Still do post to the tracker. Forum posts get forgotten quickly :)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests