How to do Condition1 OR(event1 AND condition2))

Get help using Construct 2

Post » Tue Aug 21, 2012 12:45 am

E.g.

variable X = 9
OR
(button touched
AND variable Y = 0) -> do a long list of actions.

then have one list of actions.

However, If I do the what appears to be right, then I have to duplicate the actions in both blocks (which is horrible).

I havent worked out how to share a capx yet. I have dropbox, but the only option to share a folder it gives is to share with a specific person, not everyone. Below is a link to the file, but I really hope noone can download it otherwise everyone can see everything!

https://www.dropbox.com/s/o89d19qbbjzyphp/and_or.capx

B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Tue Aug 21, 2012 1:02 am

hey nutmix,

once you have your variable X = 9 event, you want to right click on the whole box (not just the event) and "make it an Or block". Then you can add your second variable to it.
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Tue Aug 21, 2012 4:40 am

Genki is right for the use of the or block.
But to be honest, with the example in your and_or capx, it makes absolutely no sense.

Your parent event will only execute if the value of "a" is equal to 1.
Than you would like as a sub event to check if the value of "a" is 0.
As it is now, with no actions changing whatsoever the value of "a" is, it makes absolutely no sense.

I don't know where you're going with it.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Aug 25, 2012 11:15 am

Sorry to bump an old topic, but I can't seem to do what he's trying to do either. To clarify, I'm trying to get the OR block to say:

- Condition A
- Condition B
or
- Condition C

but it won't let me group A and B together, it forces it into this:

- Condition A
or
- Condition B
or
- Condition C

I'm not sure if you guys read his question wrong or I'm reading your answers wrong, but I can't get that to work no matter what I do.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Aug 25, 2012 11:28 am

What about:

-Condition A
-Condition B

-Condition C
-Else
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Sat Aug 25, 2012 11:30 am

Well hey, looks like that performs the same exact thing. Good idea!

Although I tend to shy away from using else's, since in Construct Classic there was some obscure bug that ruined one of my projects for a week... or did the OR's do that? I DON'T KNOW WHO TO TRUST ANYMORE!!
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Aug 25, 2012 12:25 pm

I could not get
(Event A
and
Condition B)
or
Condition C

to work, I so I altered the programs logic to work with

Event A
-- Condition B
else
-- condition C

B
15
S
5
G
2
Posts: 357
Reputation: 3,691


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, abdalghani, Marxally and 27 guests