Invert sprite overlapping at offset

Get help using Construct 2

Post » Sun Jan 15, 2017 5:22 am

Trying to get C2 to check what's around a selected tile, by looking for missing tiles. I'm doing it by inverting "[tile] is overlapping [tile] at offset (-32, 0)". It works fine when there's one invert, but when I try to use two (to decide if the tile is a corner piece), it starts getting confusing. Some screenshots:

The first invert works. Selects the tiles with no other tiles to the left of them (all tiles are 28x28 snapped to a 32x32 grid)


But the second invert, which also checks to see if there's no tile to the right of them, doesn't change the outcome.


Here's another one to make sure there are no tiles to the right, above, or below. For some reason it ignores a tile directly above it.


Doing this for procedural tile placement for multiple tile types (instead of just wall/floor). An Array would probably be a better method, but just wanted to post this incase anyone knows what might be off.

edit: Should mention non-inverted seemed to work totally fine. It's only when checking with invert that it does this.
Posts: 13
Reputation: 901

Post » Sun Jan 15, 2017 6:44 am

I know you can check for collisions with the same type, but I always find it confusing.
The condition is checking for overlap with the currently picked objects, not all of them. So the first condition picks all the left hand tiles. Then the next condition picks all the right hand tiles from the ones already picked, so the left tiles have no picked tiles to it's right so your result is expected.

A solution is probably to make that event an or block and move the for each to a sub-event.
Posts: 5,523
Reputation: 84,009

Post » Sun Jan 15, 2017 9:18 pm

As R0J0hound allready said, check for collisions with the same type is for him confusing, for me it is just straight hell.
So far, i manage by converging to a solution where i at one point just pick from scratch.

I suppose that this is what you want to do. ... .capx?dl=0

But, mainly, you caught my attention since you mentioned 'procedural tile placement'.
I made an example once about that.

99Instances2Go wrote:Something like this ? ... 3luQjNrVzg
Posts: 2,493
Reputation: 21,450

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests