Else Event Bug

Bugs will be moved here once resolved.

Post » Sat Dec 19, 2015 5:53 am

Problem Description
The else event is ignoring all the single previous event. If there are two or more events on the same level as the else, the else will trigger even if the earlier events also trigger.

Attach a Capx
https://dl.dropboxusercontent.com/u/426 ... seBug.capx

https://dl.dropboxusercontent.com/u/426 ... index.html

Description of Capx
The capx gives a simple case of where the else is overriding a previous even on the same level. It has a slider ranging from 0 to 10. The events should change the text object to say either below 2, between 2 and 5 or greater than 5.

The else statement is making between 2 and 5 override the greater than 5 case.

Steps to Reproduce Bug
  • Set the slider to 6 or higher

Observed Result
The else event triggers and sets the text to be, "Between 5 and 2."

Expected Result
The Greater than 5 event should trigger skipping over the else. The text should read, "Greater than 5"

Affected Browsers
  • Chrome: Unknown
  • FireFox: YES
  • Internet Explorer: YES

Operating System and Service Pack
Windows 10

Construct 2 Version ID
R219 (Bug present since at least 214, maybe earlier)
B
6
S
1
Posts: 22
Reputation: 946

Post » Sat Dec 19, 2015 1:27 pm

Capx is broken.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Sat Dec 19, 2015 5:30 pm

B
6
S
1
Posts: 22
Reputation: 946

Post » Sat Dec 19, 2015 5:59 pm

Works as expected.
You have three doors.
You are telling it to go through the last door if one of the others is locked.
You are not telling it to only do that if both of the other doors are locked. or even if only one is already open.

I would suggest turning the else into a "Is between values".
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Thu Jan 07, 2016 1:11 pm

Closing as not a bug. You are missing an "Else" condition in event 3. As it stands, event 4 (else, meaning "slider value is not < 2") will always run when the slider value is >= 2, overriding the "Slider value > 5" event. You probably intended to have an else-if chain, as in:

Slider value > 5
-> "greater than 5"

Else [ <-- this was missing in your .capx]
Slider value < 2
-> "less than 2"

Else
-> "in between"

This works correctly.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests