And/Or Statements STILL Confusing Me

Not favoritedFavorited Favorited 0 favourites
  • 7 posts
From the Asset Store
**** Fairy cartoon game sprite character pack ****
  • I continue to really struggle with how to use AND/OR events in conjunction with one another. I understand the concept in areas outside of Construct, even as someone who only tinkers with development as a hobby. I am a newbie novice, so I appreciate the help.

    My question is: Shouldn't this OR block that's nested underneath my AND block still fire off these actions (when the AND block is not satisfied) or am I not understanding it correctly? If I need to duplicate the actions for the OR block, why even bother using an OR block when I'm basically just duplicating another AND block and just adjusting a few things?

    Thank you!

  • The conditions of step 183 will never be met, because if they are reached, the variable HoursPM = 21.

    And why duplicate the condition from the ClockPause variable? Let it only be in step 183.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My question is: Shouldn't this OR block that's nested underneath my AND block still fire off these actions (when the AND block is not satisfied)

    No. If the conditions in the parent event are not satisfied, then the entire event won't run - including all sub-events. It doesn't matter if there are OR-blocks or AND-blocks or empty blocks in sub-events.

    If you put a breakpoint and run your code in the debugger, you'll see how the engine processes it step by step.

  • >

    >

    The conditions of step 183 will never be met, because if they are reached, the variable HoursPM = 21.

    And why duplicate the condition from the ClockPause variable? Let it only be in step 183.

    Yes, I am trying to use an OR block here for 183 but get super confused on how to set it up. I want the text to pop up basically anytime after 9:30pm, but I can't just set as greater than 21 Hours and 30 Minutes because then it wouldn't go off at, for example, 10pm (and 0 minutes) as the minutes are reset for each new hour.

    So in short, Construct 3 confuses me when trying to setup OR blocks properly. What I'm trying to achieve is:

    Text pops up (just once) at 21 hours and 30 minutes

    OR

    Anytime after that (just once) up to 2am

  • Text pops up (just once) at 21 hours and 30 minutes

    OR

    Anytime after that (just once) up to 2am

    I hope I understood the task correctly, you need to check it because I haven't tested it.

    I suggest first optimizing and adding the frequency of checks so that it does not happen every tick, for example, 3 times per second.

    Then we check the mandatory conditions for the text to appear.

    -Is there already such a text?

    -Is there a pause?

    -Is it too late, less than 2 hours after midnight?

    -Is the time greater than or equal to 21?

    In the next block, we specify whether we have more than 22 hours or more than 30 minutes.

    This way, our block should work once, and the check will not overload the entire game.

  • >

    > Text pops up (just once) at 21 hours and 30 minutes

    >

    > OR

    > Anytime after that (just once) up to 2am

    I hope I understood the task correctly, you need to check it because I haven't tested it.

    I suggest first optimizing and adding the frequency of checks so that it does not happen every tick, for example, 3 times per second.

    Then we check the mandatory conditions for the text to appear.

    -Is there already such a text?

    -Is there a pause?

    -Is it too late, less than 2 hours after midnight?

    -Is the time greater than or equal to 21?

    In the next block, we specify whether we have more than 22 hours or more than 30 minutes.

    This way, our block should work once, and the check will not overload the entire game.

    Thank you for the help with this. I have tried what's shown in both of the images here, but the text is not popping up at.

  • I clearly stated in the screenshot that checks longer than 30 minutes and longer than 22 hours are a single block through the OR block.

    I also wrote this in the post.

    If you need such detailed instructions, you need to save the project in a single file (*.c3p) and post it, then it will be easier to make corrections and check.

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