Weird Event Condition Issues?

  • I've had a bug in my game that I was unable to figure out for months. Today I managed to, (or so it seems), get to the bottom of it. However, I still don't understand why the change I made works. I was hoping someone could bring to light why this change works.

    The issue: A sprite is set to visible in a function, and then a function below this action is called and checks if this sprite is visible. AKA:

    Call first function: set sprite visible (within first function then call second function which checks if sprite is visible)

    The confusion:

    This image was how I managed to solve (works so far) the issue. Instead of placing the check if sprite is visible nested in the top of the function, placing it as a sub event beneath the top of the function with NO other change allows it to work. There are no actions in the top part of the function that precede this conditional check and thus the ONLY difference is placing it within the functions start or below as a sub event. Did I miss something in the manual that makes note of this, is it most likely a timing issue, are conditions placed within the top of the function ran a tick earlier?

    Just trying to improve my understanding of the engine.

    Thank you for your time,

    1Step.

  • There should be no difference at all between these two cases. If there is, please file a bug.

  • I've run into what appears to be another odd issue with condition setup, but maybe I'm missing something glaringly obvious this time?

    Doesn't Work

    Works

    The compare dictionary value condition does not seem to work properly here unless I'm missing something obvious, as these two should be the same check using different means.

    Note that the itemToBuy = "forge" is true in either case. However, the mere presence of the other condition (compare dictionary value) prevents the event from running properly despite the Or setup.

  • The first is an object condition that picks instances, and the second is a system condition that does not pick instances. So they are different.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When there is only one instance of an object isn't picking the instance based on one of its values the same as comparing the value (in terms of condition check outcome)?

    Even if it isn't the same, the fundamental confusion is how picking an instance (even if failed) would prevent the OR setup from running if the other condition is always true. Are there situations in which the condition you place in the OR setup can disrupt the condition check of the other, always true condition?

  • Here's another test of the same situation but with a more obvious true condition. However, the presence of the dictionary checks prevent it from running. As soon as I remove the dictionary checks it works. Am I misunderstanding OR in this context? From my understanding if any of the conditions in an OR stack is true the event will proceed, however this does not appear to be the case in this situation.

  • Another finding (Note tutorialState does = "completed" in both tests):

    Does not work:

    Works:

  • It's really hard to comment without seeing the entire project. By far the easiest way to help with issues like this is: create a new blank project, create the minimal events demonstrating the difference, and share that project.

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