Combined AND/OR?

Discussion and feedback on Construct 2

Post » Tue Jul 02, 2013 8:29 pm

Not sure if im missing something, but isn't it possible to do AND/OR in same event level?

Like

Color = yellow
Figure = Square
- OR -
Color = Red
Figure = Square

If not then it would be nice to be able to do
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Tue Jul 02, 2013 8:33 pm

I think that you should be able to create a condition of any complexity by using system -> compare 2 values, and simply enter your condition into the expression box.

Cheers,
GregCJK2013-07-02 20:49:02
B
18
S
3
G
3
Posts: 83
Reputation: 3,736

Post » Tue Jul 02, 2013 8:35 pm

Yeah I agree with this.
A half-workaround is using subevents like

+Key "Z" is pressed
OR
+Sprite is touched
--(Subevent)--+PlayerSprite is on ground
--------------=Simulate player jump

I think the one problem with this workaround though is you cannot place Trigger events like "On key pressed" inside a subevent.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Tue Jul 02, 2013 8:40 pm

My problem, well its not really a problem, I was just wondering if it was possible or whether I did something wrong :D

Because I have something that needs to be check for whether its a weapon or not, if its not a weapon it should do something else, and in case its a weapon it needs to check if an equipment slot is free, and if its not it should just do the same as if it were not a weapon. And it would just be a lot easier to just make combine AND/OR conditions to check it. nimos1002013-07-02 20:41:33
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Tue Jul 02, 2013 8:42 pm

Sure it would be nice if we could mix and/or, but the work around is fairly simple.
Just get rid of the or, and have the and's in two separate events.
You would have to duplicate the actions, but we have the function object that simplifies that.
Image ImageImage
B
168
S
50
G
169
Posts: 8,281
Reputation: 108,191

Post » Tue Jul 02, 2013 8:48 pm

[QUOTE=nimos100] Not sure if im missing something, but isn't it possible to do AND/OR in same event level?

Like

Color = yellow
Figure = Square
- OR -
Color = Red
Figure = Square

If not then it would be nice to be able to do [IMG]smileys/smiley1.gif" align="middle[/IMG] [/QUOTE] use families

|-FamilyWithAllTheColors
|---subevent:
|-----figureA
|-----or
|-----figureB
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Tue Jul 02, 2013 11:46 pm



Compare Two Values(Figure=Square && Color=Yellow) = 1(ie both are true)
OR
Compare Two Values(Figure=Squase && Colour=Red) = 1

However I do agree that it would be nice to have AND conditions within OR. Maybe the Event shouldn't be a toggle between AND an OR, but instead it's

Add OR condition.

Color = yellow
Figure = Square
- OR - (right click event, add OR Condition)
Color = Red
Figure = Square
- OR - (right click event, add OR Condition)
Figure = Triangle
Colour = Plaid
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018


Return to Construct 2 General

Who is online

Users browsing this forum: NetOne and 14 guests