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)

Image

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

Image

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.

Image

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.
B
8
S
2
Posts: 11
Reputation: 672

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.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

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.

https://www.dropbox.com/s/ajyndybswz3hb ... .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 ?

https://drive.google.com/open?id=0B1SSu ... 3luQjNrVzg
B
33
S
18
G
27
Posts: 2,447
Reputation: 20,358


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, dimitriosfl, InfiniteRockets, jkmalau, newday198913 and 17 guests