Is this a bug in construct with OR statements?

0 favourites
  • 13 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Try this:

    Make a new project and some text box. Make two variables in it and make one global. Set the global to 1.

    Now make it check variable one is equal to zero.

    Then make a sub event in that, in which you check if the global is above zero and the second variable is below zero as an OR block. And yes, it is an OR block in my test run. If the or block is true, make it change the text to something else.

    Can anyone else reproduce this error where the text doesn't change/the OR block does not trigger?

  • Is this what we talk about ?

    https://

    drive.google.com/open?id=0B1SSuCVV8v74NTYwNkZucTdzNkE

    There are two bloks because i cant figure out wich 'one' is meant in "Now make it check variable 'one' is equal to zero."

    Subevents run if there parent(s) is (are) True.

    Under the left mouse, the OR-subs only and only run if te local var = zero.

    Under the right mouse, the OR-subs can never ever run because you stated that de global var should be 1.

  • Is this what we talk about ?

    or

  • If variable1 = 0

    THEN (in sub event) : if global>0 OR variable2=0 THEN Change the text

    It doesn't work when it should work.

    I'm in ver 216 of construct and can't open your file - I'm on a bought copy of construct and am not sure of the process of updating (I don't want to screw up something when it's working fine for me...apart from this issue)

  • No prob. Upload a Cap. I am lost (but that is nothing new).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't use any file services and this forum wont let me post links still, iirc.

    To simplify bit Just take korbaach's example, remove the mouse and global test part and just use the OR part of it by itself,

    I've just done that and the OR statement will not fire. It's instead acting like a AND statement.

  • I post that example because noticed that

    acting like a AND statement.

    in 216..but it's fixed for 221..so it is likely old bug

  • I own a personal licence for construct - what's the update process? Just download it and install it again? I'm just not familiar when it comes to purchased products.

  • Just go to the bottom of this page, download the latest stable release (safest), and run the installer. It's pretty straight forward.

  • Okay, I've updated and the OR statement still doesn't work!

    It's the global that breaks it - if it checks two instance variables, it's fine. But check a global and an instance variable and it becomes an AND statement rather than an OR statement.

    I guess having checked here first, I'll post in bugs soon.

    Edit: Wow, posting a bug looks to be quite a hassle

  • Confirmed this does not work as intended in v221.

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

    When the second condition is disabled, or the instance variable changed to make the statement true, it works. As it stands, the text box does not change.

    Edit: Also broken in v224

  • Workarround = use System > "compare 2 values" and use the expression for the instance variable.

    Seems to work here.

    I finaly caught up.

  • Note this isn't a bug: your condition filters out all Text objects, since none of them have an instance variable that meets the condition. So the actions run since the system condition was true, but with no Text objects picked. If you add an action for another object in the event, you can see it is running.

    If the text object did change to "Success!", it would mean an action ran on an object that did not meet the event's conditions!

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