Or block not functioning correctly

Bugs will be moved here once resolved.

Post » Mon Mar 21, 2016 4:46 am

Problem Description

OR block with two conditions referencing variables does not work - acts as AND block. Ref: viewtopic.php?f=178&t=170213

Attach a Capx
https://www.dropbox.com/s/pym3zfv9cu2xp ... .capx?dl=0

Description of Capx
On Start of layout, text should change to "Success!" if either GlobalVariable > 0 (Currently true) OR InstanceVariable <0 (Currently False)

Steps to Reproduce Bug

Preview, then disable/change InstanceVariable condition then preview

Observed Result
Text does not show "Success!".

Expected Result
Text should show "Success!", as one of the conditions in the OR block is true.

Affected Browsers
  • Chrome: Yes
  • FireFox: Not Installed/Unknown
  • Internet Explorer/Edge: Yes

Operating System and Service Pack
Windows 10 x64

Construct 2 Version ID
R224 64 Bit
Mistakes were made.
B
52
S
26
G
109
Posts: 1,615
Reputation: 61,651

Post » Tue Mar 22, 2016 4:25 pm

Closing as not a bug. It is working correctly. Try setting the text of a different Text object: it is running the event.

The problem is the OR block runs, and finds that no instances of the Text object have that instance variable value. However because the system condition was true, it runs the event anyway, but with zero Text objects picked. This means there are no instances to run the "set text" action on.

If the object's text was changed, it would mean an action ran on an object that did not meet the event's conditions, which contradicts the way events work.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests