How do I add Multiple PICK conditions?

0 favourites
  • 7 posts
From the Asset Store
Kids Game
$24.50 USD
50% off
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • 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?

  • Pick by comparison:

    Object: Sprite

    Expression: Sprite.AnimationName="Play" | Sprite.AnimationName="Hello" | Sprite.AnimationName="Flower" | Sprite.AnimationName="Rabbit"

    Comparison: Equal to

    Value : 1

  • blackhornet to the rescue again!

    (and I have vague memory that we did same thing earlier.. )

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Look closer at my example. You aren't doing the same thing.

  • Oh yes. Forgot the animation name.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)