How do I correctly nest logic using OR and such

0 favourites
  • 3 posts
From the Asset Store
100 items casual and logic games. All icons are of a high quality.
  • Hi there,

    Ok so I have this bug I'm trying to isolate on iOS that doesn't happen in browser (I'm using Ejecta).. I believe I can isolate the cause, but its the logic i'm trying to setup to better do this that's giving me trouble.

    The project I have can be thought of a chapters and pages.. there are 5 chapters.. and each has various pages.. when it hits a certain page in the first chapter, it locks up.. i'm trying to get past it without breaking other things to see if this bug is the only of its kind or if it occcurs again in a similiar situation in the following chapters (each chapter having this same scene appear in it behaving in a similar fashion.

    so here's what I'm having trouble with..

    https://www.dropbox.com/s/5a2uddu5ugltw ... 0issue.PNG

    my logic above is trying to say.. "when this is this page and chapter, do one thing", any other time do the normal thing.." but the behavior in the program is behaving as such. Instead it seems to freeze at chapter 1, page 1.

    I want to create a rule that is to the effect.. when I click the "next page" button and I'm on i'm in chapter 1 page 11, jump past the next page to the next chapter... if it's not the page, then behave normal..

    Part of me thinks that maybe if i could get a big OR in between these too that might help, but I've had trouble understanding how to properly nest groups of events. Whenever I've used or, it's making everything in a single group each have an OR between it.. this is fine in some cases, but I would want the OR to be between two groups of code and I can't seem to figure out how that would be achieved.

    any advice on this would be much appreciated. it seems very simple and straight forward, but the results indicate i'm doing something wrong.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use sub-events

    On touched "button"
        - Pagecount <> 0
        OR
        - ScenarioCount <> 0[/code:2b8t41ov]
  • ah ok now i see.. so yes i put two sub events.. one cluster which includes the OR, which i never thought to do it that way.. i thought just having two objects next to each other would be sufficient, not using an or to have them both be compared.. then i had the 2nd sub event have the "it is these specific things".. so things next to each other is basically "and" right?

    If that's true, then that explains why having them next to each other not working because then I'm basically saying.. something is var1 AND var2 which never happens..

    So I can see now that basically having multiple touch events side by side can be problematic.. using these sub events allows the same touch event to be compared to several things.. this explains some other issues I've had in the past, which I had to workaround.

    Thanks!

    Caleb

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