BUG: 'OR' not working

This forum is currently in read-only mode.
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • EDIT: BUG - This is how You do it: Create a Sprite Object; Give it a Bullet Behaviour; Insert a new Event: " 'On Sprite Bullet Exceeded Range' OR 'On Collision with 'Sprite' " - Sprite: Move at Angle, Speed '20', Direction '0' (Values shouldn't matter).

    THEN: Add a new Group, and move this whole event into that Group, run the application.

    Bad Event Using 'OR':!:

    Is it just here, or does the 'OR' condition never work?

    Whenever I try to use it in the Event Sheet, I get an error on starting the application.

    It is saying something like "OR cannot be used as the first condition".

    Of course OR can't be the first condition, I always have it in the middle between two events.

    And Yes, the 'OR' is inside the same box/frame, as the two events.

    I am using Windows 7 - 64Bit - Construct v1.2

    Thanks for Your time.

  • Can you make screenshot of it? You say between two events, do you really have it like in here, the "or" is between two conditions inside one event?

  • Yes, trust me, exactly like that.

    I know that for sure, because I tried to read up on the 'OR' use in events again on the wiki, after I kept getting the error, after changing everything possible around.

  • Okay, this is very weird.

    I just tried using 'OR' on a new blank application file (should have done that before), and now it works perfectly.

    But I SWEAR, in my bigger project file, whenever I wanted to use 'OR', it kept telling me it can't be the first condition, although I never put it as the first.

    EDIT: Yeah, I just checked my main project file again, inserting an 'OR' and combining the two events, that I had to seperate before, because the 'OR' wasn't working.

    And indeed, it does NOT work, and I get the error again. "BAD event using 'OR' conditions:..."

    EDIT 2nd: Okay, I tried to nail the problem down a little more now.

    In that project file, the area that always gets me that error when using 'OR', is inside a group.

    Which I thought shouldn't make any difference, but apparently it does?

    1. Test - I made a simple condition example, "If 'Left Mouse Button pressed' OR 'Right Mouse Button pressed' - Move player sprite X+20". THIS WORKS Inside and outside of the group.

    2. Test - Using the same conditions that always gave me the bad 'OR' error. A Bullet Sprite using Bullet Behaviour, called Bullet; "If 'Bullet Exceeds Range' OR 'On Collision with Enemy Family Objects' - Move player sprite X+20". This Works OUTSIDE of any Group. This does NOT WORK, when put inside ANY Group. And always gives the "BAD Event using 'OR' Conditions" error.

    Can anyone explain this to me? If need be I can post the .cap file later.

  • I tried create two separate events and then combine them with OR, if there is problem, but it works. Maybe you should send your cap to the developers. Have you started your project in CC1.2 or in some older version where OR was still buggy?

  • I tried create two separate events and then combine them with OR, if there is problem, but it works. Maybe you should send your cap to the developers. Have you started your project in CC1.2 or in some older version where OR was still buggy?

    Okay, I tried to nail down the problem a little more now.

    In that project file, the area that always gets me that error when using 'OR', is inside a group.

    Which I thought shouldn't make any difference, but apparently it does?

    1. Test - I made a simple condition example, "If 'Left Mouse Button pressed' OR 'Right Mouse Button pressed' - Move player sprite X+20". THIS WORKS Inside and outside of the group.

    2. Test - Using the same conditions that always gave me the bad 'OR' error. A Bullet Sprite using Bullet Behaviour, called Bullet; "If 'Bullet Exceeds Range' OR 'On Collision with Enemy Family Objects' - Move player sprite X+20". This Works OUTSIDE of any Group. This does NOT WORK, when put inside ANY Group. And always gives the "BAD Event using 'OR' Conditions" error.

    Can anyone explain this to me? If need be I can post the .cap file later.

  • There is an issue with 'or'. I think I found the possible reason for it some time ago, and wanted to work on it now that I started helping with Construct Classic development. But I currently don't have a pc, I can't work on it.

    Here is the link describing the possible issue: http://www.scirra.com/forum/viewtopic.php?f=3&t=7428

  • Oh, I thought OR got fixed in Classic version, I'll have to read it again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is an issue with 'or'. I think I found the possible reason for it some time ago, and wanted to work on it now that I started helping with Construct Classic development. But I currently don't have a pc, I can't work on it.

    Here is the link describing the possible issue: http://www.scirra.com/forum/viewtopic.php?f=3&t=7428

    What's weird though, is when following the exact same steps I explain in the (updated) first post, the 'OR' event works, but it will start giving the error message, as soon as You put it into a Group.

  • > There is an issue with 'or'. I think I found the possible reason for it some time ago, and wanted to work on it now that I started helping with Construct Classic development. But I currently don't have a pc, I can't work on it.

    >

    > Here is the link describing the possible issue: http://www.scirra.com/forum/viewtopic.php?f=3&t=7428

    >

    What's weird though, is when following the exact same steps I explain in the (updated) first post, the 'OR' event works, but it will start giving the error message, as soon as You put it into a Group.

    Yup, I noticed that as well. I had OR expressions on my game and they only worked when they weren't in a group.

    Alternate method for OR right now: Have a function and call it in the two (or more) conditions, this prevents copy and paste of actions for each condition

  • I know, but I do think it has the same reason, the time units needed to evaluate the or'ed conditions. On the top level of the event tree it gives the impression of always working (although it does only work beginning with tick 2 (instead of tick 1).

    I use the following image to explain it to myself:

    Tick N: First condition is retrieved. Second is missing, so it can't be compared. Any call to the 'or' event will fail.

    Tick N + 1: Second condition is retrieved. Both are present to compare. A call to the event will be successful.

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