BUG: 'OR' not working

For questions about using Classic.

Post » Wed Jun 08, 2011 10:24 am

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. :)
B
3
G
1
Posts: 70
Reputation: 615

Post » Wed Jun 08, 2011 10:56 am

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?
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Jun 08, 2011 11:00 am

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.
B
3
G
1
Posts: 70
Reputation: 615

Post » Wed Jun 08, 2011 11:08 am

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.
B
3
G
1
Posts: 70
Reputation: 615

Post » Wed Jun 08, 2011 11:40 am

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?
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Jun 08, 2011 11:48 am

[quote="Noga":3iwrgn45]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?[/quote:3iwrgn45]
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?
[u:3iwrgn45]1. Test[/u:3iwrgn45] - 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.
[u:3iwrgn45]2. Test[/u:3iwrgn45] - 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.
B
3
G
1
Posts: 70
Reputation: 615

Post » Wed Jun 08, 2011 2:10 pm

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: [url:1u4kwegt]http://www.scirra.com/forum/viewtopic.php?f=3&t=7428[/url:1u4kwegt]
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Jun 08, 2011 2:16 pm

Oh, I thought OR got fixed in Classic version, I'll have to read it again.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Jun 08, 2011 2:19 pm

[quote="tulamide":2ed90h54]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: [url:2ed90h54]http://www.scirra.com/forum/viewtopic.php?f=3&t=7428[/url:2ed90h54][/quote:2ed90h54]
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.
B
3
G
1
Posts: 70
Reputation: 615

Post » Wed Jun 08, 2011 2:23 pm

[quote="Shindoh":3v652iba][quote="tulamide":3v652iba]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: [url:3v652iba]http://www.scirra.com/forum/viewtopic.php?f=3&t=7428[/url:3v652iba][/quote:3v652iba]
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.[/quote:3v652iba]

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
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests