How do I write conditions so all are applied?

1 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey C-world. Below is a screenshot of my sandbox where I'm trying to figure out how to write the condition so that:

    • All boxes with the boxes.onteam variable that equal yes
    • must also have the boxes.coins variable equaling 1000

    What's happening instead when I click the arrow box, is the boxes that have the .onteam = yes are subtracting their coins if .coins is greater than/equal to 1000.

    Expectation is - If all the boxes that are .onteam = yes don't have .coins => 1000, nothing should happen.

    I can't figure out how to write that condition. I've tried "for each", without "for each", etc with no success. Any help is appreciated.

  • Does this work for you?

    I've assumed the following:

    1. If all of the boxes marked onteam have >=1000 coins then all of those boxes should have their coins added to total_coins, and their indvidual boxes.coins value set to zero.

    2. If only some of the onteam boxes have coins >=1000 then none of the onteam boxes should have their coins transferred.

    3. Boxes that are not onteam should not have any of their coins transferred regardless of whether they are greater or less than 1000.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, your assumptions were deadly accurate!

    Thank you so much for the file to explore further. I'm out of town until tomorrow morning and promise to dig into your example then. I appreciate your time and help with this!

  • Hey there. Just opened up your example and it appears you used version 410 and I've got 407.2 so it won't open. Where did you download the newer version from?

    Found 410 (I had 407.2 installed locally so I could use it when I have to fly or camp). Diving into it now.

  • Genius! That gives me a working model to reverse engineer and adapt to my sandbox.

    Thank you much! Link to buy you a coffee?

  • You're welcome, no coffee needed :-)

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