Why is "else" red here?

From the Asset Store
Red Hoodie Boy game sprites for side scrolling action adventure endless runner 2D mobile game.
  • Why is "else" red in the attached image?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think it is connected to the event above

  • I don't think it is connected to the event above

    How do you mean? It's placed right after the first event.

  • the fact that it is red means it has been orphaned from the condition it was attached to. whatever that was has been deleted, so the else turns red to let you know it is not an else for anything at the moment. There is a condition above it but the else is not connected to it in any way except that the else is the next thing on the event sheet. delete the else, right click on the event above and add a new else if that one needs an else.

  • the fact that it is red means it has been orphaned from the condition it was attached to. whatever that was has been deleted, so the else turns red to let you know it is not an else for anything at the moment. There is a condition above it but the else is not connected to it in any way except that the else is the next thing on the event sheet. delete the else, right click on the event above and add a new else if that one needs an else.

    I'm not following. Putting "Else" in its own condition following another condition has always been a valid way of using "Else".

    I don't understand how the "Else" in this case could be orphaned when it's related to the condition above?

  • It's not associated at this point. It must have belonged elsewhere, and that IF was deleted. If you try to add Else to the len() IF, it will add one, in black.

  • It's not associated at this point. It must have belonged elsewhere, and that IF was deleted. If you try to add Else to the len() IF, it will add one, in black.

    I'm not understanding your explanation.

    What do you mean by "It must have belonged elsewhere"?

    Based on the image that I provided the "Else"-condition should not be red, since it's a valid event structure.

  • It's not! If it's red it's not associated. Just try adding a new Else and move on.

  • It's not! If it's red it's not associated. Just try adding a new Else and move on.

    I don't understand what you mean.

    I'm asking why the "Else"-case is red, given that it should be valid in that image.

  • That's just it. It's not valid. Just because it's directly below the IF doesn't guarantee it's associated with it. That's why it's red, to point out the problem.

  • Just delete it and add a new one by right clicking on the prior event.

    Like Allen said, that one has been 'orphaned'. You killed it's parents. Good job.

  • quackgyver I agree that this is unusual! I often move and drag "else" events all over the place and I have never encounted this. I tried to reproduce this but cannot - If I had a red "else" and delete the previous event's condition that causes the "else" to be red (e.g. have an else below a "for each" loop, then delete the "for each" condition), then the else fixes itself.

    How did you get this else to be like this? What happens if you dragged it somewhere else, then back to below this event, does it fix itself?

    The only "Else" oddity that I have seen is when you have a disabled event with a red "else", it will refuse to run your project (even though the entire event is disabled). Makes sense generally, but you'd think it'd ignore the disabled event.

  • That looks like a bug to me, if a Else block can be connected it connects automatically, and it should here

  • It does indeed sound like a bug, and the fact of deleting the "middle" event should "connect" the else to the next previous event.

    Please post a bug report of how you got to the stage where you got the red else, in order for our team to reproduce and investigate.

    https://github.com/Scirra/Construct-3-bugs

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