Pick by Evaluate : need help in an event?

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi everyone... need a little help with Pick by evaluate event here,

    Imagine a grid of object(sp_tile), i want to pick tiles around a tile if they are present and set a variable to the picked tiles, i am using following events to make that happen...

    But it never works. What am i doing wrong here?

  • I don't think it works that way. 'Pick by evaluate' is for instances and a tile is not an instance from a tilemap.

    I think you have to loop through the tilemap tile for tile and look if the surrounded tiles are the ones you want.

    I made a little example:

    drive.google.com/file/d/1trh6LVRnulewZ2v7LrfXQSfkhk39NMkv/view

  • 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 works that way. 'Pick by evaluate' is for instances and a tile is not an instance from a tilemap.

    I think you have to loop through the tilemap tile for tile and look if the surrounded tiles are the ones you want.

    I made a little example:

    https://drive.google.com/file/d/1trh6LVRnulewZ2v7LrfXQSfkhk39NMkv/view

    Its not a tilemap object its just a sprite object with name "sp_tile".

  • Its not a tilemap object its just a sprite object with name "sp_tile".

    Oh, sorry I misunderstand that.

    This won't work. You use an 'and'-block. So there are opposite conditions in this block and the block will always be false. That should be an or-block, but 'Pick instance' is only for one instance, so it will only pick one instance (the last one) and pickCount would be 1.

    You have to split that up in 4 events and count the instances separately.

  • ok thanks for help!

  • what I like to do when I want to select things like that is use a big sprite called Detector, big enough to cover the area you want to check. set it to tileX and tileY, then have a event "Detector is overlapping sp_tile" to pick all the ones around that tile location.

    either make the Detector sprite invisible or remember to move it off screen after checking is done...

  • what I like to do when I want to select things like that is use a big sprite called Detector, big enough to cover the area you want to check. set it to tileX and tileY, then have a event "Detector is overlapping sp_tile" to pick all the ones around that tile location.

    either make the Detector sprite invisible or remember to move it off screen after checking is done...

    But be careful because this can add a lot of collision checks, and those can pile up and slow down your game

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