[SOLVED] PickedCount returns nothing?

0 favourites
  • 5 posts
  • Hello everybody!

    For example I have 5 sprites. All of them has Opacity = 0 by default. After event's triggers some of these sprites can get Opacity = 100 or lose it again to zero.

    Next in final point of algorithm I ask to Pick Sprite where Sprite.Opacity = 100 and then compare Sprite.PickedCount with another variable.

    It works OK if we have at least 1 such sprite. But if have no such sprites Sprite.PickedCount returns NOTHING. And I expect for 0 (or even null). And this is the problem.

    I.e. when I try to know how many sprites was picked it does not trigger neither Sprite.PickedCount = var nor "empty" Else.

    Also if we ask C2 to write Text -> Set text -> Sprite.PickedCount this action will not trigger (Text value stay permanent) as there is no events approaching.

    Any ideas about this?

    Of course I can loop For each Sprite and search for Sprite.Opacity = 0 and increase some variable by 1 when success. And if there is no such sprites this value will stay 0 by default.

    But this decision is not so "beautiful" like the first.

    P.S. I want to attach source file to this post. It's strange but I can't find where to do this.

  • Attachments are not available at this time.

    You will need to use one of the numerous free hosting sites, such as Dropbox, Google/Microsoft drive etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • zenox98 thank you for this. Will this feature return in future?

    Anyhow, the source file is there:

    LINK: dropmefiles.com/Hf3lB

    Construct version: C2 r214 beta

    File TTL: 14 days

  • Pick Sprite where Sprite.Opacity = 100 is a condition and if the condition is not true it wont trigger and never execute the action or go to the sub-condition.

    If you want to know if there are sprites with opacity=0 then you have to do this with an else-condition.

  • Asmodean Oh, yeah! Thank you, bro! I've just really not guess about that Pick condition simply become false. I thought that it have to try to pick objects and return 0 or smth. like that if there are no objects meeting the condition.

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