Or block not functioning correctly

0 favourites
  • 2 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)