Destroy object doesn't work on OR block

0 favourites
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi. I found a bug.

    Problem Description

    On out of layout event I try to destroy object, but after Destroy action it keeps staying on a layout.

    Attach a Capx

    https://yadi.sk/d/cZrqjWGQau8qi

    Description of Capx

    It's just an example.

    Steps to Reproduce Bug

    Click to the bottom black rectangle. The blue circle will start to fall down. When it will be out of the layer the red one must be destroyed. But the red circle stays on the layout.

    Observed Result

    The red circle is staying on the layout when the blue circle is out of the layout.

    Expected Result

    The red circle must be destroyed when the blue circle is out of the layout.

    Affected Browsers

    • Chrome: YES
    • Internet Explorer: YES

    Operating System and Service Pack

    Windows 7 SP1

    Construct 2 Version ID

    Release 178 (64-bit)

  • It worked fine for me. I tested it on chrome, Internet Explorer and Firefox, and both circles were destroyed.

  • Which OS, service pack and version of Construct 2 do you have? 32 or 64?

  • I have tested this example on another PC - the problem persists. Also Win7 SP1, Construct 2 Release 178 (64-bit).

  • I've tried conditions as in picture below:

    [attachment=0:3ty4afw7][/attachment:3ty4afw7]

    Ashley, I could be wrong and missing something but my hypothesis from the case is the OR block seems to behave like an AND block.

    r178

    win7 sp1 64

    MotoR I'm thankful to you for this finding, finally I figured out what the hell is wrong with my events.

  • [quote:33vwa5ce]the OR block seems to behave like an AND block

    I created the second example that shows that the OR block works right. In this example when the blue circle is outside the text "The blue circle is outside!" becomes visible but the red circle is not destroyed.

    Thats's the second example:

    https://yadi.sk/d/bSP-X9rwav7XW

    [quote:33vwa5ce]I'm thankful to you for this finding, finally I figured out what the hell is wrong with my events.

    The second example shows that events work right. But "Destroy" action does not work.

  • But "Destroy" action does not work.

    Oh you're on to something, does it means that destroy object doesn't work on OR block perhaps the best description for the bug? What do you think?

    It seems we have narrowed it down to the root cause I think.

    OR block = no bug

    Destroy object = no bug

    Or block + destroy object = bug

    In my project, it's hard to tell because I got a lot of action/condition in it, and awful lot of nesting, "destroy" is a part of it. I've separated it into different blocks at the moment to get it working.

  • [quote:29kq13o8]OR block = no bug

    Destroy object = no bug

    Or block + destroy object = bug

    Yes, you're right. It works so.

    [quote:29kq13o8]I've separated it into different blocks at the moment to get it working.

    Yes. If I call the function and do all destroy actions in it - objects will be destroyed correctly. 3-d example: https://yadi.sk/d/hfq_N7ouavoox

    However, I think that the bug must be fixed anyway.

  • Oh you're on to something, does it means that destroy object doesn't work on OR block perhaps the best description for the bug? What do you think?

    Thanks. I agree with it. I changed the topic title

  • However, I think that the bug must be fixed anyway.

    Yep, its a must. I've been dwelling for weeks wondering what's wrong. It's quite easy to miss if events actions/conditions have already expanded substantially.

  • If the blue circle is outside layout, 1 blue circle is picked and 0 red circles are picked, so there are no red circles to destroy. Isn't that correct?

  • If the blue circle is outside layout, 1 blue circle is picked and 0 red circles are picked, so there are no red circles to destroy. Isn't that correct?

    I'm confused now, I thought it should be 1 blue circle picked and all red circle picked (regardless outside or onscreen)? Seems, that's the way it works if the block is a singular condition because condition picking only consider blue circle? Red circle is pick all since no condition pre-pick it, and by default all were selected?

  • I'm not saying I'm right, just an idea, but I would think the condition Red:Is Outside Layout has to pick the objects that fit the condition, and in this case 0 Red objects, so that in the action you don't have all Red objects picked, you have none.

  • My fundamental understanding on how it works is at stake now, codah can you assist on dissecting the capx provided and give some insight what is truly going on? The ORblock is really bothering me now.

    [attachment=2:22yxctty][/attachment:22yxctty]

    [attachment=1:22yxctty][/attachment:22yxctty]

    [attachment=0:22yxctty][/attachment:22yxctty]

    Lol, my brain is totally in garbage state now, I'll rest for a while to get back my sanity and cuteness.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would rather defer to higher authorities But what I think is:

    In the first case, no Red objects are involved in picking, so that ALL red objects are picked, and so when blue goes outside layout, ALL red objects are destroyed (all 1 of them).

    In the second case, it's as I said above. 0 Red objects are picked because 0 Red objects are outside the layout, so 0 Red objects are destroyed.

    Just my understanding and I'm happy to stand corrected.

    Edit: I'd be interested if you could say, in words, what you expect to happen in each case, and why. Also out of interest, add a few more Red objects on the layout.

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