MZ tile passability confusion

When checking the tiles in my map with $gameMap.checkPassage() using the bit 0x0f (the bit for passability I think), the red rectangles in my image shows the tiles that were returned as impassable.
What Im a bit confused about is the green square of 4 tiles that were returned as passable in the middle.
That tile is marked as impassable in the tileset so why do are those tiles considered passable?
Did I use the wrong bit for passability? Would they show up as impassable using a different bit? (without the normal passable tiles also showing up as impassable of course)

passability.png
passability is not as easy as yes/no.

most likely you got confused by the ceiling tiles.
These tiles have a very special passability that is used to simulate a two-level-dungeon.
IF the player can find an override (usually a ladder but unfortunately any passable decoration counts as an override), the player can climb onto the top of the walls and walk on the ceiling tiles there.
Additionally those ceiling tiles have a directional passability settings to prevent the player from leaving them directly toward a regular floor tile - otherwise anyone would be able to go onto the ceiling from the floor above the wall.

To help more we would have to see the tileset settings. As said above there are a few other things that can modify passability because of the combinations of different tiles on different layers, like star passability tiles and so on.
Ai, I was afraid it was something like that.
It is an A4 (Walls) tile, so in the tileset settings it is only a single tile which just has an 'x' for passability. I assume there is no real way to make the tile completely impassable then.
So if I wanted them impassable I would have to place an invisible impassable tile on a higher layer or add the walls tileset to one of the normal slots of the tileset so I can set those specific tiles to impassable and place them in using shift.
Or is there some bit that is set for the A4 ceiling tiles that isnt set for most other passable tiles I can use to identify these ceiling tiles?
I don't know how the internal handling of the tiles goes, that you'll have to ask other people.
Perhaps @Shaz can help here from programming the tile change plugin.
Since, based on your map, the player has no way to get up there...what's the problem?
No trying to sound like a jerk, just want to understand why it's an issue 🙂

If you want to make sure they're not passable. Ever. No way, no how... You could use any of the various region plugins to mark that as impassable via a region. There are plenty of them out there, I think one even comes with MZ.
I guess you could always go ahead and use somethin like yanflys region restrcitions plugin to make anything you want impassable/passable, even to npcs.
Since, based on your map, the player has no way to get up there...what's the problem?
No trying to sound like a jerk, just want to understand why it's an issue 🙂

If you want to make sure they're not passable. Ever. No way, no how... You could use any of the various region plugins to mark that as impassable via a region. There are plenty of them out there, I think one even comes with MZ.

I was just messing around with things for a script Im working on.
My test didnt yield the result I expected so I wanted to understand why and asking seemed easier than fumbling around blindly.
Its not really a problem and you can already get around it using normal tiles (though its just a little inconvenient), so theres no reason to use regions which I would rather use for other more important things since you can only have one region per tile.
A couple of issues here that may or may not have been touched on above.

You haven't provided the full script call you're using, and without the full call, it's impossible to tell if you're calling it correctly. Based on you saying 0x0f is the "bit for passability" I'd say your call is not right.
I'm sure I made a post here (probably in response to someone's question) stating exactly what each of the 16 bits were for, but I couldn't find it again to show you. And it takes a while to go through the code to work it out (bitwise manipulation makes me think harder than usual). However ...

There are 4 bits that control directional passability, plus another 3 for vehicles and one more for the star. The checkPassage function takes 3 arguments - the x and y locations, and the bit. The bit needs to be adjusted for the direction.

What you're seeing in your screenshot is normal and fine. The A4 tiles come in pairs. There is a vertical/front part on the bottom of each pair - these are walls, cliff faces, tree trunks. Then a horizontal/top part on the top of each pair - these are wall and cliff tops, and leaves on trees. These particular tiles all have a special passage setting that you can't change in the Tilesets tab. They are not passable from/to the top and sides, but they are from the bottom. So if you have something the player can use to get onto them from below, such as a ladder or stairs or rope, you will be able to walk around on them.

I'm actually a bit surprised ALL of the tops didn't show up that way in your screenshot, but that comes back to the parameters you passed in to your call. I reckon, if done in the right way, ALL of those tops of wall tiles would show up as being passable from below but no other direction. And of course since you have a wall below each one, the player would never be able to get onto any of them.
Ah yes, I should probably have used the term 'flags' instead of 'bit' (function parameter was named bit and didnt think too hard about it).
Thanks for the clarification, too bad you couldn't find your post on exactly what each bit is for.
Slightly annoying the editor doesnt allow you a bit more control of configuring the tileset directly (probably related to keeping it more beginner friendly I guess).
Here you go.


I don't know how helpful this will be to your situation, other than giving you some background on how they work. I believe what you are seeing in your screenshot is what you should be seeing - there is no issue here.
Oh I never meant to imply that something was wrong. It is just that the way it works is slightly inconvenient for what I was trying to accomplish (and only very slightly so). This topic was never about a problem I needed help with. I was just a little confused with what I encountered and I wanted to understand what was going on (which I feel like I do now).
Thank you for your time.

(If there's any question left it would be why they left the last bit unused instead of using 4 bits for terrain tag which would have increased the available amount of terrain tags from 7 to 15. Seems silly)
(If there's any question left it would be why they left the last bit unused instead of using 4 bits for terrain tag which would have increased the available amount of terrain tags from 7 to 15. Seems silly)

Yeah, I thought exactly the same thing! How many times have people needed more than 7 terrain tags?!

Original thread: https://forums.rpgmakerweb.com/threads/tile-passability-confusion.131104/