0 Favourites

Alternative "or" for checking multiple variables [solved]

This forum is currently in read-only mode.
  • So, the "or" condition is being buggy for me, so I have been looking for an alternative method of checking several different private variables. Unfortunately "or" is hard to search on, so I apologize if this has already been answered before ^^;

    What I want to do, is that when the player clicks a button, the game will run a check on 5 or so objects' private variable to see if any of them returns "0". If just one of them has 0, I want one thing to happen. If none of them do, I want something else to happen.

    I tried to improvise with something like this (only two objects in test):

    System compare: str(Elli('activity')) or str(Sheila('activity')) Different to 0

    But it's not really working...

    Any ideas?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • If you have multiple instances you can pick the instances you want to check via private variable, and then once they are picked you can check those selected objects using "For each".

    You can then use yet another variable(global) to add to the "zero" count if one equals 0, then if the count is greater than 0 do this, equal to 0 do that.

    If you want a particular object picked in the comparison you should use "Compare a private variable". System compare will not pick for you.

  • I was a little confused by your reply at first, but while testing it I actually found out how to make it work by using another global variable.

    So thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
162 11,429
Bleenx's avatar
Bleenx
Unread hot topic
102 6,404
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
0 Favourites
Isometric multiple floors
74 9,718
eleanorawesome's avatar
eleanorawesome