How do I add Multiple PICK conditions?

Get help using Construct 2

Post » Tue Aug 02, 2016 9:34 pm

Let's say I want to Pick sprites that have four different animations names, pick all the instances that happens have one of these following names:

Play
Hello
Flower
Rabbit

how would I do it best way?

I tried first

Pick Sprite where Sprite.AnimationName = "Play"
or
Pick Sprite where Sprite.AnimationName = "Hello"
or
Pick Sprite where Sprite.AnimationName = "Flower"
or
Pick Sprite where Sprite.AnimationName = "Rabbit"
---Subevent
For each Sprite order by 0 Ascending
more sub events.....

Then I removed the "or"..

but neither seems to work so maybe this is bad logic?
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Tue Aug 02, 2016 9:40 pm

Pick by comparison:
Object: Sprite
Expression: Sprite.AnimationName="Play" | Sprite.AnimationName="Hello" | Sprite.AnimationName="Flower" | Sprite.AnimationName="Rabbit"
Comparison: Equal to
Value : 1
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Tue Aug 02, 2016 11:25 pm

@blackhornet to the rescue again!

(and I have vague memory that we did same thing earlier.. :D)
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Tue Aug 02, 2016 11:41 pm

Too soon. It seems I ran the wrong capx when testing.

Did not work.

I wrote like this:
SettingGraphic&"ScissorsLeft"|SettingGraphic&"ScissorsUp"|SettingGraphic&"ScissorsRight"|SettingGraphic&"ScissorsDown"

and it did not pick any of them.
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Tue Aug 02, 2016 11:45 pm

Look closer at my example. You aren't doing the same thing.
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Tue Aug 02, 2016 11:46 pm

Oh yes. Forgot the animation name.
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Wed Aug 03, 2016 12:10 am

It did not work initially, but when I did an experiment I understood I had to create variables first! Because it did not understand (variable1 & "blabla") | (variable2 & "this"), fed it with local string varibles. THEN it worked!

@blackhornet Sorry for being daft.
B
58
S
18
G
13
Posts: 447
Reputation: 10,740


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, newt and 8 guests