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
34
S
8
G
4
Posts: 156
Reputation: 3,779

Post » Tue May 31, 2016 2:49 pm

Compare two values:
(a=2 & b=3) | (c=4 & d=5)
Equal to
1
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

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
34
S
8
G
4
Posts: 156
Reputation: 3,779

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
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

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
34
S
8
G
4
Posts: 156
Reputation: 3,779

Post » Tue May 31, 2016 3:18 pm

Pass the UID and pick it again.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494


Return to How do I....?

Who is online

Users browsing this forum: Armench, Jackriduk, kiki4construct and 29 guests