Pick Or Bug

0 favourites
  • 7 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Problem Description

    When pick by evaluate is used, a sub event with Or block will not limit itself to the picked.

    Attach a Capx

    https://1drv.ms/u/s!AhHSZHEulqh_gXytJvUD1PEiFvE7

    Description of Capx

    it picks by evaluate, and then does an Or condition. It then prints to text object.

    Steps to Reproduce Bug

    • simply run program
    • look at events.

    Observed Result

    Or block is run

    Expected Result

    Or block shouldn't run.

    Affected Browsers

    • Chrome: (YES/NO)
    • FireFox: (YES/NO)
    • Internet Explorer: (YES/NO)

    Operating System and Service Pack

    vista

    Construct 2 Version ID

    r243

  • Hi Prominent, here are some observations. You are using 2x 'On start layout' triggers. The first one inits the arrays, and the second one picks. The problem I see with this, and this is a recurring issue (of which I always have to find workarounds), is that during the creation of objects, the objects themselves are not registered quickly enough in memory to be referenced.

    This happens in many situations, and yours seems to be one of them. If you have a look at this modified capx I've removed the second trigger, and combined the pick condition after the creation. When you preview, you'll see that the 'bug' text is not shown.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • faulknermano , That isn't the issue. If you change the second start of layout condition to a on key press, it will still show the text change to bug.

    capx: https://1drv.ms/u/s!AhHSZHEulqh_ggFf7IjdZMjb7GMP

    The point is that it shouldn't run because there are no instances that match all those conditions.

  • Prominent, I see what you mean. There is a marked inconsistency with how picking is recognised. But also, as you pointed out, is it also an 'or' bug, because if you separate the 'type="yes"' away from the type="no" in different events, you won't fire the 'bug' text.

    On the other hand, if you use the system Pick (like you did with name="one") with "yes" and "no", while using 'or' the 'bug' text doesn't fire.

    Looks like an 'or' conditional issue. Either way there's certainly something amiss.

  • For what it's worth, this bug is actually present in C3 as well. Just tried it. Perhaps we could get the devs attention to C2 if the problem is known to exist in C3.

  • faulknermano

    Here's some info on when newly created objects can be picked. There is probably more info elsewhere if you search the forum for "top level event" or something like that.

  • R0J0hound, that's a great resource and reference. Many thanks for that. It's sometimes difficult to remember the issue I had before because the behaviour seemed inexplicable. So thanks for info.

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