r86 OR Condition executed multiple times ?

Bugs will be moved here once resolved.

Post » Sun Apr 15, 2012 10:43 pm

Not sure if this is by-design,
but i think this is really confusing that OR Condition is executed multiple times as long as the condition is true/fulfilled.

The Action part should be executed only once (when the whole condition is fulfilled/TRUE),
instead of running the action as many times as the condition is true (like right now)

Here is a simple example:



capx:
http://dl.dropbox.com/u/39382262/OrSimple.capx

RESULT:
myNumber: 1    Result: 2, 3, 4, 5
myNumber: 2    Result: 3, 4, 5
myNumber: 3    Result: 4, 5
myNumber: 4    Result: 5

EXPECTED RESULT:
myNumber: 1    Result: 2
myNumber: 2    Result: 3
myNumber: 3    Result: 4
myNumber: 4    Result: 5


Turning the action into sub-event doesn't really work either:


capx:
http://dl.dropbox.com/u/39382262/OrSubEvent.capx

The weird thing is, on this case when myNumber is 1, it only executed once:
RESULT:

myNumber: 1    Result: 2
myNumber: 2    Result: 3, 4, 5
myNumber: 3    Result: 4, 5
myNumber: 4    Result: 5

EXPECTED RESULT:
myNumber: 1    Result: 2
myNumber: 2    Result: 3
myNumber: 3    Result: 4
myNumber: 4    Result: 5

Potato2012-04-15 22:44:07
B
27
S
9
G
8
Posts: 123
Reputation: 7,511

Post » Sun Apr 15, 2012 10:50 pm

maybe add a 'trigger once while true'??
B
25
S
3
G
5
Posts: 391
Reputation: 5,457

Post » Sun Apr 15, 2012 11:01 pm

hmm.. I'm not sure how to use trigger in this case,
if i trigger it like this:



It still doesn't work,
it still executed multiple times
B
27
S
9
G
8
Posts: 123
Reputation: 7,511

Post » Sun Apr 15, 2012 11:15 pm

@Potato you can solve the issue by reversing the order for your conditions. First myNumber=4, myNumber=3, myNumber=2, myNumber=1. I think you just created a chain reaction. When c2 is checking if the first condition applies your code already changes the next one to yes, so c2 continues without any condition actually stopping it, and all this in one tick.nemo2012-04-15 23:21:41
B
37
S
4
G
5
Posts: 369
Reputation: 5,328

Post » Mon Apr 16, 2012 12:30 am

maybe adding the trigger to each condition instance.

trigger sys mynumber = 1
or
trigger sys mynumber = 2

etc...

B
32
S
7
G
10
Posts: 934
Reputation: 12,660

Post » Mon Apr 16, 2012 2:14 am

@Potato, you're right, in r86 OR is a bit weird and actually is equivalent to copying and pasting the event multiple times with each condition. Luckily I've already changed it for the next build - it will work more like a true logical OR, only running the actions once if any condition was true.
Scirra Founder
B
205
S
134
G
43
Posts: 17,490
Reputation: 112,237


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests