How do I do advance and/or if conditions

Get help using Construct 2

Post » Tue May 31, 2016 8:39 am

Hello,

I want to do the following:

if((a==2&& b==3)||(c==4&&d==5))
{
//execute something
}

Is there a way to have a single event for this in construct 2?
and not like:
if a=2 and b=3 do something
and a second event if c=4 and d=5 do the same thing
B
39
S
9
G
4
Posts: 178
Reputation: 4,063

Post » Tue May 31, 2016 2:49 pm

Compare two values:
(a=2 & b=3) | (c=4 & d=5)
Equal to
1
ImageImageImage
B
72
S
22
G
290
Posts: 3,885
Reputation: 159,511

Post » Tue May 31, 2016 2:52 pm

Well my real game is not a=2 but something like if object 1 on drop && variable 1=2 or c=4 and d=5
B
39
S
9
G
4
Posts: 178
Reputation: 4,063

Post » Tue May 31, 2016 2:59 pm

You can't do that with a trigger. Just do them separately and call a function to do the "something".
ImageImageImage
B
72
S
22
G
290
Posts: 3,885
Reputation: 159,511

Post » Tue May 31, 2016 3:08 pm

yes this is a solution, but I need to pick up the object that is being dropped inside the function call
B
39
S
9
G
4
Posts: 178
Reputation: 4,063

Post » Tue May 31, 2016 3:18 pm

Pass the UID and pick it again.
ImageImageImage
B
72
S
22
G
290
Posts: 3,885
Reputation: 159,511


Return to How do I....?

Who is online

Users browsing this forum: oosyrag and 6 guests