Nested conditions for Pick UID not working

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.
  • Hi,

    I have some conditions that are nested under a sprite destroy trigger. The conditions are testing if the sprite being destroyed is on the edge of the game board (if so do nothing) and picking an instance of the sprite by UID stored in the game board array (array's UID are correct).

    I can't seem to make this work, I have tried all sorts: placing them under different branches (On kill, On animation finish), having Pick UID as subevent, not having the edge tests, and also tried using Pick nearest.

    <img src="https://dl.dropbox.com/u/2175584/personal/forums/construct2/NstedConditions.JPG" border="0" />

    Any help is much appreciated.

  • How events work

    After an event ends, the next event begins from scratch. Its conditions will start picking from all instances again.

    On the other hand, sub-events (which appear indented) carry on from where its parent event left off. A sub-event will further filter the instances left over by the event that came before it.

    Your event is targeting a single Sprite, the one being destroyed, that's why the sub-events can't find any other...

    For example, you could add a System action "Pick all", to get all the Number sprites, before choosing one from its ID.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Still not getting anywhere with Nesting the conditions under a Pick All.

    I have also tried to assign the X/Y cords to a variable.

    <img src="https://dl.dropbox.com/u/2175584/personal/forums/construct2/NstedConditions2.jpg" border="0" />

  • Yeah in your last screenshot, Pick all is being negated by the subsequent Is animation "Destroy" playing

    Pick all should be right before Pick instance with UID

  • Really struggling to grasp this, thought I had Events and Variable/Instance Scoping understood but obviously not!

    I have tried to put a Pick All just before Pick with UID (as another condition and as parent/sub-event). Just to be clear I don't want to pick all instances, I just need the ones either side of parent.

    Below is a stripped down .capx (makes it smaller/easier to find events), wont compile but just so you could possibly position the events correctly for me <img src="smileys/smiley17.gif" border="0" align="middle"> cheeky I know but this is getting frustrating.

    https://dl.dropbox.com/u/2175584/Construct2Examples/NestedPickAll.capx

  • Do forget to strip down the plugins as well next time, I had to install 3 of them

    Anyway, what you did looks fine to me. If your target instance has indeed this "destroy" animation playing, I guess it's ok with just one "Pick all" at the top like you first did. But there's no way to test the export so I made another example that I can confirm to work...

    PickAll.capx

    Hopefully that helps

  • Thank you for your help, I actually ended up doing this with a Function as your method wasn't giving me the results I needed. Should have done it from the start :(

    <img src="https://dl.dropbox.com/u/2175584/personal/forums/construct2/NstedConditions3.jpg" border="0" />

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